/* Modern, clean CSS for Photography Contest App */

:root {
    --primary-color: #531251;
    --secondary-color: #3498db;
    --accent-color: #e74c3c;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --light-gray: #f8f9fa;
    --dark-gray: #6c757d;
    --white: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--primary-color);
    background-color: var(--light-gray);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--primary-color);
    padding: 1rem 0;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .logo {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

.navbar .nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.navbar .nav-links a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s;
}

.navbar .nav-links a:hover {
    color: var(--secondary-color);
}

/* Main content */
.main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin-bottom: 2rem;
}

.card-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1.5rem;
    font-size: 1.25rem;
    font-weight: bold;
}

.card-body {
    padding: 2rem;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--primary-color);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-control.is-invalid {
    border-color: var(--accent-color);
}

.invalid-feedback {
    color: var(--accent-color);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 2px solid transparent;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #DA0E29;
    color: var(--white);
}

.btn-primary:hover {
    background: #B50D24;
    transform: translateY(-2px);
}

.btn-success {
    background: #DA0E29;
    color: var(--white);
}

.btn-success:hover {
    background: #B50D24;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--accent-color);
    color: var(--white);
}

.btn-danger:hover {
    background: #c0392b;
    transform: translateY(-2px);
}

.btn-secondary {
    background: white;
    color: #DA0E29;
    border: 1px solid #DA0E29;
}

.btn-secondary:hover {
    background: #DA0E29;
    color: white;
    transform: translateY(-2px);
}

/* Photo Gallery */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.photo-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s;
}

.photo-card:hover {
    transform: translateY(-5px);
}

.photo-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
}

.photo-info {
    padding: 1.5rem;
}

.photo-number {
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: bold;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.photo-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.photo-category {
    background: var(--warning-color);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: bold;
}

.photo-equipment {
    color: var(--dark-gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Voting */
.voting-section {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e9ecef;
}

.vote-stars {
    display: flex;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.vote-star {
    font-size: 1.5rem;
    color: #DA0E29;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.vote-star:hover {
    transform: scale(1.1);
}

.vote-stats {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.vote-count {
    background: var(--success-color);
    color: var(--white);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
}

.vote-average {
    color: var(--dark-gray);
    font-size: 0.9rem;
}

/* Flash messages */
.flash-messages {
    margin: 1rem 0;
}

.alert {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.alert-danger {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.alert-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Category filters */
.category-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    background: var(--white);
    border: 2px solid var(--secondary-color);
    color: var(--secondary-color);
    text-decoration: none;
    border-radius: var(--border-radius);
    transition: all 0.3s;
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--secondary-color);
    color: var(--white);
}

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

.stat-card {
    background: transparent;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--secondary-color);
}

.stat-label {
    color: var(--dark-gray);
    margin-top: 0.5rem;
}

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

    .navbar .nav-links {
        gap: 1rem;
    }

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

    .category-filters {
        flex-direction: column;
        align-items: center;
    }

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

/* Hero section */
.hero {
    background: #F9F6EE;
    color: #DA0E29;
    padding: 4rem 0;
    text-align: center;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1rem;
    }
}

/* 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);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--white);
    margin: 2% auto;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 1000px;
    max-height: 95vh;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease;
}

.modal-header {
    background: var(--primary-color);
    color: var(--white);
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: var(--border-radius);
    border-top-right-radius: var(--border-radius);
}

.modal-title {
    font-size: 1.25rem;
    font-weight: bold;
}

.modal-close {
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--secondary-color);
}

.modal-body {
    padding: 0;
}

.modal-image-container {
    position: relative;
    text-align: center;
    background: #f8f9fa;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 0;
}

.modal-loading {
    text-align: center;
    color: var(--dark-gray);
    padding: 2rem;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

.modal-details {
    padding: 1.5rem;
    border-top: 1px solid #e9ecef;
}

.detail-row {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.modal-actions {
    margin-top: 1.5rem;
    text-align: center;
}

/* Modal animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Mobile modal responsive */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        margin: 1% auto;
        max-height: 98vh;
    }

    .modal-header {
        padding: 1rem;
    }

    .modal-title {
        font-size: 1.1rem;
    }

    .modal-close {
        font-size: 1.5rem;
    }

    .modal-details {
        padding: 1rem;
    }

    .modal-image {
        max-height: 50vh;
    }
}