/**
 * QMSPress Now Serving Display Styles (now-serving-display.css)
 * Styles for the [qmspress_now_serving] shortcode output.
 */

/* --- Overall Container --- */
.qmspress-now-serving-container {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 20px;
    background-color: #f8f9fa; /* Light grey background */
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    display: flex;
    gap: 20px; /* Adjusted gap for side-by-side */
    margin: 20px auto; /* Center container based on theme width */
    box-sizing: border-box;
    min-height: 75vh; /* *** ADDED: Make container at least full viewport height *** */
}

/* --- "Now Serving" Section --- */
.qmspress-serving-section {
    flex: 7; /* Takes 7 parts of the available space */
    background-color: #0056b3; /* Darker blue background */
    color: #ffffff; /* White text */
    padding: 30px 20px;
    border-radius: 8px;
    text-align: center;
    box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.2);
    min-width: 0; /* Allow shrinking if needed */
    /* Added flex properties to center its content */
    display: flex;
    flex-direction: column;
    justify-content: center; /* Vertical centering */
    align-items: center; /* Horizontal centering */
}

.qmspress-serving-title {
    font-size: 2.5em; /* Large title */
    font-weight: 300; /* Lighter font weight */
    margin: 0 0 15px 0;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    width: 100%; /* Ensure title takes width for centering */
}

.qmspress-serving-ticket {
    min-height: 150px; /* Ensure space even when loading */
    display: flex; /* This already centers its own children */
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: background-color 0.5s ease; /* For flashing effect */
    width: 100%; /* Ensure inner div takes width */
}

/* Ticket Number in Serving Section */
.qmspress-serving-ticket-number {
    display: block;
    font-size: 4.5em; /* Very large ticket number */
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 10px;
    word-break: break-all; /* Break long ticket numbers */
}
.qmspress-serving-ticket-number strong {
    margin-left: 10px;
}

/* Counter Name in Serving Section */
.qmspress-serving-counter-name {
    display: block;
    font-size: 2.8em; /* Large counter name */
    font-weight: 500;
    line-height: 1.2;
    word-break: break-word;
}
.qmspress-serving-counter-name strong {
    margin-left: 10px;
    font-weight: 700;
}

/* Loading/Error/No Serving Messages in Serving Section */
.qmspress-serving-ticket .qmspress-loading-message,
.qmspress-serving-ticket .qmspress-no-serving-message,
.qmspress-serving-ticket .qmspress-error-message {
    font-size: 2em;
    font-style: italic;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
}
.qmspress-serving-ticket .qmspress-error-message {
    color: #ffdddd; /* Light red for error */
    font-weight: 500;
    font-style: normal;
}


/* --- Flashing Animation --- */
/* Define the keyframes for the flash */
@keyframes qmspressFlash {
  0%, 100% { background-color: #0056b3; } /* Start/End color */
  50% { background-color: #007bff; } /* Brighter color during flash */
}

/* Apply flashing animation via class toggled by JS */
.qmspress-serving-ticket.qmspress-flashing-active { /* Use a persistent class during flash sequence */
    /* Flashing applied to the inner div, need to adjust if section background should flash */
    /* If the whole section should flash, move animation to .qmspress-serving-section */
    /* For now, assuming inner div flash is desired */
    /* No background animation needed here if inner div doesn't have its own background */
}
/* If you want the entire blue section to flash, uncomment below and comment out animation on .qmspress-serving-ticket if needed */
/* .qmspress-serving-section.qmspress-flashing-active {
    animation: qmspressFlash 1s ease-in-out infinite;
} */


/* --- "Recently Served" Section --- */
.qmspress-served-section {
    flex: 3; /* Takes 3 parts of the available space */
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    min-width: 0; /* Allow shrinking if needed */
    display: flex; /* Added to allow list to grow */
    flex-direction: column; /* Stack title and list */
}

.qmspress-served-section .qmspress-section-title { /* Target title within served section */
    font-size: 1.8em;
    font-weight: 600;
    color: #333;
    margin: 0 0 15px 0;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0; /* Prevent title from shrinking */
}

.qmspress-served-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 60vh; /* Limit height if list gets long (adjust as needed) */
    overflow-y: auto;
    flex-grow: 1; /* Allow list to take remaining space */
}

/* Re-use ticket item style, but maybe smaller */
.qmspress-served-list .qmspress-ticket-item {
    background: #f8f9fa;
    margin: 5px 0;
    padding: 10px 15px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
    display: flex;
    justify-content: center; /* Center content */
    text-align: center;
}

.qmspress-served-list .qmspress-ticket-info {
    display: flex;
    gap: 15px; /* Space between ticket# and folder# */
    flex-wrap: wrap; /* Allow wrapping */
    justify-content: center;
}

.qmspress-served-list .qmspress-ticket-number,
.qmspress-served-list .qmspress-folder-number {
    font-size: 1.2em; /* Smaller than serving section */
    color: #495057;
    word-break: break-all;
}
.qmspress-served-list .qmspress-ticket-number strong,
.qmspress-served-list .qmspress-folder-number strong {
    font-weight: 600;
    color: #343a40;
    margin-left: 5px;
}

/* Loading/No Tickets/Error states for Served List */
.qmspress-served-list .qmspress-ticket-item.qmspress-loading,
.qmspress-served-list .qmspress-ticket-item.qmspress-no-tickets,
.qmspress-served-list .qmspress-ticket-item.qmspress-error {
    justify-content: center;
    font-style: italic;
    color: #6c757d;
    background: #f8f9fa;
    border: 1px dashed #ced4da;
    padding: 15px;
    text-align: center;
    font-size: 1em;
}
.qmspress-served-list .qmspress-ticket-item.qmspress-error {
     color: #dc3545;
     border-color: #f5c6cb;
     background-color: #f8d7da;
     font-style: normal;
     font-weight: 500;
}


/* --- Responsive Adjustments --- */
@media only screen and (max-width: 768px) {
    .qmspress-now-serving-container {
        flex-direction: column; /* Stack columns vertically */
        gap: 15px;
        min-height: auto; /* Reset min-height for stacked view */
        /* align-items: stretch; */ /* Reset alignment for stacking */
    }
    /* Reset flex properties for stacked layout */
    .qmspress-serving-section,
    .qmspress-served-section {
        flex: 1 1 auto; /* Allow grow/shrink, auto basis */
        /* Remove fixed flex ratio */
    }
     /* Adjust serving section padding/min-height for stacked view */
    .qmspress-serving-section {
        padding: 20px 15px;
    }
     .qmspress-serving-ticket {
        min-height: 120px;
    }

    .qmspress-serving-title { font-size: 2em; }
    .qmspress-serving-ticket-number { font-size: 3.5em; }
    .qmspress-serving-counter-name { font-size: 2em; }
    .qmspress-serving-ticket .qmspress-loading-message,
    .qmspress-serving-ticket .qmspress-no-serving-message,
    .qmspress-serving-ticket .qmspress-error-message { font-size: 1.5em; }

    .qmspress-served-section .qmspress-section-title { font-size: 1.5em; }
    .qmspress-served-list .qmspress-ticket-number,
    .qmspress-served-list .qmspress-folder-number { font-size: 1.1em; }
    .qmspress-served-list { max-height: none; } /* Remove max-height when stacked */
}

@media only screen and (max-width: 480px) {
     .qmspress-now-serving-container { padding: 10px; gap: 20px; }
     .qmspress-serving-section { padding: 20px 10px; }
     .qmspress-serving-title { font-size: 1.6em; letter-spacing: 1px; }
     .qmspress-serving-ticket-number { font-size: 2.8em; }
     .qmspress-serving-counter-name { font-size: 1.6em; }
     .qmspress-serving-ticket .qmspress-loading-message,
     .qmspress-serving-ticket .qmspress-no-serving-message,
     .qmspress-serving-ticket .qmspress-error-message { font-size: 1.2em; }

     .qmspress-served-section { padding: 15px; }
     .qmspress-served-section .qmspress-section-title { font-size: 1.3em; }
     .qmspress-served-list .qmspress-ticket-number,
     .qmspress-served-list .qmspress-folder-number { font-size: 1em; }
     .qmspress-served-list .qmspress-ticket-info { gap: 10px; }
}