/* Original CSS content from style tag */
:root {
    --tv-width: 800px;
    --tv-height: 450px;
    --remote-width: 150px;  
    --remote-height: 460px;
}

@media (max-width: 768px) {
    :root {
        --tv-width: 100vw;
        --tv-height: 56.25vw; /* 16:9 aspect ratio */
        --remote-width: 240px;
        --remote-height: auto;
    }

    body {
        padding: 10px;
        gap: 20px;
    }

    .tv-container {
        width: 100%;
        max-width: 100%;
        margin: 0;
        padding: 0;
    }

    .tv-frame {
        padding: 0;
        border-radius: 0;
    }

    .screen {
        width: 100%;
        height: 100%;
        border-radius: 0;
    }

    .channel-list {
        width: 85%;
        padding: 15px;
        font-size: 0.8em;
    }
}

body {
    background: #000000;  
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    margin: 0;
    font-family: Arial, sans-serif;
    color: white;
    gap: 50px;
    flex-direction: column;
    padding: 20px;
    position: relative;  
}

.tv-container {
    position: fixed;  
    top: 50%;        
    left: 50%;       
    transform: translate(-50%, -50%);  
    width: 100%;
    max-width: var(--tv-width);
    height: auto;
    aspect-ratio: 16/9;
    z-index: 1;      
}

.tv-frame {
    background: none;
    border-radius: 0;
    padding: 0;
    position: relative;
    width: 100%;
    height: 100%;
}

.screen {
    width: 100%;
    height: 100%;
    background: #000;
    overflow: hidden;
    position: relative;
    transition: all 0.3s ease;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.3);
}

.screen.off {
    background: #111;
}

.screen.off::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 2px;
    background: white;
    border-radius: 50%;
    animation: tvOff 0.3s ease-out forwards;
}

.fullscreen-button {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: none;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 12px;
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.screen:hover .fullscreen-button {
    opacity: 0.7;
}

.fullscreen-button:hover {
    opacity: 1;
    transform: scale(1.1);
}

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

#video-player:fullscreen {
    object-fit: cover;
}

/* For webkit browsers */
#video-player:-webkit-full-screen {
    object-fit: cover;
}

/* For Mozilla */
#video-player:-moz-full-screen {
    object-fit: cover;
}

/* For MS */
#video-player:-ms-fullscreen {
    object-fit: cover;
}

#youtube-embed {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: none;
}

.channel-info {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(0,0,0,0.7);
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
    display: none;
}

.error-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.7);
    padding: 10px;
    border-radius: 5px;
    z-index: 10;
    display: none;
    text-align: center;
}

/* Add keyboard info style */
.keyboard-info {
    display: none;
}

@media (min-width: 769px) {
    .keyboard-info {
        position: fixed;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0,0,0,0.7);
        padding: 10px 20px;
        border-radius: 5px;
        font-size: 0.9em;
        opacity: 0.7;
    }
}

.channel-input {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.8);
    padding: 20px 40px;
    border-radius: 10px;  
    font-size: 48px;
    z-index: 10;
    display: none;
    color: white;
    text-shadow: 0 0 10px rgba(255,255,255,0.5);
    min-width: 100px;
    text-align: center;
}

.channel-list {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 300px;
    max-width: 80%;
    background: rgba(0,0,0,0.7);
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

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

.channel-list::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
}

.channel-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

.channel-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4);
}

.channel-list h3 {
    margin: 0 0 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    padding-bottom: 5px;
    font-size: 1em;
}

.channel-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.channel-list li {
    margin-bottom: 8px;
    opacity: 0.8;
    transition: opacity 0.2s;
    cursor: pointer;
}

.channel-list li:hover {
    opacity: 1;
}

.channel-list.visible {
    transform: translateX(0);
}

.toggle-menu-btn {
    background: none;
    border: none;
    color: white;
    padding: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 24px;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 1000;
    width: 45px;
    height: 45px;
    opacity: 0.7;
}

.toggle-menu-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.remote-container, .channel-list {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.remote-container, .channel-list {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.remote-container.hidden, .channel-list.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

/* Remote Control Styles */
.remote-container {
    position: absolute;
    right: 20px;  
    top: 70px;
    z-index: 1000;
    width: min(var(--remote-width), 90%);
    height: var(--remote-height);
    background: linear-gradient(45deg, #2a2a2a, #3a3a3a);
    border-radius: 25px;
    padding: 15px 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.5);
    border: 1px solid #444;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.remote-container:hover {
    transform: none; /* Keep position stable on hover */
}

.channel-pad {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;           
    width: 80%;
    background: rgba(0,0,0,0.15);
    padding: 8px;
    border-radius: 15px;
}

.remote-button {
    background: linear-gradient(145deg, #333, #222);
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    padding: 6px;        
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

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

.remote-button:hover {
    background: #888;
    transform: scale(1.1);
}

.volume-buttons {
    display: flex;
    gap: 15px;
    width: 80%;
    justify-content: center;
    background: rgba(0,0,0,0.15);
    padding: 8px;
    border-radius: 15px;
    margin: 10px 0;
}

.volume-button {
    background: linear-gradient(145deg, #333, #222);
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    padding: 6px 12px;   
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.volume-button:hover {
    background: #777;
    transform: scale(1.1);
}

.channel-nav {
    display: flex;
    flex-direction: row;
    gap: 15px;
    width: 80%;
    justify-content: space-between;
}

.volume-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 45%;
}

.channel-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    width: 45%;
}

.volume-button,
.channel-nav-button {
    background: linear-gradient(145deg, #333, #222);
    border: 1px solid #444;
    border-radius: 8px;
    color: white;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.8em;
    width: 100%;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.volume-button:hover,
.channel-nav-button:hover {
    background: #666;
    transform: scale(1.05);
}

.remote-container::before {
    content: "TÜRK TV";
    position: absolute;
    bottom: 15px;
    font-size: 0.7em;
    opacity: 0.5;
    letter-spacing: 1px;
}

.channel-buttons {
    display: none;
}

.volume-indicator {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0,0,0,0.7);
    padding: 10px;
    border-radius: 5px;
    display: none;
    z-index: 10;
}

@media (max-width: 768px) {
    .remote-container {
        width: var(--remote-width);
    }

    .toggle-menu-btn {
        top: 20px;
        right: 20px;
    }
}

@media (max-width: 768px) and (orientation: portrait) {
    .remote-container {
        position: absolute;
        right: 20px;
        top: auto;
        bottom: 20px;
        transform: none !important; /* Prevent any transform */
        width: var(--remote-width);
        height: auto;
        max-height: 60vh;
    }

    .remote-container:hover {
        transform: none !important; /* Prevent transform on hover */
    }

    .remote-container.hidden {
        transform: translateY(100%) !important; /* Only hide downward */
        opacity: 0;
        pointer-events: none;
    }
}

@media (orientation: landscape) {
    .remote-container {
        position: absolute;
        right: 20px;
        top: 70px;
        transform: none;
        width: 240px; /* Same as mobile width */
        height: auto;
        max-height: 80vh;
    }

    .remote-container.hidden {
        transform: translate(100%, -50%);
        opacity: 0;
        pointer-events: none;
    }
    
    .remote-container:hover {
        transform: none;
    }

    .channel-nav {
        width: 85%;
    }

    .volume-controls,
    .channel-controls {
        width: 45%;
    }
    
    .channel-pad {
        width: 85%;
        gap: 6px;
        padding: 6px;
    }

    .volume-buttons {
        width: 85%;
        gap: 10px;
        padding: 6px;
    }

    .channel-nav {
        width: 85%;
        align-items: center;
    }

    .channel-nav-button {
        width: 80%;
    }
    
    .remote-button,
    .volume-button,
    .channel-nav-button {
        font-size: 0.8em;
        padding: 5px;
    }
}
    
@media (max-width: 768px) {
    .remote-container {
        width: var(--remote-width);
    }

    .toggle-menu-btn {
        top: 20px;
        right: 20px;
    }
}

.menu-overlay {
    position: absolute;
    top: 70px;
    right: 20px;
    background: rgba(0,0,0,0.8);
    padding: 15px;  
    border-radius: 8px;  
    display: none;
    z-index: 1000;
}

@media (max-width: 768px) {
    .menu-overlay {
        top: auto;
        bottom: 80px;
        right: 20px;
        transform: none;
    }
    
    .remote-container {
        position: absolute;
        right: 20px;
        top: auto;
        bottom: 20px;
        transform: none !important; /* Prevent any transform */
        width: var(--remote-width);
        height: auto;
        max-height: 60vh;
    }
}

.menu-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;  
}

.menu-option {
    background: linear-gradient(145deg, #333, #222);
    border: 1px solid #444;
    border-radius: 6px;
    color: white;
    padding: 8px 15px;  
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9em;  
    min-width: 150px;  
    text-align: center;
}

.menu-option:hover {
    background: linear-gradient(145deg, #444, #333);
    transform: scale(1.05);
}

.keyboard-guide {
    margin-top: 15px;
    padding: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
    color: #ddd;
}

.keyboard-guide-title {
    margin-bottom: 10px;
    color: #fff;
    font-weight: bold;
}

.keyboard-guide-item {
    display: flex;
    justify-content: space-between;
    margin: 5px 0;
}

.keyboard-guide-key {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 8px;
    border-radius: 4px;
    margin-right: 10px;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.remote-container .close-button {
    top: 5px;
    right: 5px;
}

.keyboard-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.9);
    padding: 20px;
    border-radius: 12px;
    display: none;
    z-index: 1000;
    max-width: 300px;
    width: 85%;
}

.keyboard-guide {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.keyboard-guide-title {
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 10px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 8px;
}

.keyboard-guide-item {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 0.9em;
}

.keyboard-guide-key {
    background: linear-gradient(145deg, #333, #222);
    border: 1px solid #444;
    border-radius: 6px;
    color: white;
    padding: 4px 8px;
    font-size: 0.9em;
    min-width: 30px;
    text-align: center;
}

@media (max-width: 768px) {
    .keyboard-overlay {
        width: 80%;
        padding: 15px;
    }
}

/* Add new styles for channel categories */
.channel-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
    scroll-behavior: smooth;
}

.category {
    padding: 0;
    background: none;
}

.category h4 {
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 5px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 0.9em;
}

.category ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.category li {
    padding: 5px 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.85em;
    opacity: 0.8;
    color: rgba(255, 255, 255, 0.8);
    border-radius: 4px;
}

.category li.selected {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    opacity: 1;
    transform: translateX(5px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

/* Add loading indicator styles */
.loading-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.8);
    border-radius: 10px;
    padding: 20px;
    display: none;
    flex-direction: column;
    align-items: center;
    z-index: 20;
    color: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.5);
    width: 80px;
    height: 80px;
}

.loading-text {
    display: none;
    margin-bottom: 0;
    font-size: 1.1em;
    font-weight: bold;
    text-align: center;
}

.loading-progress {
    display: none; 
}

.loading-progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 1.5em;
    font-weight: bold;
    text-shadow: 0 0 3px rgba(0, 0, 0, 0.8);
}

.sidebar-toggle {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    width: 30px;
    height: 60px;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    z-index: 101;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(0, 0, 0, 0.9);
}

.sidebar-toggle.active {
    left: 300px;
}

@media (max-width: 768px) {
    .sidebar-toggle.active {
        left: 80%;
    }
    
    .channel-list {
        max-width: 80%;
    }
}
