/* ============================================
   GALLERY PAGE SPECIFIC STYLES
   ============================================ */

body {
    background: linear-gradient(135deg, #1a0a0e 0%, #2e1619 100%);
    padding: 0;
    margin: 0;
    min-height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.header {
    text-align: center;
    padding: 30px 0 15px 0;
    flex-shrink: 0;
}

.header .logo {
    margin-bottom: 15px;
}

.header .logo img {
    max-width: 240px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(235, 51, 73, 0.3));
}

.header h1 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 10px;
    display: none;
}

.header p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.1rem;
    margin-bottom: 20px;
    display: none;
}

.stats {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 24px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    font-weight: 600;
    font-size: 0.95rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 15px;
    padding: 0 25px;
    margin: 0 auto;
    max-width: 100%;
    height: calc(100vh - 280px);
    overflow: hidden;
}

.image-card {
    background: rgba(26, 26, 46, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.image-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 60px rgba(235, 51, 73, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.1);
    border-color: rgba(235, 51, 73, 0.3);
}

.image-wrapper {
    position: relative;
    width: 100%;
    flex: 1;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.image-card:hover .image-wrapper img {
    transform: scale(1.08);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 40%, rgba(0,0,0,0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.image-info {
    color: white;
    width: 100%;
}

.image-info h3 {
    font-size: 1rem;
    margin-bottom: 5px;
    color: #fff;
    font-weight: 600;
}

.image-info p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.7);
}

.card-actions {
    padding: 10px;
    background: rgba(10, 10, 15, 0.6);
    display: flex;
    gap: 6px;
    justify-content: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}

.action-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 18px;
    padding: 8px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.action-btn i {
    font-size: 12px;
}

.action-btn:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.action-btn.print-btn:hover {
    background: rgba(235, 51, 73, 0.2);
    border-color: rgba(235, 51, 73, 0.5);
}

.action-btn.share-btn:hover {
    background: rgba(235, 51, 73, 0.2);
    border-color: rgba(235, 51, 73, 0.5);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 20px 0;
    flex-shrink: 0;
}

.pagination a, .pagination span {
    padding: 10px 16px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.pagination a {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.pagination a:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.pagination .current {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: #fff;
    border: 1px solid rgba(235, 51, 73, 0.5);
    box-shadow: 0 4px 12px rgba(235, 51, 73, 0.3);
}

.pagination .disabled {
    background: rgba(255, 255, 255, 0.03);
    color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    cursor: not-allowed;
}

.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    background: rgba(20, 20, 30, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    color: #fff;
    padding: 10px 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.back-btn:hover {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(235, 51, 73, 0.4);
    border-color: rgba(235, 51, 73, 0.5);
}

.empty-state {
    text-align: center;
    padding: 100px 20px;
}

.empty-state h2 {
    color: rgba(255, 255, 255, 0.7);
    font-size: 2rem;
    margin-bottom: 15px;
}

.empty-state p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 1.1rem;
}

/* QR Code Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-content {
    background: rgba(26, 26, 46, 0.4);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    margin: 8% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.close-modal {
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: normal;
    cursor: pointer;
    position: absolute;
    right: 15px;
    top: 15px;
    transition: all 0.3s ease;
    line-height: 1;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.close-modal:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal h3 {
    color: #fff;
    margin-bottom: 15px;
    font-size: 1.3rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.modal-qr {
    margin: 25px auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    width: 290px;
    height: 290px;
    position: relative;
    overflow: hidden;
}

.modal-qr img {
    width: 100%;
    height: 100%;
    display: block;
}

.modal-qr.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid rgba(235, 51, 73, 0.2);
    border-top-color: #eb3349;
    border-radius: 50%;
    animation: qrSpinner 0.8s linear infinite;
}

@keyframes qrSpinner {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.modal-url {
    background: rgba(255, 255, 255, 0.05);
    padding: 12px 15px;
    border-radius: 12px;
    margin: 20px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    word-break: break-all;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.copy-btn {
    background: linear-gradient(135deg, #eb3349 0%, #f45c43 100%);
    color: #fff;
    padding: 12px 28px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    margin: 10px;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(235, 51, 73, 0.4);
}

.copy-btn:hover {
    background: linear-gradient(135deg, #f5576c 0%, #ff6b6b 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(235, 51, 73, 0.6);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(300px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toasterSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toasterSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

@keyframes toasterProgress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* iPad Optimization */
@media (min-width: 768px) and (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
    
    .image-wrapper {
        height: 200px;
    }
    
    .header h1 {
        font-size: 2.5rem;
    }
}

/* Responsive Grid */
@media (max-width: 1400px) {
    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1100px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Mobile Optimization */
@media (max-width: 767px) {
    body {
        padding: 15px;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .header {
        margin-bottom: 30px;
    }
    
    .header .logo img {
        max-width: 180px;
    }
    
    .header h1 {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
    
    .stats {
        font-size: 0.9rem;
        padding: 10px 20px;
    }
    
    .card-actions {
        padding: 12px;
        gap: 6px;
    }
    
    .action-btn {
        padding: 8px 14px;
        font-size: 12px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 8px;
    }
    
    .pagination a, .pagination span {
        padding: 8px 12px;
        font-size: 13px;
    }
    
    .back-btn {
        position: static;
        margin-bottom: 20px;
        display: inline-block;
    }
    
    .modal-content {
        padding: 30px 20px;
        margin: 10% auto;
    }
}
