/* =============================== */
/* === SHARED GLOBAL STYLES ====== */
/* =============================== */

body {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    background-color: #dfcda7; /* Page Background*/
    color: #5b4a2c; 
    margin: 0;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    font-size: 1.5rem;
    color: #5b4a2c; /* Top Text Color*/
    letter-spacing: 1px;
	font-family: 'Open Sans', 'Segoe UI', Tahoma, sans-serif;
	font-weight: bold;
}

.loading-message {
    font-size: 1.5rem;
    color: #888;
    text-align: center;
    padding: 30px;
}

/* === NEW: Status Colors based on Image === */
/* Green for "Available", "In Consultation", "Go Ahead" */
.status.on-time,
.status.go-ahead,
.status.status-available,
.status.status-in-consultation {
    background-color: #5C9458; /* Muted Green */
    color: #ffffff; /* White text */
}

/* Gold for "Delayed" */
.status.delayed,
.status.status-consultation-delayed {
    background-color: #C09853; /* Gold/Brown */
    color: #ffffff;
}

/* Red for "Not Available", "Finished" */
.status.away,
.status.finished,
.status.status-not-available {
    background-color: #D32F2F; /* Standard Red */
    color: #ffffff;
}

/* =============================== */
/* === BASE CONTAINER (Minimal) === */
/* =============================== */
#board-container {
     margin: 0 auto; /* Center */
     /* All other styles are applied by .card-layout or .row-layout */
}


/* =============================== */
/* === CARD VIEW STYLES ========== */
/* =============================== */

/* Card View Container Specifics */
.card-layout#board-container { /* You can also combine them like this */
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 25px;
    max-width: 1920px;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-size: inherit;
}

/* Card Styling */
.card-layout .doctor-card {
    background-color: #f7ecd8;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08); /* Softer shadow */
    padding: 20px 25px;
    transition: transform 0.2s ease;
    border-left: 5px solid #A3844D; /* Default Gold accent */
}

.card-layout .doctor-card:hover {
    transform: translateY(-3px);
}

.card-layout .doctor-card h2 {
    margin: 0 0 5px 0;
    font-size: 1.6rem;
    color: #5b4a2c;
}

.card-layout .doctor-card .specialty {
    margin: 0 0 15px 0;
    font-size: 1.1rem;
    color: #5b4a2c;
    font-weight: 500;
}

/* Card View Status Pill Specifics */
.card-layout .doctor-card .status {
    font-size: 1.3rem;
    font-weight: normal; /* Image uses normal weight for status text */
    padding: 8px 10px;
    border-radius: 4px;
    text-align: center;
    margin-bottom: 20px;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2); /* Slight depth like buttons */
}

/* Card Borders matching status */
.card-layout .doctor-card.	,
.card-layout .doctor-card.status-in-consultation,
.card-layout .doctor-card.status-on-time {
    border-left-color: #C09853;
}
.card-layout .doctor-card.status-consultation-delayed,
.card-layout .doctor-card.status-delayed {
    border-left-color: #C09853;
}
.card-layout .doctor-card.status-not-available,
.card-layout .doctor-card.status-away {
    border-left-color: #C09853;
}

/* Card View Appointment Info */
.card-layout .appointment-info {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #5b4a2c;
}

.card-layout .appointment-info strong {
    color: #5b4a2c; /* Gold labels */
}


/* =============================== */
/* === FOOTER STYLES (NEW) ======= */
/* =============================== */
footer {
    /* Use Grid instead of Flex for perfect centering */
    display: grid;
    /* 3 Columns: Left side (1 share), Center (fit to text), Right side (1 share) */
    grid-template-columns: 1fr auto 1fr; 
    align-items: center;

    margin-top: 20px;
    padding-top: 10px;
    
    /* Updated Color: Brown/Gold to match cards */
    border-top: 2px solid #A3844D; 
    
    color: #5b4a2c;
}

#clock-display {
    font-family: 'Open Sans', sans-serif;
    font-size: 3rem;
    font-weight: 600;
    color: #3b2f1c;
    line-height: 1;
    
    /* Force clock to stick to the left side */
    justify-self: start; 
}

#footer-message {
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    font-size: 1.3rem;
    color: #5b4a2c;
    
    /* Center the text and force it into the middle column */
    text-align: center;
    grid-column: 2; 
}

/* UPDATED: Keyframes now control the Border Color too */
@keyframes flash-highlight {
    0%   { background-color: #f7ecd8; transform: scale(1);    border-left-color: #A3844D; } /* Start Brown */
    25%  { background-color: #ffe082; transform: scale(1.02); border-left-color: #ffe082; box-shadow: 0 0 15px #ffe082; } /* Flash Yellow */
    50%  { background-color: #f7ecd8; transform: scale(1);    border-left-color: #A3844D; } /* Back to Brown */
    75%  { background-color: #ffe082; transform: scale(1.02); border-left-color: #ffe082; box-shadow: 0 0 15px #ffe082; } /* Flash Yellow */
    100% { background-color: #f7ecd8; transform: scale(1);    border-left-color: #A3844D; } /* End Brown */
}

/* UPDATED: Removed the static border-color property */
.card-flash {
    animation: flash-highlight 4s ease-in-out;
    z-index: 10;
    /* We REMOVED 'border-color' from here so it doesn't get stuck! */
}

/* ================================================= */
/* === FLUID KIOSK LAYOUT (4x2 PAGINATED) ========= */
/* ================================================= */

/* 1. Main Screen Setup */
body.tv-kiosk {
    height: 100vh;        
    width: 100vw;         
    overflow: hidden;     
    display: flex;
    flex-direction: column;
    padding: 1.5vh 2vw; 
    box-sizing: border-box;
    background-color: #dfcda7; 
}

/* 2. Header Scaling (Updated for Logo + Text) */
body.tv-kiosk header {
    flex: 0 0 auto;       
    margin-bottom: 1vh;
    height: 20vh;          /* Increased from 6vh to fit Logo + Text */
    
    display: flex;
    flex-direction: column; /* Stack Logo on top of Text */
    align-items: center;
    justify-content: center;
}

/* NEW: Logo Styling */
body.tv-kiosk #header-logo {
    height: 14.5vh;           /* Logo takes up about 9% of screen height */
    width: auto;           /* Maintain aspect ratio */
    margin-bottom: 1.5vh;  /* Space between logo and text */
}

/* Adjusted Title Styling */
body.tv-kiosk header h1 {
    font-size: 7.5vh;        /* Slightly smaller to fit under logo */
    line-height: 1;
    margin: 0;
    text-align: center;
    font-weight: 600;      /* Make it look clean like the screenshot */
    color: #5b4a2c;
}

/* 3. The Grid (4 Columns x 2 Rows = 8 Slots) */
body.tv-kiosk main {
    flex: 1;              
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

body.tv-kiosk .card-layout#board-container {
    height: 100%;         
    display: grid;
    /* CHANGED: 4 Columns */
    grid-template-columns: repeat(4, 1fr);
    /* CHANGED: 2 Rows */
    grid-template-rows: repeat(2, minmax(0, 1fr));
    
    gap: 2vh;             /* Increased gap */
    padding: 0;
}

/* 4. The Card */
body.tv-kiosk .card-layout .doctor-card {
    display: flex;
    flex-direction: column;
    justify-content: space-evenly; 
    padding: 1.5vh 1.5vw; /* More padding */
    width: 100%;
    height: 100%;
    box-sizing: border-box;
    overflow: hidden;     
}

/* 5. Typography - Scaled Up for Bigger Cards */

/* Doctor Name */
body.tv-kiosk .card-layout .doctor-card h2 {
    font-size: 5.5vh;     /* Increased from 2.4vh */
    line-height: 1.1;
    font-weight: 800;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Specialty */
body.tv-kiosk .card-layout .doctor-card .specialty {
    font-size: 4vh;     
    color: #5b4a2c;
    margin: 0;
	font-weight: 600;     /* Semi-bold for better readability */
    white-space: nowrap; 
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Status Pill */
body.tv-kiosk .card-layout .doctor-card .status {
    font-size: 6vh;     
    padding: 1.5vh 0;     
    margin: 1.5vh 0;
    border-radius: 1.2vh; 
	font-weight: bold;
    width: 100%;
    display: flex;        
    align-items: center;
    justify-content: center;
}

/* Info Rows */
body.tv-kiosk .card-layout .appointment-info {
    font-size: 5.5vh;     
    line-height: 1.4;
    margin: 0;
	font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 6. Footer Scaling */
body.tv-kiosk footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    height: 15vh;          
    margin-top: 1vh;
    padding-top: 0.5vh;
    border-top-width: 0.4vh; 
}

body.tv-kiosk #clock-display {
    font-size: 12vh;       
    justify-self: start;
}

body.tv-kiosk #footer-message {
    font-size: 9vh;       
    grid-column: 2;
    text-align: center;
}

/* 7. Promo Card Override */
body.tv-kiosk .card-layout .promo-card {
    /* CHANGED: Bottom Right of a 4x2 grid is Col 4, Row 2 */
    grid-column: 4;
    grid-row: 2;
    
    padding: 0 !important;
    background-color: black;
    border-width: 0.4vh;  
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 8. Promo Content Scaling */
body.tv-kiosk .promo-content {
    width: 100%;
    height: 100%;
    object-fit: cover; 
    display: none; 
}

body.tv-kiosk .promo-content.active {
    display: block; 
}