/* Custom CSS for Live Status Page - Matching Site Style */

/* Page Container */
.live-status-page {
    width: 100%;
    min-height: 100vh;
    background-color: var(--gray-light, #f5f5f5);
    font-family: var(--font-display, 'Vazirmatn', sans-serif);
    display: flex;
    flex-direction: column;
    --live-status-top-offset: 7rem;
    --live-status-footer-offset: 3.5rem;
}

/* Fixed top block: header + brand banner */
.live-status-top {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* Compact Header Section */
.live-status-header {
    background: linear-gradient(135deg, var(--black, #000000) 10%, #2a5298 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.5rem 0;
}

.live-status-header-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.live-status-header-content {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 1rem;
}

.live-status-datetime {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 600;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
    letter-spacing: 0.3px;
    justify-content: flex-end;
    order: 3;
}

.live-status-title {
    text-align: center;
    order: 2;
}

.live-status-title h1 {
    color: var(--white, #ffffff);
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.live-status-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    justify-content: flex-start;
    order: 1;
}

.live-status-logo-img {
    width: 2.5rem;
    height: 2.5rem;
    object-fit: contain;
}

.live-status-logo-text {
    color: rgba(255, 255, 255, 0.95);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.2px;
    line-height: 1.35;
    word-break: break-word;
}

/* Brand Banner Section */
.live-status-banner {
    background: linear-gradient(135deg, #e8f0fe 0%, #d4e4f7 50%, #c5daf2 100%);
    border-bottom: 1px solid rgba(30, 60, 114, 0.12);
    padding: 0.625rem 0;
}

.live-status-banner-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

.live-status-brand-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.625rem 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.97) 0%, rgba(255, 255, 255, 0.88) 100%);
    border-radius: 10px;
    border: 1px solid rgba(30, 60, 114, 0.1);
    box-shadow: 0 2px 12px rgba(30, 60, 114, 0.07);
}

.live-status-brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 1.75rem;
    height: 1.75rem;
    color: var(--primary-blue, #1e3c72);
    opacity: 0.85;
}

.live-status-brand-icon svg {
    width: 100%;
    height: 100%;
}

.live-status-brand-text {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary-blue, #1e3c72);
    letter-spacing: 0.01em;
    text-align: center;
    line-height: 1.4;
}

.live-status-brand-live {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    padding: 0.2rem 0.55rem;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.25);
    border-radius: 999px;
}

.live-status-brand-live-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    background: #4caf50;
    animation: live-status-brand-pulse 2s ease-in-out infinite;
}

.live-status-brand-live-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: #2e7d32;
    letter-spacing: 0.04em;
}

@keyframes live-status-brand-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(76, 175, 80, 0.45);
    }
    50% {
        box-shadow: 0 0 0 4px rgba(76, 175, 80, 0);
    }
}

@media (prefers-reduced-motion: reduce) {
    .live-status-brand-live-dot {
        animation: none;
    }
}

/* Main Content Area */
.live-status-main {
    margin-top: var(--live-status-top-offset);
    margin-bottom: var(--live-status-footer-offset);
    padding: 1.5rem 1.5rem 1rem 1.5rem;
    flex: 1;
}

.live-status-table-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--white, #ffffff);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.1);
    margin-top: 1.5rem;
    width: 100%;
    box-sizing: border-box;
}

/* Table Header */
.live-status-table-header {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1.8fr 1.2fr 1.3fr;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    background: var(--light-blue, #e3f2fd);
    border-bottom: 2px solid var(--primary-blue, #1e3c72);
    min-height: 60px;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.live-status-table-header.is-multi {
    grid-template-columns: 1.2fr 1.5fr 2fr 1.8fr 1.2fr 1.3fr;
}

.live-status-header-cell {
    color: var(--primary-blue, #1e3c72);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    word-wrap: normal;
    line-height: 1.4;
}

.live-status-header-cell-center {
    text-align: center;
}

/* Schedule List Container - Auto-scrolling */
.live-status-schedule-list {
    max-height: calc(100vh - var(--live-status-top-offset) - var(--live-status-footer-offset) - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: auto;
    overflow-anchor: none;
    position: relative;
}

/* Hide scrollbar but keep functionality */
.live-status-schedule-list::-webkit-scrollbar {
    width: 6px;
}

.live-status-schedule-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.live-status-schedule-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.live-status-schedule-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Schedule Row */
.live-status-schedule-row {
    display: grid;
    grid-template-columns: 1.5fr 2fr 1.8fr 1.2fr 1.3fr;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.live-status-schedule-row.is-multi {
    grid-template-columns: 1.2fr 1.5fr 2fr 1.8fr 1.2fr 1.3fr;
}

.live-status-schedule-row:last-child {
    border-bottom: none;
}

.live-status-schedule-row:hover {
    background-color: var(--light-blue, #e3f2fd);
}

.live-status-cell {
    color: var(--black, #000000);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
}

.live-status-cell-time {
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.live-status-cell-center {
    justify-content: center;
}

/* Status Badge */
.live-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    border: 2px solid;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.live-status-badge-active {
    background-color: #e8f5e9;
    border-color: #4caf50;
    color: #2e7d32;
}

.live-status-badge-online {
    background-color: #e3f2fd;
    border-color: #2196F3;
    color: #1565C0;
}

.live-status-badge-inactive {
    background-color: #ffebee;
    border-color: #f44336;
    color: #c62828;
}

.live-status-badge-neutral {
    background-color: #eceff1;
    border-color: #90a4ae;
    color: #546e7a;
}

.live-status-badge-circle {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    flex-shrink: 0;
}

.live-status-badge-active .live-status-badge-circle {
    background-color: #4caf50;
    box-shadow: 0 0 0 0 currentColor;
}

.live-status-badge-online .live-status-badge-circle {
    background-color: #2196F3;
    box-shadow: 0 0 0 0 currentColor;
}

.live-status-badge-inactive .live-status-badge-circle {
    background-color: #f44336;
    box-shadow: 0 0 0 0 currentColor;
}

/* Pulsing animation for status circle */
@keyframes pulse-circle {
    0%, 100% {
        opacity: 1;
        box-shadow: 0 0 0 0 currentColor;
    }
    50% {
        opacity: 0.9;
        box-shadow: 0 0 0 4px currentColor;
    }
}

.status-circle-pulse {
    animation: pulse-circle 2s ease-in-out infinite;
}

/* Empty State */
.live-status-empty {
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--gray-medium, #9e9e9e);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.live-status-empty-image {
    max-width: 200px;
    max-height: 150px;
    width: auto;
    height: auto;
    object-fit: contain;
    margin-bottom: 0.5rem;
}

.live-status-empty p {
    font-size: 1rem;
    margin: 0;
}

/* Footer */
.live-status-footer {
    background: linear-gradient(135deg, var(--black, #000000) 0%, #1a2a4a 100%);
    color: var(--white, #ffffff);
    padding: 0.75rem 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.15);
}

.live-status-footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-align: center;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

.live-status-footer-content p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--white, #ffffff);
}

.live-status-footer-link {
    color: var(--white, #ffffff);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

.live-status-footer-link:hover {
    color: var(--secondary-blue, #2196F3);
}

.live-status-footer-close {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--white, #ffffff);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    opacity: 0.8;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-status-footer-close:hover {
    opacity: 1;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-50%) scale(1.1);
}

.live-status-footer-close:active {
    transform: translateY(-50%) scale(0.95);
}

.live-status-footer-close span {
    font-size: 1.5rem;
    line-height: 1;
    font-weight: 300;
}

.live-status-footer.hidden {
    display: none;
}

/* Responsive Design */

/* Tablet and smaller desktop */
@media (max-width: 1200px) {
    .live-status-header-container,
    .live-status-banner-container,
    .live-status-table-wrapper,
    .live-status-footer-content {
        max-width: 100%;
        padding: 0 1rem;
    }

    .live-status-table-header,
    .live-status-schedule-row {
        grid-template-columns: 1.2fr 1.8fr 1.5fr 1fr 1.2fr;
        gap: 1rem;
    }

    .live-status-table-header.is-multi,
    .live-status-schedule-row.is-multi {
        grid-template-columns: 1.1fr 1.2fr 1.8fr 1.5fr 1fr 1.2fr;
    }

    .live-status-header-cell,
    .live-status-cell {
        font-size: 0.9rem;
    }
}

/* Tablet portrait */
@media (max-width: 992px) {
    .live-status-header-content {
        grid-template-columns: 1fr 2fr 1fr;
        gap: 0.75rem;
    }

    .live-status-title h1 {
        font-size: 1.15rem;
    }

    .live-status-datetime {
        font-size: 0.9rem;
    }

    .live-status-table-header,
    .live-status-schedule-row {
        grid-template-columns: 1fr 1.5fr 1.2fr 1fr 1fr;
        gap: 0.75rem;
        padding: 0.875rem 1rem;
    }

    .live-status-table-header.is-multi,
    .live-status-schedule-row.is-multi {
        grid-template-columns: 1fr 1fr 1.5fr 1.2fr 1fr 1fr;
    }

    .live-status-header-cell,
    .live-status-cell {
        font-size: 0.875rem;
    }
}

/* Mobile landscape and small tablets */
@media (max-width: 768px) {
    .live-status-header {
        padding: 0.5rem 0;
    }

    .live-status-header-content {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .live-status-datetime {
        text-align: center;
        font-size: 0.85rem;
        justify-content: center;
        order: 3;
    }

    .live-status-title {
        order: 2;
    }
    
    .live-status-title h1 {
        font-size: 1.1rem;
    }

    .live-status-logo {
        justify-content: center;
        order: 1;
    }

    .live-status-logo-img {
        width: 2rem;
        height: 2rem;
    }

    .live-status-logo-text {
        font-size: 0.85rem;
        max-width: 100%;
    }

    .live-status-main {
        padding: 1rem;
    }

    .live-status-table-header,
    .live-status-schedule-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 0.75rem 1rem;
    }

    .live-status-header-cell {
        display: none;
    }

    .live-status-schedule-row {
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 0.5rem;
        border-radius: 8px;
        background-color: rgba(0, 0, 0, 0.02);
    }

    .live-status-schedule-row:last-child {
        border-bottom: 2px solid rgba(0, 0, 0, 0.1);
        margin-bottom: 0;
    }

    .live-status-cell {
        font-size: 0.85rem;
        padding: 0.25rem 0;
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .live-status-cell::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--primary-blue, #1e3c72);
        margin-bottom: 0.25rem;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .live-status-cell-center {
        align-items: center;
    }

    .live-status-cell-center::before {
        align-self: center;
    }

    .live-status-schedule-list {
        max-height: calc(100vh - var(--live-status-top-offset) - var(--live-status-footer-offset) - 1.5rem);
    }

    .live-status-footer-content p {
        font-size: 0.8rem;
    }

    .live-status-badge {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .live-status-header {
        padding: 0.4rem 0;
    }

    .live-status-header-container {
        padding: 0 0.75rem;
    }

    .live-status-title h1 {
        font-size: 1rem;
    }

    .live-status-datetime {
        font-size: 0.8rem;
    }

    .live-status-logo-img {
        width: 1.75rem;
        height: 1.75rem;
    }

    .live-status-logo-text {
        font-size: 0.8rem;
    }

    .live-status-footer-close {
        right: 0.5rem;
        width: 1.75rem;
        height: 1.75rem;
        font-size: 1.25rem;
    }

    .live-status-footer-content {
        padding: 0 3rem 0 0.75rem;
    }

    .live-status-banner {
        padding: 0.4rem 0;
    }

    .live-status-banner-container {
        padding: 0 0.75rem;
    }

    .live-status-brand-icon {
        display: none;
    }

    .live-status-brand-text {
        font-size: 0.82rem;
    }

    .live-status-brand-banner {
        flex-wrap: wrap;
        justify-content: center;
        row-gap: 0.35rem;
    }

    .live-status-main {
        padding: 0.75rem 0.75rem;
    }

    .live-status-table-wrapper {
        margin-top: 1rem;
        border-radius: 8px;
    }

    .live-status-table-header {
        padding: 0.625rem 0.75rem;
        min-height: 50px;
    }

    .live-status-schedule-row {
        padding: 0.625rem 0.75rem;
        gap: 0.375rem;
    }

    .live-status-cell {
        font-size: 0.8rem;
    }

    .live-status-cell::before {
        font-size: 0.7rem;
    }

    .live-status-schedule-list {
        max-height: calc(100vh - var(--live-status-top-offset) - var(--live-status-footer-offset) - 1rem);
    }

    .live-status-footer {
        padding: 0.625rem 0;
    }

    .live-status-footer-content {
        padding: 0 0.75rem;
    }

    .live-status-footer-content p {
        font-size: 0.75rem;
    }

    .live-status-badge {
        font-size: 0.75rem;
        padding: 0.35rem 0.5rem;
        gap: 0.375rem;
    }

    .live-status-badge-circle {
        width: 0.625rem;
        height: 0.625rem;
    }
}

/* Very small mobile devices */
@media (max-width: 360px) {
    .live-status-title h1 {
        font-size: 0.9rem;
    }

    .live-status-datetime {
        font-size: 0.75rem;
    }

    .live-status-main {
        padding: 0.5rem;
    }

    .live-status-schedule-row {
        padding: 0.5rem;
    }

    .live-status-cell {
        font-size: 0.75rem;
    }
}

/* Large displays / TV monitors */
@media (min-width: 1400px) {
    .live-status-title h1 {
        font-size: 1.5rem;
    }

    .live-status-logo-text {
        font-size: 1.05rem;
    }

    .live-status-datetime {
        font-size: 1.05rem;
    }

    .live-status-brand-text {
        font-size: 1.15rem;
    }

    .live-status-header-cell,
    .live-status-cell {
        font-size: 1.05rem;
    }

    .live-status-badge {
        font-size: 0.95rem;
        padding: 0.55rem 0.85rem;
    }

    .live-status-table-header,
    .live-status-schedule-row {
        padding: 1.125rem 1.75rem;
    }
}

@media (min-width: 1920px) {
    .live-status-title h1 {
        font-size: 1.65rem;
    }

    .live-status-header-cell,
    .live-status-cell {
        font-size: 1.1rem;
    }

    .live-status-brand-text {
        font-size: 1.25rem;
    }
}
