/**
 * Component Styles
 * Styles for all interactive components: Thermometer, Countdown, Gallery, Forms, Modals
 */

/* ==================== GLOBAL RESETS ==================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: #f5f5f7;
}

/* ==================== HEADER & NAVIGATION ==================== */

header {
    background: linear-gradient(135deg, #4b2d7f 0%, #2d1b4e 100%);
    color: white;
    padding: 0.5rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.brand {
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand:hover {
    opacity: 0.9;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    cursor: pointer;
    font-size: 0.9rem;
}

.nav-links a:hover {
    opacity: 0.8;
}

.status-btn {
    background: #9d4edd;
    color: white;
    padding: 0.4rem 0.9rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    transition: background 0.3s;
    border: 2px solid #9d4edd;
    white-space: nowrap;
}

.status-btn:hover {
    background: #7a2fa0;
    border-color: #7a2fa0;
}

@media (max-width: 768px) {
    .header-container {
        padding: 0 0.75rem;
        gap: 0.5rem;
    }
    
    .brand {
        font-size: 1.1rem;
        max-width: 200px;
    }
    
    .nav-links {
        gap: 1rem;
        order: 3;
        width: 100%;
        justify-content: flex-start;
    }
    
    .nav-links a {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0 0.35rem;
        gap: 0.25rem;
    }
    
    .brand {
        font-size: 0.65rem;
        max-width: 85px;
        flex-shrink: 0;
        letter-spacing: -0.5px;
    }
    
    .nav-links {
        gap: 0.35rem;
        font-size: 0.7rem;
    }
    
    .nav-links a {
        font-size: 0.7rem;
    }
    
    .status-btn {
        padding: 0.3rem 0.5rem;
        font-size: 0.65rem;
    }
}

@media (max-width: 360px) {
    .header-container {
        padding: 0 0.25rem;
        gap: 0.15rem;
    }
    
    .brand {
        font-size: 0.55rem;
        max-width: 70px;
        letter-spacing: -1px;
    }
    
    .nav-links a {
        font-size: 0.65rem;
    }
    
    .status-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.6rem;
    }
}

/* ==================== BREADCRUMBS ==================== */

.breadcrumbs {
    background: white;
    padding: 1rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumbs-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.breadcrumbs a {
    color: #4b2d7f;
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: #9d4edd;
}

.breadcrumbs span {
    color: #999;
}

/* ==================== THERMOMETER STYLES (REDESIGNED) ==================== */

.thermometer-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    max-width: 220px;
    margin: 2rem auto;
    font-family: 'Poppins', sans-serif;
}

.thermometer {
    position: relative;
    width: 40px;
    height: 220px;
    background: #e9ecef;
    border: 3px solid #dee2e6;
    border-radius: 20px;
    margin: 0 auto;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.05);
}

.thermometer-fill,
#thermometer-fill {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 0%;
    background: linear-gradient(180deg, #a56eff 0%, #8e44ad 100%);
    border-radius: 17px 17px 0 0;
    transition: height 0.5s cubic-bezier(0.65, 0, 0.35, 1);
    box-shadow: inset 0 -2px 4px rgba(0, 0, 0, 0.1);
}

.thermometer-bulb {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #c392ff, #8e44ad);
    border-radius: 50%;
    border: 3px solid #dee2e6;
}

.thermometer-stats {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: center;
    font-size: 0.95rem;
    color: #495057;
}

.thermometer-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.25rem 0;
}

.thermometer-stat-label {
    font-weight: 500;
    color: #6c757d;
}

.thermometer-stat-value {
    font-weight: 700;
    color: #4b2d7f;
    font-size: 1.1rem;
}

.thermometer-percent {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    color: #4b2d7f;
    margin-top: 0.5rem;
}

.thermometer-message {
    text-align: center;
    font-size: 0.85rem;
    color: #6c757d;
    font-style: italic;
}

/* ==================== COUNTDOWN STYLES ==================== */

.countdown {
    padding: 2rem;
    text-align: center;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.countdown-number {
    font-size: 2rem;
    font-weight: 700;
    color: #c92a2a;
    font-family: 'Courier New', monospace;
    min-width: 60px;
    padding: 0.5rem;
    background: #f5f5f5;
    border-radius: 4px;
}

.countdown-label {
    font-size: 0.75rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

.countdown-compact {
    font-size: 1.5rem;
    font-family: 'Courier New', monospace;
    font-weight: 700;
    color: #c92a2a;
}

.countdown-finished {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2ecc71;
    text-align: center;
    padding: 2rem;
}

@media (max-width: 768px) {
    .countdown-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .countdown-number {
        font-size: 1.5rem;
        min-width: 50px;
        padding: 0.25rem;
    }
}

@media (max-width: 480px) {
    .countdown {
        padding: 1rem;
    }
    
    .countdown-grid {
        gap: 0.5rem;
    }
    
    .countdown-number {
        font-size: 1.2rem;
        min-width: 45px;
    }
    
    .countdown-label {
        font-size: 0.65rem;
    }
}

/* ==================== GALLERY STYLES ==================== */

.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    padding: 2rem;
}

.gallery-image {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    cursor: pointer;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.gallery-image:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.gallery-image.hidden {
    display: none;
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.gallery-filter {
    padding: 0.5rem 1rem;
    border: 2px solid #ddd;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    color: #333;
}

.gallery-filter:hover {
    border-color: #c92a2a;
    color: #c92a2a;
}

.gallery-filter.active {
    background: #c92a2a;
    color: white;
    border-color: #c92a2a;
}

/* Lightbox Styles */
.gallery-lightbox {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.gallery-lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.lightbox-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: -30px;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.lightbox-navigation {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    transform: translateY(-50%);
    display: flex;
    justify-content: space-between;
    padding: 0 2rem;
    pointer-events: none;
}

.lightbox-prev,
.lightbox-next {
    background: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 0.5rem 1rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.3s ease;
    pointer-events: all;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.5);
}

.lightbox-caption {
    color: white;
    text-align: center;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.lightbox-counter {
    color: white;
    text-align: center;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

@media (max-width: 768px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 0.75rem;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .gallery-container {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
        gap: 0.5rem;
        padding: 0.75rem;
    }
    
    .lightbox-prev,
    .lightbox-next {
        font-size: 1.5rem;
        padding: 0.25rem 0.75rem;
    }
}

/* ==================== FORM STYLES ==================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #333;
    font-size: 0.875rem;
}

.form-label.required::after {
    content: ' *';
    color: #c92a2a;
}

.form-input,
.form-textarea,
.form-select {
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #c92a2a;
    box-shadow: 0 0 0 3px rgba(201, 42, 42, 0.1);
}

.form-input.invalid,
.form-textarea.invalid,
.form-select.invalid {
    border-color: #e74c3c;
    background-color: #fadbd8;
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
    font-family: inherit;
}

.form-error {
    color: #c92a2a;
    font-size: 0.875rem;
    font-weight: 500;
    margin-top: -0.5rem;
}

.form-help {
    color: #666;
    font-size: 0.75rem;
    margin-top: -0.5rem;
}

.form-button {
    padding: 0.75rem 1.5rem;
    background: #c92a2a;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease;
}

.form-button:hover {
    background: #a02020;
}

.form-button:active {
    transform: scale(0.98);
}

.form-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: scale(1);
}

/* ==================== MODAL STYLES ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    opacity: 1;
}

.modal {
    background: white;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-small {
    width: 90%;
    max-width: 400px;
}

.modal-medium {
    width: 90%;
    max-width: 600px;
}

.modal-large {
    width: 90%;
    max-width: 900px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #eee;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.modal-close:hover {
    background: #f5f5f5;
    color: #333;
}

.modal-body {
    padding: 1.5rem;
    color: #333;
    line-height: 1.6;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    padding: 1.5rem;
    border-top: 1px solid #eee;
}

.modal-button {
    padding: 0.75rem 1.5rem;
    border: 2px solid #ddd;
    background: white;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.modal-button:hover {
    border-color: #c92a2a;
    color: #c92a2a;
}

.modal-button.primary {
    background: #c92a2a;
    color: white;
    border-color: #c92a2a;
}

.modal-button.primary:hover {
    background: #a02020;
    border-color: #a02020;
}

@media (max-width: 768px) {
    .modal-small,
    .modal-medium,
    .modal-large {
        width: 90%;
        max-height: 85vh;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .modal-small,
    .modal-medium,
    .modal-large {
        width: 95%;
        max-height: 90vh;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-button {
        width: 100%;
        padding: 0.65rem 1.2rem;
    }
}

/* ==================== ACCESSIBILITY ==================== */

/* Focus visible for keyboard navigation */
.form-input:focus-visible,
.form-button:focus-visible,
.gallery-filter:focus-visible,
.modal-button:focus-visible {
    outline: 3px solid #c92a2a;
    outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
    .thermometer-fill,
    .gallery-image,
    .form-input,
    .form-button,
    .modal,
    .modal-overlay {
        transition: none;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .form-input,
    .form-textarea,
    .form-select {
        background: #2d2d2d;
        color: #fff;
        border-color: #444;
    }
    
    .form-input:focus,
    .form-textarea:focus,
    .form-select:focus {
        border-color: #ff6b6b;
    }
    
    .modal {
        background: #2d2d2d;
        color: #fff;
    }
    
    .modal-header,
    .modal-footer {
        border-color: #444;
    }
    
    .modal-button {
        background: #3d3d3d;
        color: #fff;
        border-color: #555;
    }
    
    .modal-button:hover {
        border-color: #ff6b6b;
        color: #ff6b6b;
    }
}

/* ==================== SPONSOR CARDS ==================== */

.sponsor-card.primary-sponsor {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f9f7ff 0%, #fff9ff 100%);
    border-top: 6px solid #9d4edd;
}

.sponsor-card.primary-sponsor h3 {
    color: #4b2d7f;
    margin: 1rem 0;
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
}

.sponsor-card.primary-sponsor p {
    color: #666;
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

.sponsor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.sponsor-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-align: center;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.sponsor-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

.sponsor-card h4 {
    color: #4b2d7f;
    font-size: 1.1rem;
    margin: 1rem 0 0.5rem 0;
    font-weight: 600;
    font-family: 'Poppins', sans-serif;
    text-decoration: none;
}

.sponsor-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
    text-decoration: none;
}

.sponsor-card a {
    text-decoration: none;
    color: inherit;
}

.sponsor-card a:hover {
    text-decoration: none;
}

.sponsor-card img {
    max-width: 100%;
    max-height: 80px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.sponsors-container {
    max-width: 100%;
    margin: 0 auto;
}

#sponsors {
    background: #f9f7ff;
    padding: 4rem 2rem;
    border-radius: 1.2rem;
    margin: 3rem auto;
    max-width: 1400px;
    width: 100%;
}

#sponsors h2 {
    color: #4b2d7f;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
    text-align: center;
}

#sponsors .section-subtitle {
    color: #666;
    margin-bottom: 2rem;
    text-align: center;
}

@media (max-width: 768px) {
    .sponsor-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1.5rem;
    }

    .sponsor-card {
        padding: 1.5rem;
        min-height: 180px;
    }

    .sponsor-card h4 {
        font-size: 1rem;
        margin-top: 0.75rem;
    }

    .sponsor-card p {
        font-size: 0.85rem;
    }

    .sponsor-card img {
        max-height: 60px;
    }

    #sponsors {
        padding: 2rem 1rem;
    }

    #sponsors h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 480px) {
    .sponsor-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 1rem;
    }

    .sponsor-card {
        padding: 1rem;
        min-height: 160px;
    }

    .sponsor-card h4 {
        font-size: 0.9rem;
        margin-top: 0.5rem;
    }

    .sponsor-card p {
        font-size: 0.75rem;
        display: none;
    }

    .sponsor-card img {
        max-height: 50px;
    }
}
