/* E31 NEXT-GEN SMART TV DASHBOARD - PURE WEBKIT CSS (CHROMIUM 38 COMPLIANT) */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-box-sizing: border-box;
    user-select: none;
    -webkit-user-select: none;
}

html, body {
    width: 1920px;
    height: 1080px;
    overflow: hidden;
    background-color: #f8fafc;
    font-family: 'Segoe UI', Tahoma, Arial, sans-serif;
    color: #0f172a;
}

.tv-canvas {
    width: 1920px;
    height: 1080px;
    padding: 24px 36px;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    position: relative;
}

/* ==========================================================================
   MODE SWITCHER PILL (TOP RIGHT)
   ========================================================================== */
.mode-switcher-pill {
    position: absolute;
    top: 36px;
    right: 48px;
    background-color: rgba(15, 23, 42, 0.85);
    border-radius: 30px;
    -webkit-border-radius: 30px;
    padding: 6px 10px;
    display: flex;
    display: -webkit-flex;
    gap: 8px;
    z-index: 1000;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.mode-pill-item {
    font-size: 13px;
    font-weight: 700;
    color: #94a3b8;
    padding: 6px 14px;
    border-radius: 20px;
    -webkit-border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-transition: all 0.2s;
}

.mode-pill-item.active {
    background-color: #2563eb;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.4);
}

/* ==========================================================================
   MARQUEE ANNOUNCEMENT TICKER
   ========================================================================== */
.marquee-strip {
    width: 100%;
    height: 46px;
    background-color: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    -webkit-border-radius: 14px;
    margin-top: 14px;
    margin-bottom: 14px;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    overflow: hidden;
    padding: 0 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
}

.marquee-tag {
    background-color: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    margin-right: 18px;
    flex-shrink: 0;
}

.marquee-box {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
}

.marquee-content {
    display: inline-block;
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
    padding-left: 100%;
    animation: marquee-roll 25s linear infinite;
    -webkit-animation: marquee-roll 25s linear infinite;
}

@-webkit-keyframes marquee-roll {
    0% { -webkit-transform: translate3d(0, 0, 0); }
    100% { -webkit-transform: translate3d(-100%, 0, 0); }
}

@keyframes marquee-roll {
    0% { transform: translate3d(0, 0, 0); }
    100% { transform: translate3d(-100%, 0, 0); }
}

/* ==========================================================================
   MODE 1: DASHBOARD VIEW
   ========================================================================== */
.dash-view-wrap {
    width: 100%;
    height: 940px;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: space-between;
    -webkit-justify-content: space-between;
}

.dash-header {
    width: 100%;
    height: 95px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    -webkit-border-radius: 18px;
    padding: 12px 30px;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.header-left {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
}

.user-avatar {
    width: 65px;
    height: 65px;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 26px;
    font-weight: 800;
    border-radius: 18px;
    -webkit-border-radius: 18px;
    display: flex;
    display: -webkit-flex;
    justify-content: center;
    -webkit-justify-content: center;
    align-items: center;
    -webkit-align-items: center;
    margin-right: 20px;
    box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25);
}

.welcome-title {
    font-size: 28px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.welcome-sub {
    font-size: 14px;
    color: #64748b;
    margin-top: 3px;
}

.header-right {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
}

.status-badge {
    background-color: #ecfdf5;
    border: 1.5px solid #a7f3d0;
    color: #059669;
    padding: 8px 16px;
    border-radius: 999px;
    -webkit-border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
    margin-right: 25px;
}

.pulse-dot {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    margin-right: 8px;
    animation: dot-pulse 1.5s infinite;
    -webkit-animation: dot-pulse 1.5s infinite;
}

@-webkit-keyframes dot-pulse {
    0%, 100% { opacity: 1; -webkit-transform: scale(1); }
    50% { opacity: 0.4; -webkit-transform: scale(1.3); }
}

@keyframes dot-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(1.3); }
}

.time-widget {
    text-align: right;
    border-left: 2px solid #e2e8f0;
    padding-left: 25px;
}

.time-display {
    font-size: 34px;
    font-weight: 900;
    color: #2563eb;
    font-family: 'Courier New', monospace;
    line-height: 1.1;
}

.date-display {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    margin-top: 3px;
}

/* Metric Stat Cards (Row 1) */
.metrics-row {
    width: 100%;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    margin-bottom: 14px;
}

.stat-card {
    width: 23.8%;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 18px;
    -webkit-border-radius: 18px;
    padding: 18px 22px;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    transition: all 0.2s ease;
    -webkit-transition: all 0.2s ease;
}

.stat-card-header {
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    margin-bottom: 6px;
}

.stat-label {
    font-size: 13px;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
    margin: 4px 0 6px 0;
}

.stat-desc {
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
}

.stat-tag {
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    -webkit-border-radius: 6px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.tag-green { background-color: #d1fae5; color: #065f46; }
.tag-purple { background-color: #ede9fe; color: #5b21b6; }
.tag-blue { background-color: #dbeafe; color: #1e40af; }
.tag-amber { background-color: #fef3c7; color: #92400e; }

/* Main Columns Area */
.main-columns {
    width: 100%;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    flex: 1;
    margin-bottom: 10px;
}

.left-column {
    width: 58%;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    -webkit-border-radius: 20px;
    padding: 22px 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
}

.right-column {
    width: 40%;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    -webkit-border-radius: 20px;
    padding: 22px 28px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.03);
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: space-between;
    -webkit-justify-content: space-between;
}

.panel-header {
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 12px;
    margin-bottom: 16px;
}

.panel-title {
    font-size: 20px;
    font-weight: 800;
    color: #0f172a;
}

.panel-sub {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

.article-list {
    flex: 1;
    display: flex;
    display: -webkit-flex;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: space-between;
    -webkit-justify-content: space-between;
}

.article-item {
    border: 1.5px solid #e2e8f0;
    border-radius: 14px;
    -webkit-border-radius: 14px;
    padding: 14px 18px;
    background-color: #f8fafc;
    transition: all 0.2s ease;
    -webkit-transition: all 0.2s ease;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
}

.item-badge {
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    padding: 4px 10px;
    border-radius: 6px;
    -webkit-border-radius: 6px;
    margin-right: 14px;
    flex-shrink: 0;
}

.badge-blue { background-color: #dbeafe; color: #1d4ed8; }
.badge-purple { background-color: #ede9fe; color: #6d28d9; }
.badge-emerald { background-color: #d1fae5; color: #047857; }

.item-body {
    flex: 1;
}

.item-title {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.item-summary {
    font-size: 13px;
    color: #64748b;
    margin-top: 2px;
}

/* Quick App Grid */
.quick-apps-grid {
    display: flex;
    display: -webkit-flex;
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    margin-bottom: 12px;
}

.quick-app-btn {
    width: 48.5%;
    background-color: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 14px;
    -webkit-border-radius: 14px;
    padding: 16px 20px;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    -webkit-transition: all 0.2s ease;
    cursor: pointer;
}

.app-text {
    flex: 1;
}

.app-name {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    display: block;
    line-height: 1.3;
}

.app-category {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
}

.app-action-arrow {
    font-size: 18px;
    font-weight: 700;
    color: #94a3b8;
    margin-left: 10px;
    transition: transform 0.2s ease, color 0.2s ease;
    -webkit-transition: -webkit-transform 0.2s ease, color 0.2s ease;
}

.quick-app-btn.active .app-action-arrow,
.quick-app-btn.focused .app-action-arrow {
    color: #2563eb;
    transform: translateX(4px);
    -webkit-transform: translateX(4px);
}

.theme-card {
    background: linear-gradient(135deg, #eff6ff, #f8fafc);
    border: 1.5px solid #dbeafe;
    border-radius: 16px;
    -webkit-border-radius: 16px;
    padding: 14px 20px;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
}

.theme-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e40af;
}

.theme-desc {
    font-size: 12px;
    color: #64748b;
}

.btn-accent {
    background-color: #2563eb;
    color: #ffffff;
    border: none;
    padding: 10px 18px;
    border-radius: 10px;
    -webkit-border-radius: 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

/* ==========================================================================
   MODE 2: PHOTO SHOWCASE VIEW (FULLSCREEN 4K SLIDESHOW)
   ========================================================================== */
.photo-view-wrap {
    display: none;
    width: 100%;
    height: 960px;
    position: relative;
    border-radius: 24px;
    -webkit-border-radius: 24px;
    overflow: hidden;
    background-color: #0f172a;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.photo-stage {
    width: 100%;
    height: 100%;
    position: relative;
}

.photo-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.8s ease-in-out;
    -webkit-transition: opacity 0.8s ease-in-out;
}

.photo-overlay-card {
    position: absolute;
    bottom: 30px;
    left: 40px;
    right: 40px;
    background: rgba(15, 23, 42, 0.82);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 20px;
    -webkit-border-radius: 20px;
    padding: 20px 32px;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.photo-badge {
    display: inline-block;
    background-color: #2563eb;
    color: #ffffff;
    font-size: 12px;
    font-weight: 800;
    padding: 5px 12px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    margin-bottom: 6px;
}

.photo-title {
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.photo-caption {
    font-size: 14px;
    color: #cbd5e1;
    margin-top: 4px;
}

.photo-meta {
    text-align: right;
    min-width: 150px;
}

.photo-counter-text {
    font-size: 18px;
    font-weight: 800;
    color: #38bdf8;
    margin-bottom: 8px;
}

.photo-progress-bar {
    width: 140px;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
    -webkit-border-radius: 999px;
    overflow: hidden;
}

.photo-progress-fill {
    width: 0%;
    height: 100%;
    background: #38bdf8;
    transition: width 0.2s linear;
    -webkit-transition: width 0.2s linear;
}

/* ==========================================================================
   MODE 3: PDF / DOCUMENT PRESENTATION VIEW
   ========================================================================== */
.pdf-view-wrap {
    display: none;
    width: 100%;
    height: 960px;
    background-color: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 24px;
    -webkit-border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.05);
    padding: 20px 28px;
    flex-direction: column;
    -webkit-flex-direction: column;
    justify-content: space-between;
    -webkit-justify-content: space-between;
}

.pdf-header {
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    padding-bottom: 14px;
    border-bottom: 2px solid #f1f5f9;
    margin-bottom: 14px;
}

.pdf-tag {
    background-color: #fef3c7;
    border: 1px solid #fde68a;
    color: #92400e;
    font-size: 12px;
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 6px;
    -webkit-border-radius: 6px;
    margin-right: 12px;
}

.pdf-doc-title {
    font-size: 22px;
    font-weight: 800;
    color: #0f172a;
    display: inline-block;
    vertical-align: middle;
}

.pdf-frame-box {
    flex: 1;
    width: 100%;
    border-radius: 16px;
    -webkit-border-radius: 16px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    background-color: #f8fafc;
}

#pdf-frame {
    width: 100%;
    height: 100%;
    border: none;
}

/* ==========================================================================
   MODE 4: SPLIT SCREEN KIOSK (50% LEFT / 50% RIGHT)
   ========================================================================== */
body.mode-split .dash-view-wrap {
    display: flex !important;
    display: -webkit-flex !important;
    width: 50%;
    height: 940px;
    padding-right: 18px;
    position: absolute;
    top: 24px;
    left: 36px;
}

body.mode-split .photo-view-wrap {
    display: block !important;
    width: 48%;
    height: 940px;
    position: absolute;
    top: 24px;
    right: 36px;
}

body.mode-split .metrics-row {
    flex-wrap: wrap;
    -webkit-flex-wrap: wrap;
}

body.mode-split .stat-card {
    width: 48.5%;
    margin-bottom: 10px;
}

body.mode-split .main-columns {
    flex-direction: column;
    -webkit-flex-direction: column;
}

body.mode-split .left-column {
    width: 100%;
    margin-bottom: 10px;
}

body.mode-split .right-column {
    display: none;
}

/* Active Mode Display Toggles */
body.mode-dashboard .dash-view-wrap { display: flex; display: -webkit-flex; }
body.mode-dashboard .photo-view-wrap { display: none; }
body.mode-dashboard .pdf-view-wrap { display: none; }

body.mode-photo .dash-view-wrap { display: none; }
body.mode-photo .photo-view-wrap { display: block; }
body.mode-photo .pdf-view-wrap { display: none; }

body.mode-pdf .dash-view-wrap { display: none; }
body.mode-pdf .photo-view-wrap { display: none; }
body.mode-pdf .pdf-view-wrap { display: flex; display: -webkit-flex; }

/* ==========================================================================
   FOOTER NAVIGATION BAR & AUTO-SYNC BADGE
   ========================================================================== */
.dash-footer {
    width: 100%;
    height: 52px;
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    border-top: 1.5px solid #e2e8f0;
    padding-top: 10px;
}

.remote-keys {
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
}

.key-tag {
    font-size: 13px;
    font-weight: 700;
    color: #475569;
    background-color: #ffffff;
    border: 1px solid #cbd5e1;
    padding: 6px 14px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    margin-right: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.kiosk-status-badge {
    background-color: rgba(15, 23, 42, 0.85);
    color: #ffffff;
    padding: 7px 16px;
    border-radius: 999px;
    -webkit-border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    display: -webkit-flex;
    align-items: center;
    -webkit-align-items: center;
}

.sync-dot {
    width: 8px;
    height: 8px;
    background-color: #10b981;
    border-radius: 50%;
    -webkit-border-radius: 50%;
    margin-right: 8px;
    display: inline-block;
}

.sync-dot.updating {
    background-color: #f59e0b;
    animation: dot-pulse 0.8s infinite;
    -webkit-animation: dot-pulse 0.8s infinite;
}

/* ==========================================================================
   FOCUS INDICATOR FOR TV REMOTE (2D SPATIAL NAVIGATION)
   ========================================================================== */
.focusable {
    outline: none;
    transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
    -webkit-transition: all 0.2s cubic-bezier(0.25, 1, 0.5, 1);
}

.focusable.focused {
    border-color: #2563eb !important;
    background-color: #eff6ff !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25), 0 8px 24px rgba(37, 99, 235, 0.2) !important;
    -webkit-transform: scale(1.02);
    transform: scale(1.02);
    z-index: 50;
}

/* Detail Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 1920px;
    height: 1080px;
    background-color: rgba(15, 23, 42, 0.7);
    display: none;
    justify-content: center;
    -webkit-justify-content: center;
    align-items: center;
    -webkit-align-items: center;
    z-index: 9999;
}

.modal-overlay.show {
    display: flex !important;
    display: -webkit-flex !important;
}

.white-modal-box {
    width: 1000px;
    background-color: #ffffff;
    border: 3px solid #2563eb;
    border-radius: 24px;
    -webkit-border-radius: 24px;
    padding: 36px 45px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
}

.modal-top {
    display: flex;
    display: -webkit-flex;
    justify-content: space-between;
    -webkit-justify-content: space-between;
    align-items: center;
    -webkit-align-items: center;
    margin-bottom: 20px;
}

.modal-badge {
    background-color: #dbeafe;
    color: #1e40af;
    font-size: 14px;
    font-weight: 800;
    padding: 6px 14px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
}

.modal-btn-close {
    background-color: #f1f5f9;
    border: 2px solid #cbd5e1;
    color: #0f172a;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 20px;
    border-radius: 12px;
    -webkit-border-radius: 12px;
    cursor: pointer;
}

.modal-heading {
    font-size: 32px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 14px;
}

.modal-text {
    font-size: 18px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 24px;
}

.modal-bottom {
    border-top: 2px solid #f1f5f9;
    padding-top: 16px;
    font-size: 14px;
    color: #64748b;
}
