/* ====================================================================
   Reset and Base Styles
   =================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #f4f6f9;
    color: #333;
    line-height: 1.6;
}

/* ====================================================================
   Top Dark Header
   =================================================================== */
.top-header {
    background-color: #1a2233;
    color: #fff;
    padding: 12px 24px;
    width: 100%;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.nav-links, .nav-right {
    display: flex;
    align-items: center;
    gap: 24px;
}

.top-header a {
    color: #cbd5e1;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.top-header a:hover, 
.top-header a.active {
    color: #ffffff;
}

/* Search Bar in Header */
.search-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 4px;
    padding: 2px 4px 2px 10px;
}

.search-box input {
    border: none;
    outline: none;
    font-size: 13px;
    padding: 4px;
    background: transparent;
    width: 130px;
}

.search-box button {
    background: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    padding: 4px;
}

/* ====================================================================
   Banner / Logo Section
   =================================================================== */
.banner-section {
    background-color: #ffffff;
    padding: 30px 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border-bottom: 1px solid #e2e8f0;
}

.banner-container {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-banner-img {
    width: 100%;
    max-width: 900px;
    height: auto;
    display: block;
}

/* ====================================================================
   Main Content Area & Tables
   =================================================================== */
.main-content {
    padding: 60px 20px;
    min-height: 400px;
}

.content-container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.content-container h2 {
    margin-bottom: 15px;
    color: #0f172a;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 20px;
}

.streamer-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 14px;
    white-space: nowrap;
    background: #ffffff;
    border-radius: 6px;
    overflow: hidden;
}

.streamer-table td.wrap-text {
    white-space: normal;
    word-break: break-word;
    max-width: 250px; /* Adjust this width as needed */
}

.streamer-table th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    padding: 12px 16px;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    font-size: 12px;
    letter-spacing: 0.05em;
}

.streamer-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f1f5f9;
    color: #333333;
}

.streamer-table tr:hover {
    background-color: #f8fafc;
}

/* ====================================================================
   Badge & State Styles
   =================================================================== */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-public {
    background-color: #dcfce7;
    color: #166534;
}

.badge-offline {
    background-color: #f1f5f9;
    color: #64748b;
}

.empty-state {
    padding: 30px;
    text-align: center;
    color: #64748b;
}

/* Standalone Table Thumbnail Image */
.streamer-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #e2e8f0;
    display: block;
}

/* Table Thumbnail Container with Badge Support */
.table-thumb-wrap {
    position: relative;
    width: 150px;
    height: 100px;
    display: inline-block;
    border-radius: 4px;
    overflow: hidden;
    background-color: #e2e8f0;
}

.table-thumb-wrap .streamer-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.streamer-link {
    color: #2c5dd0;
    text-decoration: none;
    font-weight: 600;
}

.streamer-link:hover {
    color: #2563eb;
    text-decoration: underline;
}

.truncate-text {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ====================================================================
   Grid View Layout & Cards
   =================================================================== */
.streamer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.streamer-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: column;
}

.streamer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Grid Card Image Wrapper */
.streamer-card-img-wrap {
    position: relative;
    width: 100%;
    height: 140px;
    background-color: #e2e8f0;
    overflow: hidden;
}

.streamer-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Floating Status Overlay Badge */
.status-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.status-badge.badge-public {
    background-color: #166534;
    color: #dcfce7;
}

.status-badge.badge-offline {
    background-color: #334155;
    color: #f1f5f9;
}

.streamer-card-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.streamer-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #0f172a;
    text-decoration: none;
}

.streamer-card-title:hover {
    color: #2563eb;
    text-decoration: underline;
}

.streamer-card-meta {
    font-size: 13px;
    color: #64748b;
    display: flex;
    justify-content: space-between;
}

/* ====================================================================
   View Toggle Controls
   =================================================================== */
.view-toggle-bar {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-bottom: 15px;
}

.view-btn {
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    color: #475569;
}

.view-btn.active {
    background: #0f172a;
    color: #ffffff;
    border-color: #0f172a;
}

.live-directory .directory-filter-panel {
    margin-bottom: 22px;
    padding: 18px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.live-directory .directory-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    align-items: end;
}

.live-directory .directory-filter-grid label {
    display: block;
    margin-bottom: 6px;
    color: #475569;
    font-size: 13px;
    font-weight: 600;
}

.live-directory .directory-filter-grid select,
.live-directory .directory-filter-grid input {
    width: 100%;
    min-height: 40px;
    padding: 8px 10px;
    color: #0f172a;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.live-directory .directory-filter-grid select:focus,
.live-directory .directory-filter-grid input:focus {
    border-color: #2c5dd0;
    outline: none;
    box-shadow: 0 0 0 3px rgba(44, 93, 208, 0.15);
}

.live-directory .filter-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: end;
}

.live-directory .filter-actions button,
.live-directory .filter-actions a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 9px 14px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    border-radius: 4px;
    cursor: pointer;
}

.live-directory .filter-actions button {
    color: #ffffff;
    background: #0f172a;
    border: 1px solid #0f172a;
}

.live-directory .filter-actions button:hover,
.live-directory .filter-actions button:focus {
    color: #ffffff;
    background: #1e293b;
    border-color: #1e293b;
}

.live-directory .filter-actions a {
    color: #475569;
    background: #ffffff;
    border: 1px solid #cbd5e1;
}

.live-directory .filter-actions a:hover,
.live-directory .filter-actions a:focus {
    color: #0f172a;
    background: #f8fafc;
    border-color: #94a3b8;
    text-decoration: none;
}

/* Live listing totals: matching, online, offline, and HD. */
.live-directory .directory-counts {
    display: grid;
    grid-template-columns: repeat(4, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 22px;
}

.live-directory .directory-count {
    padding: 15px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.live-directory .directory-count strong {
    display: block;
    margin-bottom: 3px;
    color: #0f172a;
    font-size: 24px;
    line-height: 1;
}

.live-directory .directory-count span {
    color: #64748b;
    font-size: 13px;
}

.live-directory .filter-summary {
    margin: 0 0 18px;
    color: #475569;
}

/* Server-side result pagination. */
.live-directory .pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 28px 0 10px;
}

.live-directory .pagination a,
.live-directory .pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    min-height: 36px;
    padding: 8px 10px;
    color: #475569;
    font-size: 14px;
    text-align: center;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
}

.live-directory .pagination a:hover,
.live-directory .pagination a:focus {
    color: #ffffff;
    background: #0f172a;
    border-color: #0f172a;
    text-decoration: none;
}

.live-directory .pagination .active-page {
    color: #ffffff;
    background: #0f172a;
    border-color: #0f172a;
}

/* Informational block below results. */
.live-directory .directory-methodology {
    margin-top: 32px;
    padding: 20px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

.live-directory .directory-methodology h2 {
    margin-bottom: 10px;
    color: #0f172a;
    font-size: 1.35rem;
}

.live-directory .directory-methodology p:last-child {
    margin-bottom: 0;
}

.live-directory .filter-actions {
    grid-column: 1 / -1;
    justify-content: flex-end;
    align-items: center;
}

/* ====================================================================
   Site Footer
   =================================================================== */
.site-footer {
    background-color: #0f172a;
    color: #94a3b8;
    text-align: center;
    padding: 30px 20px;
    font-size: 14px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
}