/* IPTV Page Styles */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #f5f5f5 0%, #e8e8e8 100%);
    min-height: 100vh;
}

.iptv-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.iptv-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #775454 0%, #6a4848 100%);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.iptv-header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
}

.iptv-header h1 {
    margin: 0;
    font-size: 28px;
    font-weight: 600;
}

.back-button {
    color: white;
    text-decoration: none;
    padding: 10px 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    transition: all 0.2s;
    font-weight: 500;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* IPTV Theme Toggle Button */
.iptv-theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    display: inline-block;
    min-width: 60px;
    max-width: none;
    height: auto;
    padding: 4px 6px;
    margin: 3px;
    text-align: center;
    vertical-align: middle;
    box-sizing: border-box;
    border-radius: 6px;
    font-size: calc(15px + 0.1vw);
    line-height: 1.2;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.iptv-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.iptv-theme-icon {
    vertical-align: middle;
}

/* Main Content */
.iptv-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
}

/* Controls */
.iptv-controls {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.iptv-selector-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.iptv-selector-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    margin-bottom: 4px;
}

.iptv-selector {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    font-size: 16px;
    color: #333;
    transition: all 0.2s;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 16px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 50px;
}

.iptv-selector:focus {
    outline: none;
    border-color: #775454;
    box-shadow: 0 0 0 3px rgba(119, 84, 84, 0.1);
}

.iptv-selector:hover {
    border-color: #bbb;
}

.iptv-selector:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Video Player */
.iptv-video-container {
    position: relative;
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    height: 500px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.iptv-video-player {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Hide play button in video controls */
.iptv-video-player::-webkit-media-controls-play-button {
    display: none;
}

.iptv-video-player::-webkit-media-controls-overlay-play-button {
    display: none;
}

.iptv-video-placeholder {
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    font-size: 18px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Binguru Watermark */
.iptv-watermark {
    text-transform: uppercase;
    opacity: 0.5;
    position: absolute;
    bottom: 15px;
    right: 6px;
    color: rgba(255, 255, 255, 0.8);
    padding: 4px 7.5rem;
    font-size: 18px;
    font-weight: 600;
    border-radius: 4px;
    font-family: 'Roboto', Arial, sans-serif;
    z-index: 10;
    pointer-events: none;
    user-select: none;
}

/* Player Controls */
.iptv-player-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.iptv-play-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #775454 0%, #6a4848 100%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 16px rgba(119, 84, 84, 0.3);
}

.iptv-play-btn:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(119, 84, 84, 0.4);
}

.iptv-play-btn:active {
    transform: scale(0.95);
}

.iptv-play-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.iptv-volume-container {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.iptv-volume-icon {
    font-size: 20px;
    color: #666;
}

.iptv-volume-slider {
    flex: 1;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    outline: none;
    appearance: none;
    cursor: pointer;
}

.iptv-volume-slider::-webkit-slider-thumb {
    appearance: none;
    width: 20px;
    height: 20px;
    background: #775454;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.iptv-volume-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(119, 84, 84, 0.3);
}

.iptv-volume-slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #775454;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

/* Now Playing */
.iptv-now-playing {
    background: rgba(119, 84, 84, 0.05);
    border: 1px solid rgba(119, 84, 84, 0.1);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

/* Info Message */
.iptv-info-message {
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
}

.iptv-info-message p {
    margin: 8px 0;
    color: #555;
    font-size: 14px;
    line-height: 1.4;
}

.iptv-info-message p:first-child {
    margin-top: 0;
    font-size: 16px;
}

.iptv-info-message p:last-child {
    margin-bottom: 0;
}

.iptv-channel-name {
    font-weight: 600;
    font-size: 20px;
    color: #333;
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.iptv-channel-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.iptv-status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ccc;
    transition: all 0.3s;
}

.iptv-status-indicator.loading {
    background: #ffa500;
    animation: pulse 1.5s infinite;
}

.iptv-status-indicator.playing {
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.3);
}

.iptv-status-indicator.error {
    background: #ef4444;
}

.iptv-status-indicator.ready {
    background: #6b7280;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Dark theme support */
[data-theme="dark"] body {
    background: linear-gradient(135deg, #2a2a2a 0%, #1f1f1f 100%);
}

[data-theme="dark"] .iptv-content {
    background: #333;
    color: #e0e0e0;
}

[data-theme="dark"] .iptv-selector {
    background: #444;
    border-color: #555;
    color: #e0e0e0;
}

[data-theme="dark"] .iptv-selector:focus {
    border-color: #775454;
}

[data-theme="dark"] .iptv-selector-label {
    color: #ccc;
}

[data-theme="dark"] .iptv-player-controls {
    border-color: #555;
}

[data-theme="dark"] .iptv-channel-name {
    color: #e0e0e0;
}

[data-theme="dark"] .iptv-channel-status {
    color: #aaa;
}

[data-theme="dark"] .iptv-now-playing {
    background: rgba(119, 84, 84, 0.1);
    border-color: rgba(119, 84, 84, 0.2);
}

[data-theme="dark"] .iptv-volume-slider {
    background: #555;
}

[data-theme="dark"] .iptv-video-placeholder {
    color: rgba(255, 255, 255, 0.5);
}

[data-theme="dark"] .iptv-info-message {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
}

[data-theme="dark"] .iptv-info-message p {
    color: #ccc;
}

[data-theme="dark"] .iptv-watermark {
    color: rgba(255, 255, 255, 0.9);
}

/* Loading spinner */
.iptv-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #e0e0e0;
    border-radius: 50%;
    border-top-color: #775454;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .iptv-page {
        padding: 10px;
    }
    
    .iptv-header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
        padding: 20px;
    }
    
    .iptv-header-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .iptv-header h1 {
        font-size: 24px;
    }
    
    .iptv-content {
        padding: 20px;
    }
    
    .iptv-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .iptv-video-container {
        height: 300px;
    }
    
    .iptv-player-controls {
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .iptv-volume-container {
        min-width: 200px;
    }
}

@media (max-width: 480px) {
    .iptv-header h1 {
        font-size: 20px;
    }
    
    .iptv-content {
        padding: 15px;
    }
    
    .iptv-video-container {
        height: 250px;
    }
    
    .iptv-play-btn {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }

}