/* Custom CSS for QR Menu - Optimized for Performance */

/* PDF Modal Styles */
.pdf-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
    overflow: hidden;
}

.pdf-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.pdf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
}

.pdf-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 90%;
    max-height: 92vh;
    width: 420px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
    overflow: hidden;
    margin: auto;
}

.pdf-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    background: #dc2626;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    z-index: 10;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pdf-modal-close:hover {
    background: #b91c1c;
    transform: scale(1.1);
}

.pdf-modal-close:active {
    transform: scale(0.95);
}

.pdf-modal-body {
    padding: 10px 12px;
    max-height: none;
    overflow: visible;
}

.pdf-modal-body h2 {
    font-size: 18px;
    margin-bottom: 8px;
}

.pdf-container {
    width: 100%;
    height: auto;
    border-radius: 6px;
    overflow: visible;
}

.pdf-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.duyuru-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 6px;
    object-fit: contain;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .pdf-modal.active {
        padding: 5px;
        align-items: center;
        justify-content: center;
    }

    .pdf-modal-content {
        max-width: 95%;
        max-height: 92vh;
        margin: 0 auto;
        width: 95%;
    }

    .pdf-modal-body {
        padding: 8px 10px;
        max-height: none;
        overflow: visible;
    }

    .pdf-modal-body h2 {
        font-size: 15px;
        margin-bottom: 6px;
        padding-top: 2px;
    }

    .pdf-container {
        height: auto;
    }

    .duyuru-image {
        height: auto;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        display: block;
    }

    .pdf-modal-close {
        top: 6px;
        right: 6px;
        width: 34px;
        height: 34px;
        font-size: 15px;
        position: absolute;
        z-index: 100;
    }
}

@media (max-width: 480px) {
    .pdf-modal.active {
        padding: 5px;
        align-items: center;
        justify-content: center;
    }

    .pdf-modal-content {
        border-radius: 10px;
        width: 96%;
        max-height: 93vh;
    }

    .pdf-modal-body {
        padding: 6px 8px;
        max-height: none;
        overflow: visible;
    }

    .pdf-modal-body h2 {
        font-size: 14px;
        margin-bottom: 4px;
        padding-top: 0;
    }

    .pdf-container {
        height: auto;
    }

    .duyuru-image {
        height: auto;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
        display: block;
    }

    .pdf-modal-close {
        top: 4px;
        right: 4px;
        width: 32px;
        height: 32px;
        font-size: 14px;
        position: absolute;
        z-index: 100;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Prevent body scroll when modal is open */
body.modal-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
    height: 100%;
}

/* Mobile touch optimizations */
* {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Allow text selection for specific elements */
p, span, h1, h2, h3, h4, h5, h6 {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Menu card styles - Simplified */
.menu-card {
    cursor: pointer;
    transition: transform 0.2s ease;
    will-change: transform;
}

.menu-card:hover {
    transform: translateY(-2px);
}

.menu-card:active {
    transform: scale(0.98);
}

/* Mobile touch feedback - Simplified */
@media (max-width: 768px) {
    .menu-card {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .menu-card:active {
        transform: scale(0.95);
        opacity: 0.8;
    }
}

/* Social button styles - Simplified */
.social-btn {
    cursor: pointer;
    transition: transform 0.2s ease;
    will-change: transform;
}

.social-btn:hover {
    transform: scale(1.05);
}

.social-btn:active {
    transform: scale(0.95);
}

/* Logo container styles - Simplified */
.logo-container {
    transition: opacity 0.2s ease;
}

/* Custom shadows - Lightweight */
.custom-shadow {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.custom-shadow-lg {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 640px) {
    .text-2xl {
        font-size: 1.5rem;
    }
    
    .text-lg {
        font-size: 1.125rem;
    }
    
    .p-6 {
        padding: 1.25rem;
    }
    
    .px-4 {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

@media (max-width: 480px) {
    .text-2xl {
        font-size: 1.25rem;
    }
    
    .text-lg {
        font-size: 1rem;
    }
    
    .p-6 {
        padding: 1rem;
    }
}

/* Focus styles for accessibility */
.menu-card:focus,
.social-btn:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Loading states - Simplified */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.loaded {
    opacity: 1;
}

/* Image loading - Simplified */
.image-loaded {
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Prevent text selection on interactive elements */
.menu-card,
.social-btn,
button,
a {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Mobile-specific touch improvements */
@media (hover: none) and (pointer: coarse) {
    .menu-card:hover {
        transform: none;
    }
    
    .social-btn:hover {
        transform: none;
    }
    
    .menu-card:active,
    .social-btn:active {
        transform: scale(0.95);
    }
}

/* Ensure proper touch targets on mobile */
@media (max-width: 768px) {
    .menu-card,
    .social-btn,
    button,
    a {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Smooth scrolling - Lightweight */
html {
    scroll-behavior: smooth;
}

/* Prevent zoom on input focus for iOS */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
    select,
    textarea,
    input {
        font-size: 16px;
    }
}

/* Custom scrollbar - Simplified */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 2px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Modal scrollbar */
.pdf-modal-body::-webkit-scrollbar {
    width: 5px;
}

.pdf-modal-body::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 4px;
}

.pdf-modal-body::-webkit-scrollbar-thumb {
    background: #dc2626;
    border-radius: 4px;
}

.pdf-modal-body::-webkit-scrollbar-thumb:hover {
    background: #b91c1c;
}

/* Performance optimizations */
.menu-card,
.social-btn {
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Print styles */
@media print {
    .menu-card,
    .social-btn {
        break-inside: avoid;
    }
}

/* Image optimization */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Reduce repaints */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Optimize for mobile performance */
@media (max-width: 768px) {
    * {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}
