/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-brand {
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
    border-radius: 6px;
}

.nav-link:hover,
.nav-link.active {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    min-height: calc(100vh - 140px);
}

/* Gallery Header */
.gallery-header {
    text-align: center;
    margin-bottom: 3rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.gallery-header h1 {
    font-size: 2.5rem;
    color: #333;
    margin-bottom: 1.5rem;
}

.view-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.view-modes {
    display: flex;
    gap: 0.5rem;
    background: rgba(102, 126, 234, 0.1);
    padding: 0.5rem;
    border-radius: 10px;
}

.view-mode {
    padding: 0.7rem 1.2rem;
    text-decoration: none;
    color: #667eea;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.view-mode:hover,
.view-mode.active {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

.category-filter select {
    padding: 0.7rem 1rem;
    border: 2px solid #667eea;
    border-radius: 8px;
    background: white;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    outline: none;
}

/* Gallery Grid Layouts */
.gallery-grid {
    display: grid;
    gap: 2rem;
    margin-bottom: 2rem;
}

.thumbnail-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.full-gallery {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.image-card,
.gallery-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.image-card:hover,
.gallery-item:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

.image-container {
    position: relative;
    height: 250px;
    overflow: hidden;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.image-card:hover .image-container img {
    transform: scale(1.1);
}

.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(102, 126, 234, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-card:hover .image-overlay {
    opacity: 1;
}

.image-overlay i {
    color: white;
    font-size: 2rem;
}

.image-info {
    padding: 1.5rem;
}

.image-info h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #333;
}

.image-info p {
    color: #666;
    margin-bottom: 1rem;
}

/* List View */
.gallery-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.list-item {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 1.5rem;
    display: flex;
    gap: 1.5rem;
    align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease;
}

.list-item:hover {
    transform: translateY(-5px);
}

.list-image img {
    width: 120px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
}

.list-content {
    flex: 1;
}

.list-content h3 {
    margin-bottom: 0.5rem;
}

.list-content h3 a {
    color: #333;
    text-decoration: none;
}

.list-content h3 a:hover {
    color: #667eea;
}

.list-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.list-actions {
    display: flex;
    gap: 0.5rem;
}

/* Gallery Full View */
.gallery-link {
    position: relative;
    display: block;
    text-decoration: none;
}

.gallery-item img {
    width: 100%;
    height: 300px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent 0%, rgba(0, 0, 0, 0.8) 100%);
    display: flex;
    align-items: flex-end;
    padding: 1.5rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.gallery-info {
    color: white;
}

.gallery-info h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

/* Image Detail Page */
.image-detail-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.detail-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    background: rgba(102, 126, 234, 0.1);
    border-bottom: 1px solid rgba(102, 126, 234, 0.2);
}

.back-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.back-link:hover {
    color: #5a67d8;
}

.image-counter {
    color: #666;
    font-weight: 500;
}

.image-display {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    min-height: 60vh;
}

.main-image-container {
    max-width: 100%;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(102, 126, 234, 0.9);
    color: white;
    padding: 1rem;
    border-radius: 50%;
    text-decoration: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
    z-index: 10;
}

.nav-arrow:hover {
    background: #667eea;
    transform: translateY(-50%) scale(1.1);
}

.nav-prev {
    left: 2rem;
}

.nav-next {
    right: 2rem;
}

.image-info-section {
    padding: 2rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.image-details h1 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: #333;
}

.image-description {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #666;
    margin-bottom: 1.5rem;
}

.image-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.thumbnail-nav h3 {
    margin-bottom: 1rem;
    color: #333;
}

.thumbnail-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.thumbnail-item {
    text-align: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
}

.thumbnail-item img {
    width: 100%;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.thumbnail-item:hover {
    color: #667eea;
    transform: translateY(-2px);
}

.thumbnail-item.current {
    color: #667eea;
    font-weight: bold;
}

/* Category Tags */
.category-tag {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: capitalize;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 2px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-2px);
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-warning {
    background: #ffc107;
    color: #212529;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
}

/* Admin Styles */
.admin-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #f1f3f4;
}

.admin-header h1 {
    color: #333;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.stat-icon {
    font-size: 2rem;
    opacity: 0.8;
}

.stat-info h3 {
    font-size: 2rem;
    margin-bottom: 0.2rem;
}

.stat-info p {
    opacity: 0.9;
}

.admin-table-container {
    overflow-x: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.admin-table th,
.admin-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #f1f3f4;
}

.admin-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #333;
}

.admin-table tr:hover {
    background: rgba(102, 126, 234, 0.05);
}

.admin-preview img {
    width: 60px;
    height: 40px;
    object-fit: cover;
    border-radius: 6px;
}

.description-cell {
    max-width: 200px;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

/* Form Styles */
.form-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.admin-form {
    max-width: 600px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-input-wrapper {
    position: relative;
}

.file-input-wrapper input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-input-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2rem;
    border: 2px dashed #667eea;
    border-radius: 8px;
    background: rgba(102, 126, 234, 0.05);
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-input-label:hover {
    background: rgba(102, 126, 234, 0.1);
}

.image-preview {
    margin-top: 1rem;
}

.preview-image img {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.current-image {
    margin-bottom: 2rem;
    text-align: center;
}

.current-image img {
    max-width: 300px;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f1f3f4;
}

/* Alerts */
.alert {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #666;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h2 {
    margin-bottom: 0.5rem;
}

/* Error Page */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
}

.error-content {
    text-align: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

.error-icon {
    font-size: 4rem;
    color: #ffc107;
    margin-bottom: 1rem;
}

.error-content h1 {
    margin-bottom: 1rem;
    color: #333;
}

.error-message {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 2rem;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    margin-top: 2rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        padding: 0 1rem;
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        gap: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .gallery-header {
        padding: 1.5rem;
    }

    .gallery-header h1 {
        font-size: 2rem;
    }

    .view-controls {
        flex-direction: column;
        gap: 1rem;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }

    .full-gallery {
        grid-template-columns: 1fr;
    }

    .list-item {
        flex-direction: column;
        text-align: center;
    }

    .image-info-section {
        grid-template-columns: 1fr;
        padding: 1rem;
    }

    .nav-arrow {
        padding: 0.8rem;
        font-size: 1.2rem;
    }

    .nav-prev {
        left: 1rem;
    }

    .nav-next {
        right: 1rem;
    }

    .thumbnail-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .admin-header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .admin-stats {
        grid-template-columns: 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .error-actions {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .thumbnail-grid {
        grid-template-columns: 1fr;
    }

    .thumbnail-nav .thumbnail-grid {
        grid-template-columns: 1fr;
    }
}