/* CINEWAVE ACADEMIC / MINIMALIST STYLING (COMMUTATIVE.SPACE AESTHETIC) */

body {
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.6;
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: #ffffff;
    color: #222222;
}

/* Links */
a, .link-bar a, .nav-link {
    color: #0000ee;
    text-decoration: underline;
    cursor: pointer;
}

a:visited {
    color: #551a8b;
}

a:hover, .nav-link:hover {
    text-decoration: none;
}

/* Navigation & Header */
header {
    border-bottom: 2px solid #dddddd;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.logo-text {
    font-size: 28px;
    font-weight: bold;
    color: #111111;
}

nav {
    margin-top: 10px;
}

.nav-link {
    margin-right: 15px;
    font-weight: bold;
    text-decoration: none;
}

.nav-link.active {
    color: #222222;
    text-decoration: underline;
    pointer-events: none;
}

.header-actions {
    margin-top: 15px;
}

/* Page Layout */
main {
    margin-bottom: 45px;
}

h2 {
    font-size: 20px;
    font-weight: bold;
    border-bottom: 1px solid #cccccc;
    padding-bottom: 5px;
    margin-top: 30px;
    margin-bottom: 15px;
}

h3 {
    font-size: 18px;
    border-bottom: 1px solid #dddddd;
    padding-bottom: 5px;
    margin-top: 20px;
    margin-bottom: 10px;
}

p {
    margin-bottom: 15px;
}

.hidden {
    display: none !important;
}

/* Category rows & Carousels */
.category-row {
    margin-bottom: 25px;
}

.movie-carousel {
    display: flex;
    gap: 15px;
    overflow-x: auto;
    padding-bottom: 10px;
}

/* Movie Cards */
.movie-card {
    flex: 0 0 120px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1.3;
}

.movie-poster-container {
    position: relative;
    width: 120px;
    height: 180px;
    background-color: #f0f0f0;
    border: 1px solid #cccccc;
    overflow: hidden;
    margin-bottom: 5px;
}

.movie-poster {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-rating-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ccc;
    font-size: 9px;
    font-weight: bold;
    padding: 1px 4px;
}

.movie-title {
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: #0000ee;
    text-decoration: underline;
}

.movie-card:hover .movie-title {
    text-decoration: none;
}

.movie-meta {
    color: #666666;
    font-size: 11px;
}

/* Grids */
.movie-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

/* Server Gates list styling */
.server-item {
    border: 1px solid #cccccc;
    padding: 8px 12px;
    background: #fcfcfc;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    font-size: 13px;
}

.server-item:hover {
    background: #f0f0f0;
    border-color: #888888;
}

.server-item.active {
    background: #e6f2ff;
    border-color: #0000ee;
    font-weight: bold;
}

.server-latency {
    font-size: 11px;
    font-weight: bold;
}

.latency-good { color: #008000; }
.latency-fair { color: #b8860b; }
.latency-poor { color: #ff0000; }

/* Modal Box */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content-wrapper {
    background: #ffffff;
    border: 2px solid #444444;
    width: 620px;
    max-width: 95%;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.modal-header {
    background: #f3f3f3;
    border-bottom: 1px solid #cccccc;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    border: none;
    font-size: 16px;
    padding: 0;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 22px;
    cursor: pointer;
    font-weight: bold;
    color: #666666;
}

.modal-close-btn:hover {
    color: #000;
}

.modal-body {
    padding: 15px;
}

.movie-details-modal {
    display: flex;
    gap: 20px;
}

.details-poster {
    width: 140px;
    height: 210px;
    object-fit: cover;
    border: 1px solid #cccccc;
}

.details-info {
    flex-grow: 1;
}

.details-info h2 {
    margin-top: 0;
    font-size: 20px;
    border: none;
    padding: 0;
    margin-bottom: 8px;
}

.details-meta-list {
    font-size: 12px;
    color: #555555;
    margin-bottom: 12px;
}

.details-meta-item {
    margin-bottom: 3px;
}

.details-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.details-actions button, button {
    padding: 5px 10px;
    font-size: 13px;
    cursor: pointer;
}

/* Indicators */
.loading-indicator, .status-msg {
    grid-column: 1 / -1;
    width: 100%;
    padding: 20px;
    border: 1px dashed #cccccc;
    background: #fafafa;
    color: #555555;
    font-style: italic;
    text-align: center;
}

/* Footer style */
footer {
    border-top: 2px solid #dddddd;
    padding-top: 15px;
    margin-top: 40px;
    color: #666666;
    font-size: 12px;
    text-align: center;
}

/* Responsive */
@media (max-width: 768px) {
    .movie-details-modal {
        flex-direction: column;
        align-items: center;
    }
    .theater-main {
        flex-direction: column;
    }
    .theater-control-panel {
        width: 100% !important;
        height: auto !important;
        border-left: none !important;
        border-top: 1px solid #262626;
    }
}

/* Spinner Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Theater Mode Styles */
#sec-watch {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #0a0a0a;
    z-index: 9999;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.theater-top-bar {
    height: 50px;
    background: #141414;
    border-bottom: 1px solid #262626;
    display: flex;
    align-items: center;
    padding: 0 20px;
    gap: 20px;
}

.theater-back-btn {
    background: #262626;
    color: #ffffff;
    border: 1px solid #3c3c3c;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    font-size: 13px;
    transition: background 0.2s;
}

.theater-back-btn:hover {
    background: #3c3c3c;
}

.theater-title-info {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
}

.theater-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.theater-player-container {
    flex: 1;
    background: #000000;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
}

.theater-player-container .player-screen {
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.theater-control-panel {
    width: 320px;
    background: #141414;
    border-left: 1px solid #262626;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.panel-section {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border-bottom: 1px solid #262626;
    padding-bottom: 15px;
}

.panel-section strong {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #888888;
}

.panel-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

#server-grid-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 250px;
    overflow-y: auto;
}

/* Override existing server-item inside theater mode */
#sec-watch .server-item {
    background: #202020;
    border: 1px solid #333;
    color: #eee;
    padding: 10px 12px;
    border-radius: 4px;
}

#sec-watch .server-item:hover {
    background: #2b2b2b;
    border-color: #444;
}

#sec-watch .server-item.active {
    background: #0000ee;
    border-color: #0000ee;
    color: #fff;
}

#player-diagnostics {
    background: #000000;
    border: 1px solid #222;
    color: #00ff00;
    font-family: monospace;
    font-size: 11px;
    padding: 10px;
    max-height: 150px;
    overflow-y: auto;
    white-space: pre-wrap;
    border-radius: 4px;
}
