/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1a5f7a 0%, #2a8c5f 100%);
    color: white;
    padding: 1.2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo i {
    font-size: 2.2rem;
    color: #ffd166;
}

.logo h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 4px;
}

.logo span {
    font-size: 0.9rem;
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.15);
    padding: 3px 10px;
    border-radius: 20px;
}

.nav {
    display: flex;
    gap: 25px;
}

.nav a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav a:hover, .nav a.active {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    background: linear-gradient(rgba(26, 95, 122, 0.85), rgba(42, 140, 95, 0.85)), 
                url('https://images.unsplash.com/photo-1523050854058-8df90110c9f1?ixlib=rb-4.0.3&auto=format&fit=crop&w=1350&q=80');
    background-size: cover;
    background-position: center;
    color: white;
    text-align: center;
    padding: 4rem 0;
    margin-bottom: 3rem;
}

.hero h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.hero p {
    font-size: 1.2rem;
    max-width: 700px;
    margin: 0 auto;
    opacity: 0.9;
}

/* Gallery Header */
.gallery-header, .admin-header {
    text-align: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #eaeaea;
}

.gallery-header h3, .admin-header h2 {
    font-family: 'Montserrat', sans-serif;
    color: #1a5f7a;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.gallery-header p, .admin-header p {
    color: #666;
    font-size: 1.1rem;
}

/* Gallery Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 4rem;
}

.gallery-item {
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.gallery-img-container {
    position: relative;
    height: 220px;
    overflow: hidden;
}

.gallery-img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.gallery-item:hover .gallery-img-container img {
    transform: scale(1.05);
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(26, 95, 122, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.view-btn {
    background-color: #ffd166;
    color: #1a5f7a;
    padding: 12px 24px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.view-btn:hover {
    background-color: #ffc145;
    transform: scale(1.05);
}

.gallery-info {
    padding: 1.5rem;
}

.gallery-info h4 {
    color: #1a5f7a;
    margin-bottom: 0.8rem;
    font-size: 1.3rem;
}

.gallery-info p {
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* No Images/Empty States */
.no-images, .empty-state {
    text-align: center;
    padding: 4rem 2rem;
    grid-column: 1 / -1;
}

.no-images i, .empty-state i {
    font-size: 4rem;
    color: #ddd;
    margin-bottom: 1.5rem;
}

.no-images h3, .empty-state p {
    color: #888;
    margin-bottom: 1rem;
}

.error-msg {
    background-color: #ffeaea;
    color: #d32f2f;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-msg {
    background-color: #e8f7ee;
    color: #2a8c5f;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Footer */
.footer {
    background-color: #1a5f7a;
    color: white;
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer-logo i {
    font-size: 2.5rem;
    color: #ffd166;
}

.footer-logo h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.8rem;
}

.footer-logo p {
    opacity: 0.8;
}

.footer-links {
    display: flex;
    gap: 25px;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
}

.footer-links a:hover {
    opacity: 0.8;
}

.copyright {
    text-align: center;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Enhanced Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.close-btn {
    position: absolute;
    top: 25px;
    right: 35px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    z-index: 1002;
    background: rgba(0, 0, 0, 0.5);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    color: #ffd166;
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1002;
}

.lightbox-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    color: #ffd166;
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 30px;
}

.next-btn {
    right: 30px;
}

.lightbox-content-container {
    max-width: 90%;
    max-height: 85%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.lightbox-content {
    max-width: 100%;
    max-height: calc(85vh - 60px);
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s ease;
    transition: opacity 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.95); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.lightbox-caption {
    color: white;
    text-align: center;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 0 0 8px 8px;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: -4px;
}

#lightbox-title {
    font-size: 1.1rem;
    font-weight: 500;
}

.lightbox-counter {
    font-size: 0.9rem;
    color: #ddd;
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
}

/* Loading indicator */
.lightbox-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 2rem;
}

/* Add animation for image transition */
.lightbox-content.slide-left {
    animation: slideLeft 0.3s ease;
}

.lightbox-content.slide-right {
    animation: slideRight 0.3s ease;
}

@keyframes slideLeft {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideRight {
    from { transform: translateX(-20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Swipe hint for mobile */
@media (max-width: 768px) {
    .lightbox-btn::after {
        content: 'Swipe';
        position: absolute;
        top: -30px;
        font-size: 12px;
        color: #aaa;
        opacity: 0;
        transition: opacity 0.3s;
        white-space: nowrap;
    }
    
    .lightbox-btn:hover::after {
        opacity: 1;
    }
    
    .prev-btn::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .next-btn::after {
        right: 50%;
        transform: translateX(50%);
    }
}

/* Mobile responsiveness for lightbox */
@media (max-width: 768px) {
    .lightbox-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .prev-btn {
        left: 15px;
    }
    
    .next-btn {
        right: 15px;
    }
    
    .close-btn {
        top: 15px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 30px;
    }
    
    .lightbox-content-container {
        max-width: 95%;
        max-height: 90%;
    }
    
    .lightbox-content {
        max-height: calc(90vh - 50px);
    }
    
    .lightbox-caption {
        flex-direction: column;
        gap: 8px;
        padding: 10px 15px;
    }
}

/* Admin Page Styles */
.admin-page .header {
    background: linear-gradient(135deg, #333 0%, #555 100%);
}

.login-page {
    background: linear-gradient(135deg, #1a5f7a 0%, #2a8c5f 100%);
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-container {
    background-color: white;
    border-radius: 15px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 450px;
    overflow: hidden;
}

.login-header {
    background: linear-gradient(135deg, #1a5f7a 0%, #2a8c5f 100%);
    color: white;
    text-align: center;
    padding: 2.5rem;
}

.login-header i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.login-header h2 {
    font-family: 'Montserrat', sans-serif;
    margin-bottom: 0.5rem;
}

.login-header p {
    opacity: 0.9;
}

.login-form {
    padding: 2.5rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
}

.form-group input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    border-color: #1a5f7a;
    outline: none;
}

.btn-login {
    background: linear-gradient(135deg, #1a5f7a 0%, #2a8c5f 100%);
    color: white;
    border: none;
    width: 100%;
    padding: 16px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 1.5rem;
}

.btn-login:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(26, 95, 122, 0.2);
}

.back-link {
    display: block;
    text-align: center;
    margin-top: 1.5rem;
    color: #666;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.back-link:hover {
    color: #1a5f7a;
}

/* Upload Section */
.upload-section, .manage-section {
    background-color: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
    margin-bottom: 2.5rem;
}

.upload-section h3, .manage-section h3 {
    color: #1a5f7a;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
}

.upload-form .form-group {
    margin-bottom: 1.8rem;
}

.form-help {
    font-size: 0.85rem;
    color: #777;
    margin-top: 6px;
}

.btn-upload {
    background: linear-gradient(135deg, #2a8c5f 0%, #1a5f7a 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-upload:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(26, 95, 122, 0.2);
}

/* Image Management Table */
.table-responsive {
    overflow-x: auto;
}

.image-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

.image-table th {
    background-color: #f1f8ff;
    color: #1a5f7a;
    font-weight: 600;
    text-align: left;
    padding: 1rem;
    border-bottom: 2px solid #e0e0e0;
}

.image-table td {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    vertical-align: middle;
}

.image-table tr:hover {
    background-color: #f9f9f9;
}

.thumb {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    border: 2px solid #eee;
}

.btn-view, .btn-delete {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-right: 8px;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

.btn-view {
    background-color: #e8f7ee;
    color: #2a8c5f;
}

.btn-view:hover {
    background-color: #d4f0e1;
}

.btn-delete {
    background-color: #ffeaea;
    color: #d32f2f;
}

.btn-delete:hover {
    background-color: #ffd6d6;
}

.actions-cell {
    display: flex;
    gap: 8px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .nav {
        width: 100%;
        justify-content: center;
    }
    
    .hero h2 {
        font-size: 2.2rem;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-links {
        justify-content: center;
    }
    
    .image-table {
        font-size: 0.9rem;
    }
    
    .actions-cell {
        flex-direction: column;
        gap: 5px;
    }
    
    .btn-view, .btn-delete {
        margin-right: 0;
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .hero {
        padding: 3rem 0;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .login-form {
        padding: 1.5rem;
    }
}