/* Reset and General Styles */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #333;
    background-color: #f5f5f5;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    margin: 0;
    font-size: 1.8rem;
}

nav {
    display: flex;
    gap: 1rem;
}

.admin-login, .upload-btn, .back-btn, .logout {
    color: #fff;
    text-decoration: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.admin-login {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
}

.admin-login:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-2px);
}

.upload-btn, .back-btn {
    background: #4CAF50;
}

.upload-btn:hover, .back-btn:hover {
    background: #45a049;
    transform: translateY(-2px);
}

.logout {
    background: #f44336;
}

.logout:hover {
    background: #d32f2f;
    transform: translateY(-2px);
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.admin-header h1 {
    margin: 0;
    font-size: 1.8rem;
}

.admin-nav {
    display: flex;
    gap: 1rem;
}

/* Main Content */
main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.admin-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Dashboard Stats */
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    text-align: center;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card h3 {
    margin: 0 0 1rem 0;
    color: #666;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: bold;
    color: #3498db;
    margin: 0;
}

.stat-text {
    font-size: 1.2rem;
    color: #333;
    margin: 0;
}

/* Gallery Controls */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.gallery-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.select-all-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    color: #666;
    cursor: pointer;
}

.select-all-label input[type="checkbox"] {
    transform: scale(1.2);
}

/* Bulk Actions */
.bulk-actions {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
}

.btn-bulk-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

.btn-bulk-delete:hover {
    background: #c82333;
}

/* Photo Grid Enhancements */
.photo-checkbox {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 10;
}

.photo-checkbox input[type="checkbox"] {
    transform: scale(1.3);
    background: white;
    border: 2px solid #ddd;
}

.admin-photo-item {
    position: relative;
}

.admin-photo-item img {
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.admin-photo-item img:hover {
    opacity: 0.8;
}

/* Messages */
.error, .success, .message {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 5px;
    font-weight: 500;
}

.error {
    color: #d32f2f;
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.success {
    color: #2e7d32;
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
}

.message.error {
    color: #d32f2f;
    background: #ffebee;
    border-left: 4px solid #f44336;
}

.message.success {
    color: #2e7d32;
    background: #e8f5e9;
    border-left: 4px solid #4CAF50;
}

/* Login Form */
.login-container {
    max-width: 400px;
    margin: 4rem auto;
    padding: 2rem;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.login-container h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #333;
}

.login-help {
    text-align: center;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.login-help a {
    color: #667eea;
    text-decoration: none;
}

.login-help a:hover {
    text-decoration: underline;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #555;
}

.required {
    color: #f44336;
}

.form-group input, .form-group textarea, .form-group select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    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);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

.flex-1 { flex: 1; }
.flex-2 { flex: 2; }

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: normal;
}

/* Button Styles */
button, .btn-primary, .btn-secondary {
    background: #667eea;
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

button:hover, .btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-feature {
    background: #28a745;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-right: 0.5rem;
}

.btn-feature:hover {
    background: #218838;
}

.btn-unfeature {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-right: 0.5rem;
}

.btn-unfeature:hover {
    background: #e0a800;
}

.btn-edit {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
    margin-right: 0.5rem;
    text-decoration: none;
}

.btn-edit:hover {
    background: #138496;
}

.btn-edit-small {
    background: #17a2b8;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 3px;
    font-size: 0.75rem;
    cursor: pointer;
    text-decoration: none;
}

.btn-delete {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: 3px;
    font-size: 0.85rem;
    cursor: pointer;
}

.btn-delete:hover {
    background: #c82333;
}

.btn-delete-large {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: bold;
}

.btn-delete-large:hover {
    background: #c82333;
}

.btn-remove {
    background: #ffc107;
    color: #333;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 3px;
    font-size: 0.9rem;
    cursor: pointer;
    margin-top: 1rem;
}

.btn-remove:hover {
    background: #e0a800;
}

.btn-remove-small {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.3rem 0.6rem;
    border-radius: 50%;
    font-size: 0.8rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-remove-small:hover {
    background: #c82333;
}

/* Gallery Styles */
.featured-photo, .gallery, .admin-gallery {
    background: #fff;
    padding: 2rem;
    margin-bottom: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.featured-photo h2, .gallery h2, .admin-gallery h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.6rem;
}

.featured-container {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.featured-container img {
    max-width: 500px;
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.featured-info h3 {
    margin-top: 0;
    font-size: 1.4rem;
    color: #333;
}

.featured-info p {
    color: #666;
    line-height: 1.6;
}

.featured-info small {
    color: #999;
    font-style: italic;
}

/* Photo Grid */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.admin-grid {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.photo-item {
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.photo-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.photo-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.photo-info {
    padding: 1rem;
}

.photo-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.1rem;
    color: #333;
}

.photo-info p {
    margin: 0 0 0.5rem 0;
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

.photo-info small {
    color: #999;
    font-size: 0.8rem;
}

.featured-badge {
    background: #28a745;
    color: white;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-size: 0.75rem;
    font-weight: bold;
    display: inline-block;
    margin-top: 0.5rem;
}

.photo-actions {
    padding: 0 1rem 1rem 1rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.8);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 10px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: auto;
    position: relative;
}

.modal-content img {
    width: 100%;
    height: auto;
    border-radius: 10px 10px 0 0;
}

.modal-info {
    padding: 1.5rem;
}

.modal-info h3 {
    margin-top: 0;
    color: #333;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.close {
    position: absolute;
    top: 15px;
    right: 25px;
    color: white;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
}

.close:hover {
    color: #ccc;
}

/* Edit Page Styles */
.edit-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.edit-photo-preview {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.edit-preview-image {
    width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.image-info {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 5px;
}

.image-info p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.edit-forms {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.edit-form {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.edit-form h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.danger-zone {
    border: 2px solid #dc3545;
    border-radius: 10px;
}

.danger-zone h3 {
    color: #dc3545;
    border-bottom-color: #dc3545;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

.quick-actions {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.action-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Upload Form Styles */
.upload-page {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.upload-form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.upload-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 2rem;
    border-left: 4px solid #667eea;
}

.upload-info h3 {
    margin-top: 0;
    color: #333;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.info-item {
    color: #666;
    font-size: 0.9rem;
}

.upload-group {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.upload-group:last-of-type {
    border-bottom: none;
}

.upload-group-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.upload-group h3 {
    margin: 0;
    color: #667eea;
    font-size: 1.2rem;
}

/* File Upload Styles */
.file-drop-zone {
    position: relative;
    border: 3px dashed #ddd;
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    background: #fafafa;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-drop-zone:hover {
    border-color: #667eea;
    background: #f0f4ff;
}

.file-drop-zone.drag-over {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.02);
}

.file-drop-zone input[type="file"] {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.drop-text {
    pointer-events: none;
}

.drop-text p {
    margin: 0;
    font-size: 1.1rem;
    color: #333;
}

.drop-text small {
    color: #666;
}

.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 200px;
    max-height: 200px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Recent Uploads Sidebar */
.recent-uploads {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    height: fit-content;
}

.recent-uploads h3 {
    margin-top: 0;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 0.5rem;
}

.recent-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.recent-item {
    display: flex;
    gap: 1rem;
    align-items: center;
    padding: 0.5rem;
    border-radius: 5px;
    transition: background-color 0.3s ease;
}

.recent-item:hover {
    background: #f8f9fa;
}

.recent-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 5px;
}

.recent-info {
    flex: 1;
}

.recent-info h4 {
    margin: 0 0 0.25rem 0;
    font-size: 0.9rem;
    color: #333;
}

.recent-info small {
    color: #666;
    font-size: 0.8rem;
}

.recent-actions {
    display: flex;
    gap: 0.5rem;
}

.recent-footer {
    margin-top: 1rem;
    text-align: center;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* No Photos Message */
.no-photos {
    text-align: center;
    padding: 3rem 1rem;
    color: #666;
}

.no-photos p {
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

/* Footer */
footer {
    background: #333;
    color: #fff;
    text-align: center;
    padding: 1rem;
    margin-top: 4rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .upload-page {
        grid-template-columns: 1fr;
    }
    
    .edit-container {
        grid-template-columns: 1fr;
    }
    
    .dashboard-stats {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }
}

@media (max-width: 768px) {
    header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .admin-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    main, .admin-main {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }
    
    .featured-container {
        flex-direction: column;
        text-align: center;
    }
    
    .photo-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .photo-actions {
        justify-content: center;
    }
    
    .login-container {
        margin: 2rem auto;
        padding: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .action-buttons {
        justify-content: center;
    }
    
    .gallery-header {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .photo-grid {
        grid-template-columns: 1fr;
    }
    
    .featured-photo, .gallery, .admin-gallery, .upload-form-container {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .featured-container img {
        max-width: 100%;
    }
    
    .dashboard-stats {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 {
    margin-bottom: 1rem;
}

.mb-2 {
    margin-bottom: 2rem;
}

.mt-1 {
    margin-top: 1rem;
}

.mt-2 {
    margin-top: 2rem;
}

.hidden {
    display: none;
}