/* ==========================================================================
   İMAJ KUAFÖR - Canlı TV Sıra Takip Sistemi (Version 2)
   Premium Koyu Tema & Altın Detayları - %100 Akıcı & Modüler Ölçeklenebilir Tasarım
   Tüm Ekran Çözünürlükleri (720p, 1080p, 4K) ve Çerçeve Oranları ile Uyumlu
   Mobil Cihazlar İçin Otomatik Sağ Panel Gizleme Desteği
   ========================================================================== */

/* Root ve Akıcı Tipografi Sistemi */
html.tv-root {
    font-size: clamp(10px, 0.95vw, 20px); /* Ekran genişliğine göre tüm arayüzü ölçekler */
}

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html, body {
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: #080a0f;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #e2e8f0;
}

/* Scrollbar styling for queue list */
::-webkit-scrollbar {
    width: 0.4rem;
}
::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.01);
}
::-webkit-scrollbar-thumb {
    background: rgba(212, 160, 41, 0.15);
    border-radius: 0.2rem;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 160, 41, 0.35);
}

/* Fluid TV Container */
.tv-container {
    width: 100vw;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: radial-gradient(circle at 30% 20%, #111622 0%, #080a0f 70%);
}

/* Main Display Area (Split 40/60) */
.tv-main {
    flex: 1;
    display: flex;
    height: calc(100vh - 60px); /* Total minus announcement bar height */
    overflow: hidden;
}

/* Left Pane: Queue, Barbers & Stats (40% width) */
.tv-left-pane {
    width: 40%;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    border-right: 1px solid rgba(212, 160, 41, 0.15);
    background: rgba(10, 14, 23, 0.95); /* removed blur for performance */
    overflow: hidden;
    gap: 1.2rem;
}

/* Right Pane: Browser & Stream (60% width) */
.tv-right-pane {
    width: 60%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background-color: #030406;
}

/* ==========================================================================
   LEFT PANE COMPONENTS
   ========================================================================== */

/* Clock & Date Header */
.tv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1rem 1.5rem;
}

.digital-clock {
    font-family: 'Outfit', sans-serif;
    font-size: 3rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -1px;
    text-shadow: 0 0 15px rgba(212, 160, 41, 0.35);
    line-height: 1;
}

.date-box {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    font-family: 'Inter', sans-serif;
}

.date-icon {
    display: none;
}

.date-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: #d4a029;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.date-day {
    font-size: 0.85rem;
    font-weight: 500;
    color: #94a3b8;
    margin-top: 0.2rem;
}

/* Stats Row */
.tv-stats-row {
    display: flex;
    gap: 1rem;
}

.stat-card {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 1rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04) 0%, rgba(255, 255, 255, 0.01) 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1rem;
    padding: 1rem 1.2rem;
    box-shadow: none; /* removed shadow for performance */
}

.stat-icon {
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3.5rem;
    height: 3.5rem;
    background: rgba(212, 160, 41, 0.1);
    border: 1px solid rgba(212, 160, 41, 0.2);
    border-radius: 0.8rem;
    color: #d4a029;
    flex-shrink: 0;
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-info strong {
    font-family: 'Outfit', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 0.25rem;
    line-height: 1;
}

/* Section Title */
.section-title {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 0.8rem;
}

.title-icon {
    font-size: 1.5rem;
    color: #d4a029;
}

.section-title h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    color: #ffffff;
    text-transform: uppercase;
}

.section-title h3 em {
    font-style: normal;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 600;
    margin-left: 0.4rem;
}

/* Barber Durumları Grid */
.tv-barbers-container {
    display: flex;
    flex-direction: column;
}

.barbers-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.barber-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 1rem;
    padding: 1rem 1.2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 7.5rem;
    box-shadow: none; /* removed shadow for performance */
    position: relative;
    overflow: hidden;
}

.barber-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.barber-name {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
}

.barber-status {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.2rem 0.6rem;
    border-radius: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.barber-status.active {
    background: rgba(212, 160, 41, 0.15);
    color: #d4a029;
    border: 1px solid rgba(212, 160, 41, 0.2);
}

.barber-status.idle {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.barber-customer {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.barber-wait {
    font-size: 0.8rem;
    color: #94a3b8;
}

.barber-wait strong {
    color: #e2e8f0;
}

/* Queue List Container */
.tv-queue-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.queue-table {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 1rem;
    overflow: hidden;
}

/* Table Head */
.queue-thead {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 2px solid rgba(255, 255, 255, 0.06);
    padding: 0.9rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #d4a029;
    letter-spacing: 0.5px;
}

/* Column Width Distributions */
.col-pos { width: 3.5rem; text-align: center; }
.col-time { width: 5.5rem; text-align: center; }
.col-name { flex: 1; padding-left: 1.2rem; text-align: left; }
.col-barber { width: 9.5rem; text-align: center; }
.col-status { width: 7.5rem; text-align: center; }

/* Table Body Scroll Area */
.queue-tbody {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.empty-queue {
    padding: 2.5rem;
    text-align: center;
    color: #64748b;
    font-size: 1rem;
    font-weight: 500;
    font-style: italic;
}

.queue-separator {
    text-align: center;
    padding: 0.6rem;
    margin: 0.5rem 1.2rem;
    background: rgba(255, 255, 255, 0.02);
    border-top: 1px dashed rgba(212, 160, 41, 0.3);
    border-bottom: 1px dashed rgba(212, 160, 41, 0.3);
    color: #d4a029;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-radius: 4px;
}

/* Individual Queue Row */
.queue-row {
    display: flex;
    align-items: center;
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 1rem;
    transition: all 0.2s ease;
    background: rgba(255, 255, 255, 0.005);
}

.queue-row:last-child {
    border-bottom: none;
}

.queue-row.active-row {
    background: linear-gradient(90deg, rgba(212, 160, 41, 0.12) 0%, rgba(212, 160, 41, 0.02) 100%);
    border-left: 4px solid #d4a029;
}

/* Badges inside table */
.pos-badge {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    line-height: 1.9rem;
    text-align: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-weight: 700;
    color: #ffffff;
    font-size: 0.9rem;
}

.active-row .pos-badge {
    background: #d4a029;
    border-color: #d4a029;
    color: #000000;
}

.col-name strong {
    font-weight: 600;
    color: #ffffff;
}

.barber-badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    border-radius: 1.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    max-width: 8rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status-badge {
    display: inline-block;
    padding: 0.25rem 0.8rem;
    border-radius: 0.4rem;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-badge.active {
    background: rgba(212, 160, 41, 0.15);
    color: #d4a029;
    border: 1px solid rgba(212, 160, 41, 0.25);
}

.status-badge.waiting {
    background: rgba(148, 163, 184, 0.1);
    color: #94a3b8;
    border: 1px solid rgba(148, 163, 184, 0.2);
}


/* ==========================================================================
   RIGHT PANE COMPONENTS (BROWSER)
   ========================================================================== */

/* Address & Control Bar */
.browser-control-bar {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    background-color: #0b0f17;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 1rem;
}

.btn-home {
    width: 3rem;
    height: 3rem;
    border-radius: 0.8rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 1.3rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.btn-home:hover {
    background: rgba(212, 160, 41, 0.1);
    border-color: rgba(212, 160, 41, 0.3);
}

.url-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 0.8rem;
    padding: 0 1rem;
    height: 3rem;
}

.url-protocol {
    color: rgba(255, 255, 255, 0.25);
    font-size: 1rem;
    font-weight: 600;
    user-select: none;
    margin-right: 0.25rem;
}

.url-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #ffffff;
    font-size: 1rem;
    font-weight: 500;
    height: 100%;
}

.url-input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.btn-go {
    height: 3rem;
    padding: 0 1.5rem;
    background: linear-gradient(135deg, #d4a029 0%, #b87912 100%);
    border: none;
    border-radius: 0.8rem;
    color: #000000;
    font-weight: 800;
    font-size: 1rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(212, 160, 41, 0.3);
    flex-shrink: 0;
}

.btn-go:hover {
    box-shadow: 0 6px 20px rgba(212, 160, 41, 0.45);
}

/* Quick Access Shortcuts */
.quick-access-bar {
    display: flex;
    align-items: center;
    padding: 0.6rem 1.5rem;
    background-color: #080b11;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    gap: 0.8rem;
    overflow-x: auto;
}

.quick-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 1.25rem;
    color: #cbd5e1;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.quick-btn:hover {
    background: rgba(212, 160, 41, 0.1);
    border-color: rgba(212, 160, 41, 0.3);
    color: #ffffff;
}

/* Iframe Container & Window */
.browser-frame-container {
    flex: 1;
    position: relative;
    background-color: #000000;
    overflow: hidden;
}

.browser-frame-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: #000000;
}


/* ==========================================================================
   ANNOUNCEMENT BAR (BOTTOM RUNNING TEXT)
   ========================================================================== */

.tv-announcement {
    height: 60px;
    background-color: #000000;
    border-top: 2px solid #d4a029;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 100;
    box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.5);
}

.announcement-title {
    background: linear-gradient(135deg, #d4a029 0%, #b87912 100%);
    color: #000000;
    font-family: 'Outfit', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    letter-spacing: 1px;
    height: 100%;
    padding: 0 1.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    box-shadow: 10px 0 20px rgba(0, 0, 0, 0.5);
    white-space: nowrap;
}

.announcement-marquee-container {
    flex: 1;
    overflow: hidden;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.announcement-marquee-container::before,
.announcement-marquee-container::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 2;
    pointer-events: none;
}

.announcement-marquee-container::before {
    left: 0;
    background: linear-gradient(to right, #000000, transparent);
}

.announcement-marquee-container::after {
    right: 0;
    background: linear-gradient(to left, #000000, transparent);
}

.announcement-marquee {
    display: inline-block;
    white-space: nowrap;
    position: absolute;
    left: 100%;
    padding-left: 20px;
    will-change: transform;
    animation: tv-marquee-left 25s linear infinite;
}

.announcement-marquee span {
    font-size: 1.25rem;
    font-weight: 700;
    color: #e2e8f0;
    letter-spacing: 0.5px;
}

/* Animations */
@keyframes tv-marquee-left {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-100%, 0, 0);
        left: 0;
    }
}


/* ==========================================================================
   RESPONSIVE DESIGN (MOBIL & TABLET UYUMLULUK)
   ========================================================================== */

/* 1024px ve altı ekranlar: Mobil, Tablet veya Dikey TV ekranları */
@media (max-width: 1024px) {
    html.tv-root {
        font-size: 14px; /* Mobil ekranlar için ideal baz boyut */
    }

    .tv-main {
        flex-direction: column;
        height: auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* Sol panel tüm genişliği kaplar */
    .tv-left-pane {
        width: 100% !important;
        height: auto !important;
        border-right: none;
        border-bottom: 1px solid rgba(212, 160, 41, 0.15);
        overflow: visible;
        padding: 1.2rem;
    }

    /* Sağ tarayıcı paneli mobilde tamamen gizlenir */
    .tv-right-pane {
        display: none !important;
    }

    .tv-stats-row {
        flex-wrap: wrap;
    }

    .stat-card {
        flex: 1 1 45%;
    }

    .barbers-grid {
        grid-template-columns: 1fr; /* Mobilde berberler alt alta listelenir */
    }

    .queue-table {
        overflow-x: auto;
        border-radius: 0.8rem;
    }

    .queue-thead, .queue-row {
        min-width: 500px; /* Yatay kaydırma için min-width */
    }
}

/* 480px altı (Küçük telefonlar) */
@media (max-width: 480px) {
    html.tv-root {
        font-size: 12px;
    }

    .tv-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 0.5rem;
    }

    .date-box {
        align-items: center;
    }

    .stat-card {
        flex: 1 1 100%;
    }
}
