* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    color: #667eea;
    font-weight: bold;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.user-name {
    color: #666;
    font-weight: 500;
}

.nav-link {
    text-decoration: none;
    color: #333;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    transition: background 0.3s;
}

.nav-link:hover,
.nav-link.active {
    background: #667eea;
    color: white;
}

.main-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

.container {
    background: white;
    border-radius: 10px;
    padding: 2rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

h2 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

/* Login Page */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
}

.login-box {
    background: white;
    padding: 3rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-box h1 {
    color: #667eea;
    text-align: center;
    margin-bottom: 0.5rem;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.5rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #555;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-disabled {
    background: #ccc;
    color: #666;
    cursor: not-allowed;
}

/* Messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid #dc3545;
}

.success-message {
    background: #d4edda;
    color: #155724;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1rem;
    border-left: 4px solid #28a745;
}

/* Stats Box */
.stats-box {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 2rem;
    text-align: center;
}

.stats-box p {
    font-size: 1.1rem;
    color: #555;
}

/* Action Cards */
.action-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.card {
    background: #f8f9fa;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    transition: transform 0.3s, box-shadow 0.3s;
    border: 2px solid transparent;
}

.card:hover:not(.disabled) {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.card.disabled {
    opacity: 0.6;
}

.card h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.card p {
    color: #666;
    margin-bottom: 1.5rem;
}

/* Upload Form */
.upload-info {
    background: #e7f3ff;
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

.upload-info p {
    margin: 0.5rem 0;
    color: #555;
}

.hint {
    font-size: 0.9rem;
    color: #666;
}

.upload-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.form-actions .btn {
    min-width: 150px;
}

/* Gallery */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.gallery-item {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.image-container {
    width: 100%;
    height: 250px;
    overflow: hidden;
    background: #f0f0f0;
    cursor: pointer;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.gallery-item:hover .image-container img {
    transform: scale(1.05);
}

.image-info {
    padding: 1.5rem;
}

.image-title {
    font-weight: bold;
    color: #333;
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.image-author {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.rating-section {
    border-top: 1px solid #eee;
    padding-top: 1rem;
}

.average-rating {
    margin-bottom: 1rem;
}

.stars-display {
    color: #ffc107;
    font-size: 1.2rem;
    margin-right: 0.5rem;
}

.stars-display .star {
    color: #ddd;
}

.stars-display .star.filled {
    color: #ffc107;
}

.rating-text {
    color: #666;
    font-size: 0.9rem;
}

.user-rating {
    margin-top: 1rem;
}

.user-rating p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0.5rem;
}

/* Star Rating Input */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: flex-end;
    gap: 0.25rem;
}

.star-rating input[type="radio"] {
    display: none;
}

.star-rating label {
    font-size: 2rem;
    color: #ddd;
    cursor: pointer;
    transition: color 0.2s;
}

.star-rating label:hover,
.star-rating label:hover ~ label {
    color: #ffc107;
}

.star-rating input[type="radio"]:checked ~ label {
    color: #ffc107;
}

.own-image-note {
    color: #667eea;
    font-style: italic;
    margin-top: 0.5rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #666;
}

.empty-state p {
    font-size: 1.2rem;
    margin-bottom: 1.5rem;
}

/* Image Modal */
.image-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    animation: fadeIn 0.3s;
}

.image-modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #fff;
}

.modal-image {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    margin: auto;
    display: block;
    border-radius: 5px;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

.modal-caption {
    margin-top: 20px;
    color: #f1f1f1;
    text-align: center;
    font-size: 1.2rem;
    padding: 0 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .action-cards {
        grid-template-columns: 1fr;
    }
    
    .gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
    
    .modal-close {
        top: 10px;
        right: 15px;
        font-size: 30px;
    }
    
    .modal-image {
        max-width: 95%;
        max-height: 80vh;
    }
    
    .modal-caption {
        font-size: 1rem;
    }
}

