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

body {
    font-family: 'Courier New', monospace;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: #fff;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

.tv-container {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 30px;
    align-items: start;
}

/* TV Frame */
.tv-frame {
    background: linear-gradient(145deg, #2a2a2a, #1a1a1a);
    border-radius: 30px;
    padding: 40px;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.8),
        inset 0 0 20px rgba(0, 0, 0, 0.5);
    position: relative;
}

.tv-frame::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    bottom: 20px;
    border: 3px solid #444;
    border-radius: 25px;
    pointer-events: none;
}

/* TV Screen */
.tv-screen {
    background: #000;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/3;
    box-shadow: 
        inset 0 0 50px rgba(0, 100, 255, 0.2),
        0 0 30px rgba(0, 0, 0, 0.9);
}

.screen-content {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Video Player */
.player-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #000;
}

/* No Signal Screen */
.no-signal {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 10;
}

.no-signal.active {
    display: flex;
}

.static {
    position: absolute;
    width: 100%;
    height: 100%;
    background-image: 
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(255, 255, 255, 0.03) 2px, rgba(255, 255, 255, 0.03) 4px);
    animation: static 0.2s infinite;
    opacity: 0.3;
}

@keyframes static {
    0% { transform: translateY(0); }
    100% { transform: translateY(-10px); }
}

.no-signal-text {
    font-size: 48px;
    font-weight: bold;
    color: #888;
    text-shadow: 0 0 20px rgba(136, 136, 136, 0.5);
    z-index: 1;
    letter-spacing: 8px;
}

.channel-info {
    font-size: 18px;
    color: #666;
    margin-top: 20px;
    z-index: 1;
}

/* Scanlines Effect */
.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.15),
        rgba(0, 0, 0, 0.15) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 100;
}

/* Channel Overlay */
.channel-overlay {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 15px 25px;
    border-radius: 8px;
    border: 2px solid #00ff00;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 50;
    font-family: 'Courier New', monospace;
}

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

.channel-number {
    font-size: 36px;
    font-weight: bold;
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
}

.channel-name {
    font-size: 16px;
    color: #fff;
    margin-top: 5px;
}

/* TV Controls */
.tv-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding: 0 20px;
}

.control-panel {
    display: flex;
    gap: 40px;
    align-items: flex-end;
}

.control-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.control-label {
    font-size: 10px;
    color: #888;
    letter-spacing: 2px;
    font-weight: bold;
}

.knob {
    width: 60px;
    height: 60px;
    background: radial-gradient(circle at 30% 30%, #555, #222);
    border-radius: 50%;
    box-shadow:
        0 5px 15px rgba(0, 0, 0, 0.5),
        inset 0 -2px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    position: relative;
    transition: transform 0.1s;
}

.knob:active {
    transform: scale(0.95);
}

.knob-inner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 4px;
    height: 20px;
    background: #fff;
    transform: translate(-50%, -50%);
    border-radius: 2px;
}

.power-knob .knob-inner {
    background: #ff4444;
}

/* Retro Buttons */
.button-group {
    display: flex;
    gap: 5px;
}

.button-group.vertical {
    flex-direction: column;
}

.retro-button {
    width: 50px;
    height: 35px;
    background: linear-gradient(145deg, #3a3a3a, #1a1a1a);
    border: 2px solid #555;
    border-radius: 8px;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.1);
    transition: all 0.1s;
    font-family: 'Courier New', monospace;
}

.retro-button:hover {
    background: linear-gradient(145deg, #4a4a4a, #2a2a2a);
    border-color: #00ff00;
    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(255, 255, 255, 0.1),
        0 0 10px rgba(0, 255, 0, 0.3);
}

.retro-button:active {
    transform: translateY(2px);
    box-shadow:
        0 2px 4px rgba(0, 0, 0, 0.5),
        inset 0 1px 2px rgba(0, 0, 0, 0.3);
}

.retro-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.speaker-grill {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0.3;
}

.grill-line {
    width: 150px;
    height: 3px;
    background: #444;
    border-radius: 2px;
}

/* Channel Guide */
.channel-guide {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 15px;
    padding: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 800px;
    display: flex;
    flex-direction: column;
}

.guide-header {
    margin-bottom: 20px;
}

.guide-header h2 {
    color: #00ff00;
    text-shadow: 0 0 10px #00ff00;
    margin-bottom: 15px;
    font-size: 24px;
}

.guide-controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.search-input,
.group-filter {
    width: 100%;
    padding: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #00ff00;
    border-radius: 5px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.search-input:focus,
.group-filter:focus {
    outline: none;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
}

.group-filter option {
    background: #1a1a1a;
    color: #fff;
}

/* Channel List */
.channel-list {
    overflow-y: auto;
    flex: 1;
    padding-right: 10px;
}

.channel-list::-webkit-scrollbar {
    width: 8px;
}

.channel-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.channel-list::-webkit-scrollbar-thumb {
    background: #00ff00;
    border-radius: 4px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #888;
    font-size: 18px;
}

.channel-item {
    background: rgba(0, 0, 0, 0.4);
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    border: 1px solid rgba(0, 255, 0, 0.2);
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 15px;
}

.channel-item:hover {
    background: rgba(0, 255, 0, 0.1);
    border-color: #00ff00;
    transform: translateX(5px);
}

.channel-item.active {
    background: rgba(0, 255, 0, 0.2);
    border-color: #00ff00;
    box-shadow: 0 0 20px rgba(0, 255, 0, 0.3);
}

.channel-logo {
    width: 50px;
    height: 50px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 5px;
}

.channel-logo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.channel-details {
    flex: 1;
}

.channel-item-name {
    font-size: 16px;
    font-weight: bold;
    color: #fff;
    margin-bottom: 5px;
}

.channel-item-group {
    font-size: 12px;
    color: #888;
}

/* Info Footer */
.info-footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #888;
    font-size: 14px;
}

.info-footer a {
    color: #00ff00;
    text-decoration: none;
}

.info-footer a:hover {
    text-shadow: 0 0 10px #00ff00;
}

#total-channels {
    color: #00ff00;
    font-weight: bold;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .tv-container {
        grid-template-columns: 1fr;
    }

    .channel-guide {
        max-height: 500px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .tv-frame {
        padding: 20px;
    }

    .tv-controls {
        flex-direction: column;
        gap: 20px;
    }

    .control-panel {
        gap: 20px;
    }

    .retro-button {
        width: 40px;
        height: 30px;
        font-size: 14px;
    }

    .no-signal-text {
        font-size: 24px;
    }

    .guide-header h2 {
        font-size: 18px;
    }
}

