/* ARES TV Client Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --background-color: #000;
    --text-color: #ecfdf5;
    /* Soft sage white for readability */
    --text-muted: #a3b8a3;
    /* Muted reading green */
    --accent-color: #51cf66;
    --font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--background-color);
    color: var(--text-color);
    overflow: hidden;
    width: 100vw;
    height: 100vh;
}

/* Registration Screen */
.registration-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.registration-box {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 60px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.registration-box h1 {
    font-size: 48px;
    margin-bottom: 20px;
    color: #fff;
}

.registration-box p {
    font-size: 24px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.registration-box input {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    margin-bottom: 20px;
    text-align: center;
}

.registration-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.registration-box input:focus {
    outline: none;
    border-color: #fff;
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.2);
}

.registration-box input:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.registration-box button {
    width: 100%;
    padding: 20px;
    font-size: 24px;
    background: #fff;
    color: var(--primary-color);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 60px;
}

.registration-box button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.3);
}

.registration-box button:active:not(:disabled) {
    transform: scale(0.98);
}

.registration-box button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.button-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.help-text {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}

.help-text p {
    margin: 0;
    font-size: 12px;
}


.registration-box .error {
    color: #ff6b6b;
    font-size: 18px;
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(255, 107, 107, 0.15);
    border: 2px solid rgba(255, 107, 107, 0.3);
    border-radius: 10px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.registration-box .error.show {
    display: block;
}

.registration-box .status {
    color: #51cf66;
    font-size: 18px;
    margin-top: 20px;
    padding: 15px 20px;
    background: rgba(81, 207, 102, 0.15);
    border: 2px solid rgba(81, 207, 102, 0.3);
    border-radius: 10px;
    display: none;
    animation: slideIn 0.3s ease-out;
}

.registration-box .status.show {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Player Screen */
.player-screen {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

#content-container {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

/* Status Bar */
.status-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 40px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    font-size: 12px;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
}


.status-bar.show {
    opacity: 1;
}

.status-bar .device-info {
    display: flex;
    gap: 30px;
    color: rgba(255, 255, 255, 0.8);
}

.status-bar .device-info span {
    font-weight: 500;
}

.status-bar .device-info span span {
    font-weight: 400;
    opacity: 0.7;
    font-family: 'Courier New', monospace;
}

.status-bar .connection-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

/* Persistent P2P Ticker (Bottom Bar) */
.p2p-ticker-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 32px;
    background: rgba(0, 0, 0, 0.9);
    /* Darker for constant visibility */
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding: 0 40px;
    z-index: 1050;
    /* Higher than all other overlays */
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 0.5px;
    pointer-events: none;
    transition: all 0.5s ease;
}

.p2p-ticker-bar.show {
    display: flex !important;
}

.p2p-ticker-content {
    display: flex;
    align-items: center;
    gap: 15px;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
}

.p2p-ticker-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.ticker-label {
    color: rgba(255, 255, 255, 0.4);
    text-transform: uppercase;
    font-size: 9px;
    letter-spacing: 0.5px;
}

.ticker-value {
    color: #2ecc71;
    /* Brighter green for visibility */
    font-weight: bold;
}

.ticker-divider {
    color: rgba(255, 255, 255, 0.1);
    font-weight: 300;
    margin: 0 10px;
}

.p2p-mesh-visual {
    margin-left: 15px;
    height: 20px;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    padding: 0 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.p2p-mesh-visual canvas {
    filter: drop-shadow(0 0 5px rgba(46, 204, 113, 0.3));
}

/* Mesh Badge Persistent */
.mesh-badge {
    position: absolute;
    top: 20px;
    right: 30px;
    height: 36px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 18px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 10px;
    z-index: 950;
    pointer-events: none;
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #fff;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}

.mesh-badge.show {
    opacity: 1;
    transform: translateY(0);
}

.mesh-badge .mesh-icon {
    font-size: 16px;
    margin-right: -2px;
    animation: meshRotate 10s linear infinite;
}

.mesh-badge .mesh-label {
    font-size: 9px;
    font-weight: 900;
    color: rgba(255, 255, 255, 0.4);
    letter-spacing: 1px;
    text-transform: uppercase;
}

.mesh-badge .mesh-divider {
    width: 1px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
}

.mesh-badge .mesh-dot {
    width: 4px;
    height: 4px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 8px var(--accent-color);
}

.mesh-badge .mesh-small {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 600;
}

.mesh-badge #meshBadgePercent {
    color: var(--accent-color);
    font-weight: 700;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.mesh-badge #meshBadgePeers {
    font-weight: 700;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

@keyframes meshRotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}


.status-bar .connection-status .indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #f00;
    box-shadow: 0 0 8px rgba(255, 0, 0, 0.5);
    animation: pulse 2s infinite;
}

.status-bar .connection-status.connected .indicator {
    background: var(--accent-color);
    box-shadow: 0 0 8px rgba(81, 207, 102, 0.5);
    animation: pulseGreen 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

@keyframes pulseGreen {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.1);
    }
}

/* Loading Spinner */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #000;
    color: #fff;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-top-color: var(--primary-color, #667eea);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Premium Loading Animation (Combo 1 & 2) */
.premium-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #000;
}

.premium-logo-wrapper {
    position: relative;
    width: 200px;
    height: 200px;
    border-radius: 40px;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 4s ease-in-out infinite;
    box-shadow: 0 0 30px rgba(0, 242, 255, 0.05);
}

.premium-logo-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: neonPulse 2.5s ease-in-out infinite;
}

.glass-shimmer {
    position: absolute;
    top: -50%;
    left: -150%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 45%,
            rgba(255, 255, 255, 0.1) 48%,
            rgba(255, 255, 255, 0.3) 50%,
            rgba(255, 255, 255, 0.1) 52%,
            transparent 55%);
    animation: shimmerSweep 3.5s infinite;
    pointer-events: none;
}

@keyframes neonPulse {

    0%,
    100% {
        filter: drop-shadow(0 0 5px #00f2ff) brightness(1);
    }

    50% {
        filter: drop-shadow(0 0 20px #00f2ff) brightness(1.2);
    }
}

@keyframes shimmerSweep {
    0% {
        transform: translateX(0);
    }

    100% {
        transform: translateX(100%);
    }
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

.premium-loading-text {
    margin-top: 25px;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 3px;
    font-size: 14px;
    font-weight: 300;
    text-transform: uppercase;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes textPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 1;
    }
}

/* Fullscreen support */
:fullscreen {
    width: 100vw;
    height: 100vh;
}

:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
}

:-moz-full-screen {
    width: 100vw;
    height: 100vh;
}

:-ms-fullscreen {
    width: 100vw;
    height: 100vh;
}

/* Buffering Overlay */
.buffering-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 900;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.buffering-overlay.show {
    opacity: 1;
}

.buffering-overlay .spinner {
    width: 80px;
    height: 80px;
    border-width: 6px;
}

/* Info Overlay (Top) */
.info-overlay {
    position: absolute;
    top: 50px;
    /* Below status bar */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    padding: 15px 30px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 15px;
    z-index: 800;
    opacity: 0;
    transition: opacity 0.5s ease, transform 0.5s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.info-overlay.show {
    opacity: 1;
    transform: translateX(-50%) translateY(20px);
}

.info-overlay .live-badge {
    background: #ff0000;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
    font-size: 14px;
    letter-spacing: 1px;
    animation: pulseRed 2s infinite;
}

.info-overlay .title {
    font-size: 24px;
    font-weight: 600;
    color: #fff;
}

.info-overlay .subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.7);
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    padding-left: 15px;
}

@keyframes pulseRed {
    0% {
        background: #ff0000;
    }

    50% {
        background: #aa0000;
    }

    100% {
        background: #ff0000;
    }
}

/* Toast Notification (Bottom) */
.toast-notification {
    position: absolute;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(30, 30, 30, 0.95);
    color: #fff;
    padding: 20px 40px;
    border-radius: 12px;
    font-size: 24px;
    font-weight: 500;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 1000;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 6px solid var(--primary-color);
}

.toast-notification.show {
    opacity: 1;
    transform: translateX(-50%) translateY(-20px);
}

/* Error Overlay (Fullscreen) */
.error-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    text-align: center;
}

.error-overlay h1 {
    font-size: 32px;
    margin-bottom: 20px;
    color: #ff6b6b;
}

.error-overlay p {
    font-size: 20px;
    color: rgba(255, 255, 255, 0.7);
    max-width: 600px;
    line-height: 1.5;
}

.error-overlay button {
    margin-top: 40px;
    padding: 15px 30px;
    font-size: 20px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}

.error-overlay button:hover {
    background: #444;
}

/* Green Score Ecological Dashboard (Quanteec style) */
.green-score-overlay {
    position: absolute;
    top: 80px;
    left: 30px;
    width: 220px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 15px;
    z-index: 1000;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.green-score-overlay.show {
    opacity: 1;
    transform: translateX(0);
}

.green-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.green-icon {
    font-size: 18px;
    filter: drop-shadow(0 0 5px #2ecc71);
}

.green-title {
    font-size: 11px;
    font-weight: 900;
    color: #fff;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.green-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.green-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.green-label {
    font-size: 9px;
    color: rgba(255, 255, 255, 0.4);
    font-weight: 700;
    letter-spacing: 0.5px;
}

.green-value {
    font-size: 14px;
    font-weight: 700;
    color: #2ecc71;
    font-variant-numeric: tabular-nums;
}

.green-progress-container {
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}

/* P2P Warning Toast */
.p2p-warning-toast {
    position: absolute;
    bottom: 45px;
    left: 40px;
    background: rgba(231, 76, 60, 0.9);
    color: white;
    padding: 8px 15px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    z-index: 2000;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease;
    pointer-events: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.p2p-warning-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.green-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2ecc71, #27ae60);
    box-shadow: 0 0 10px rgba(46, 204, 113, 0.4);
    transition: width 0.5s ease-out;
}