/* Vitachallenge App - Stylesheet */

:root {
    --theme-color: #f97316; 
    --theme-color-light: #ffedd5;
    --theme-color-hover: #ea580c;
}

body { 
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; 
    background-color: #f3f4f6; 
}

/* Cards & Layout */
.card { 
    background: white; 
    border-radius: 12px; 
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); 
    border: 1px solid #e5e7eb; 
}

.section-title { 
    font-size: 1.25rem; 
    font-weight: 700; 
    color: #1f2937; 
    margin-bottom: 1rem; 
    display: flex; 
    align-items: center; 
    gap: 0.5rem; 
}

/* Dynamic Theme Utility Classes */
.text-theme { color: var(--theme-color); }
.bg-theme { background-color: var(--theme-color); }
.bg-theme-light { background-color: var(--theme-color-light); }
.border-theme { border-color: var(--theme-color); }
.ring-theme { --tw-ring-color: var(--theme-color); }

/* Custom Header Banner */
.header-banner {
    position: relative;
    background-size: cover;
    background-position: center;
    color: white;
    border-radius: 0 0 20px 20px;
    overflow: hidden;
    transition: all 0.5s ease;
}

.header-overlay {
    background: linear-gradient(to right, rgba(0,0,0,0.8), rgba(0,0,0,0.4));
    position: absolute; 
    inset: 0;
}

/* Buttons */
.btn-primary { 
    background-color: var(--theme-color); 
    color: white; 
    transition: all 0.2s; 
    box-shadow: 0 2px 4px rgba(0,0,0, 0.2);
}

.btn-primary:hover { 
    background-color: var(--theme-color-hover); 
    transform: translateY(-1px); 
}

.btn-secondary { 
    background-color: #eff6ff; 
    color: #1d4ed8; 
    border: 1px solid #bfdbfe; 
}

.btn-secondary:hover { 
    background-color: #dbeafe; 
}

/* Loader */
.loader {
    border: 3px solid var(--theme-color-light); 
    border-top: 3px solid var(--theme-color); 
    border-radius: 50%; 
    width: 24px; 
    height: 24px; 
    animation: spin 1s linear infinite;
}

@keyframes spin { 
    0% { transform: rotate(0deg); } 
    100% { transform: rotate(360deg); } 
}

/* Avatar Grid */
.avatar-selection {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
    gap: 10px;
    max-height: 180px;
    overflow-y: auto;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #f9fafb;
}

.avatar-btn {
    font-size: 1.8rem;
    line-height: 1;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.1s, background 0.1s;
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.avatar-btn:hover { 
    background-color: #e5e7eb; 
}

.avatar-btn.selected {
    background-color: var(--theme-color-light);
    border: 2px solid var(--theme-color);
    transform: scale(1.1);
}

/* Live Race Tracks */
.race-track-container {
    height: 160px;
    background: linear-gradient(to right, #e0f2fe, #f0f9ff);
    border-radius: 12px;
    border: 2px solid #bae6fd;
    position: relative;
    overflow: hidden; 
    margin-bottom: 0.5rem;
}

.finish-line {
    position: absolute; 
    right: 0; 
    top: 0; 
    bottom: 0; 
    width: 40px;
    background-image: repeating-linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000), 
                      repeating-linear-gradient(45deg, #000 25%, transparent 25%, transparent 75%, #000 75%, #000);
    background-position: 0 0, 10px 10px;
    background-size: 20px 20px;
    opacity: 0.1;
    z-index: 0;
}

.racer {
    position: absolute; 
    top: 50%; 
    transform: translateY(-50%);
    transition: left 1s cubic-bezier(0.4, 0, 0.2, 1); 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    z-index: 10;
}

.racer-avatar { 
    font-size: 2.5rem; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15)); 
    transition: transform 0.3s; 
}

.racer:hover .racer-avatar { 
    transform: scale(1.2); 
    z-index: 20; 
}

.racer-team-icon { 
    font-size: 2rem; 
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15)); 
    transition: transform 0.3s;
}

.racer-label {
    white-space: nowrap; 
    font-weight: 700; 
    font-size: 0.75rem;
    background: rgba(255,255,255,0.95); 
    padding: 2px 6px; 
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1); 
    margin-top: -4px; 
    color: #333;
}

/* Modal */
.modal { 
    background-color: rgba(0, 0, 0, 0.5); 
    backdrop-filter: blur(2px); 
}

/* Admin Dashboard */
#admin-overlay-dashboard { 
    transition: opacity 0.3s; 
}

textarea::-webkit-scrollbar { 
    width: 8px; 
}

textarea::-webkit-scrollbar-thumb { 
    background-color: #cbd5e1; 
    border-radius: 4px; 
}

/* Compliment Animation */
@keyframes popIn {
    0% { transform: scale(0.5); opacity: 0; }
    80% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.compliment-pop {
    animation: popIn 0.5s ease-out forwards;
}
