/* --- FIWA-INSPIRED COLOR PALETTE --- */
:root {
    --fiwa-dark-blue: #1B365D;
    --fiwa-light-blue: #3A7ECB;
    --fiwa-gold: #D4AF37;
    --fiwa-bg-light: #f0f2f5; 
}

body {
    font-family: Arial, sans-serif;
    background-color: var(--fiwa-bg-light); 
    margin: 0;
}

#page-container {
    transition: all 0.3s ease-in-out;
}

/* --- HEADER & SEARCH STYLES (NOW DEFAULT) --- */
header {
    background-color: var(--fiwa-dark-blue); 
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px; 
}

header h1 {
    margin: 0;
    color: white;
}

.search-container {
    width: 100%;
    max-width: 600px;
    display: flex;
}
#search-input {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-radius: 20px 0 0 20px;
}
#search-button {
    padding: 10px 15px;
    font-size: 16px;
    border: 1px solid #ccc;
    border-left: none;
    background-color: #f8f8f8;
    cursor: pointer;
    border-radius: 0 20px 20px 0;
}
#search-button:hover { background-color: #eee; }

.disclaimer {
    margin: 0;
    padding: 0 10%;
    font-size: 12px;
    font-style: italic;
    text-align: center;
    color: #ccc; /* Defaulted to the 'results' color */
}

/* --- RESULTS GRID STYLES --- */
#results-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
}
.video-item {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden;
    cursor: pointer;
    
    /* --- NEW ANIMATION: Fade-in for search results --- */
    animation: fadeIn 0.5s ease-in-out;
    
    /* --- NEW ANIMATION: Transition for hover --- */
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.video-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.video-item img { width: 100%; height: auto; }
.video-item h4 {
    padding: 10px 10px 0;
    margin: 0;
    font-size: 16px;
    color: #333;
}
.channel-name {
    padding: 4px 10px 10px;
    margin: 0;
    font-size: 14px;
    color: #555;
}
#load-more-button {
    display: none;
    margin: 20px auto;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: bold;
    color: white;
    background-color: var(--fiwa-light-blue);
    border: none;
    border-radius: 8px;
    cursor: pointer;
}
#load-more-button:hover { background-color: var(--fiwa-gold); }

/* --- MODAL STYLES --- */
#modal-container {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background-color: rgba(0, 0, 0, 0.85); z-index: 1000;
    display: none; justify-content: center; align-items: center;
    overflow-y: auto; 
    
    /* --- NEW ANIMATION: Fade-in for the modal background --- */
    animation: fadeIn 0.3s ease;
}
#modal-content {
    background-color: #000; 
    padding: 20px; 
    border-radius: 8px;
    position: relative; 
    width: 80%; 
    max-width: 900px;
    padding-bottom: 0; 
    margin-top: 50px;
    margin-bottom: 50px;
}
#modal-close-button {
    position: absolute; top: -15px; right: -15px; background-color: white;
    color: black; border: none; border-radius: 50%;
    width: 30px; height: 30px; font-size: 20px;
    font-weight: bold; cursor: pointer; z-index: 1001;
}
#video-player-container {
    position: relative; padding-top: 56.25%; height: 0; overflow: hidden;
}
#video-player-container iframe {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
}

/* --- ANALYTICS BOX STYLES --- */
#video-analytics-container {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
    margin-bottom: 20px;
    color: #333;
    display: none; 
}
#video-analytics-container.visible {
    display: block;
}
#video-analytics-container p {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
}
#video-analytics-container .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); 
    gap: 10px;
    font-size: 14px;
}
#video-analytics-container .stat-item strong {
    display: block;
    font-size: 16px;
    color: var(--fiwa-dark-blue);
}

/* --- 
NEW ANIMATION: Keyframes for the fade-in effect 
--- 
*/
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}
