* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}

/* Navigation Bar */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-icon {
    font-size: 2.8rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    transform: translateY(-7px);
}

.nav-links {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
}

.nav-link:hover {
    opacity: 0.8;
}

.user-menu,
.auth-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.user-name {
    font-size: 0.9rem;
    font-style: italic;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Pages */
.page {
    display: none;
    animation: fadeIn 0.3s ease-in;
}

.page.active {
    display: block;
}

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

/* Forms */
.form-container {
    background: white;
    padding: 2rem;
    border-radius: 10px;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.form-container h2 {
    margin-bottom: 1.5rem;
    color: #667eea;
    text-align: center;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 5px rgba(102, 126, 234, 0.2);
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #999;
    font-size: 0.85rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-block;
}

.btn-primary {
    background-color: #667eea;
    color: white;
}

.btn-primary:hover {
    background-color: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background-color: #48bb78;
    color: white;
}

.btn-secondary:hover {
    background-color: #38a169;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(72, 187, 120, 0.4);
}

.btn-danger {
    background-color: #f56565;
    color: white;
}

.btn-danger:hover {
    background-color: #e53e3e;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 101, 101, 0.4);
}

.btn-block {
    width: 100%;
    display: block;
}

.form-info {
    text-align: center;
    margin-top: 1rem;
    color: #666;
    font-size: 0.9rem;
}

.form-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.form-info a:hover {
    text-decoration: underline;
}

.info-text {
    text-align: center;
    color: #666;
    margin-bottom: 1rem;
}

/* Messages */
.message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 5px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background-color: #c6f6d5;
    color: #22543d;
    border: 1px solid #9ae6b4;
    display: block;
}

.message.error {
    background-color: #fed7d7;
    color: #742a2a;
    border: 1px solid #fc8181;
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Image Preview */
.image-preview {
    margin: 1rem 0;
    text-align: center;
}

.image-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: 5px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Gallery */
.gallery-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.gallery-header h2 {
    color: #333;
    font-size: 2rem;
}

.filters-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.filters-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
}

.filters {
    display: flex;
    gap: 1rem;
}

.filters input,
.filters select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95rem;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.gallery-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
    cursor: pointer;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.gallery-item-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #f0f0f0;
}

.gallery-item-info {
    padding: 1rem;
}

.gallery-item-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-item-meta {
    font-size: 0.85rem;
    color: #999;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.gallery-item-uploader {
    background-color: #f0f0f0;
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8rem;
    color: #666;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 200;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease-out;
}

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

.modal-content {
    background-color: white;
    padding: 2rem;
    border-radius: 15px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease-out;
}

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

.close {
    position: absolute;
    right: 2rem;
    top: 1rem;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    color: #666;
    transition: color 0.3s;
}

.close:hover {
    color: #333;
}

.zoom-image-btn {
    position: absolute;
    top: 1rem;
    right: 5rem;
    border: none;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 999px;
    cursor: pointer;
    font-size: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.zoom-image-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.zoom-modal-content {
    position: relative;
    width: 96vw;
    height: 94vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.zoom-close-btn {
    position: absolute;
    top: 0.5rem;
    right: 1rem;
    border: none;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 999px;
    font-size: 1.6rem;
    cursor: pointer;
    line-height: 1;
}

#zoomImage {
    max-width: 96vw;
    max-height: 92vh;
    object-fit: contain;
    border-radius: 10px;
}

#modalImage {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.image-details h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.image-details p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail-item strong {
    color: #667eea;
    display: block;
    margin-bottom: 0.5rem;
}

.detail-item p {
    color: #666;
    font-size: 0.95rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: #333;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: none;
    z-index: 300;
    animation: slideInToast 0.3s ease-out;
    max-width: 400px;
}

.toast.show {
    display: block;
}

.toast.success {
    background-color: #48bb78;
}

.toast.error {
    background-color: #f56565;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        gap: 0.5rem;
        width: 100%;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .filters {
        width: 100%;
        flex-direction: column;
    }

    .filters input,
    .filters select {
        width: 100%;
    }

    .modal-content {
        width: 95%;
        padding: 1rem;
    }

    .close {
        right: 1rem;
        top: 0.5rem;
    }

    .toast {
        right: 1rem;
        bottom: 1rem;
        max-width: calc(100% - 2rem);
    }

    .details-grid {
        grid-template-columns: 1fr;
    }
}
