/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #000;
    color: #fff;
    overflow: hidden;
    height: 100vh;
}

#app {
    position: relative;
    width: 100vw;
    height: 100vh;
}

/* Loading screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.loading-content {
    text-align: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid #fff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

/* Control panel */
.control-panel {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 350px;
    background: rgba(0, 0, 0, 0.9);
    border: 1px solid #333;
    border-radius: 8px;
    z-index: 900;
    backdrop-filter: blur(10px);
    transition: opacity 0.3s ease;
}

.control-panel.hidden {
    opacity: 0;
    pointer-events: none;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    border-bottom: 1px solid #333;
}

.control-header h3 {
    font-size: 16px;
    color: #fff;
}

.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.control-content {
    padding: 15px;
}

.control-content h4 {
    font-size: 14px;
    margin-bottom: 10px;
    color: #ccc;
}

/* Authentication status */
.auth-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 13px;
}

.status-indicator {
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: bold;
}

.status-indicator.connected {
    background: #4CAF50;
    color: white;
}

.status-indicator.disconnected {
    background: #f44336;
    color: white;
}

.status-indicator.checking {
    background: #ff9800;
    color: white;
}

/* Rotation controls */
.rotation-section {
    margin-top: 20px;
}

.rotation-controls {
    display: flex;
    gap: 8px;
    margin-bottom: 15px;
}

.control-btn {
    background: #333;
    border: 1px solid #555;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    flex: 1;
}

.control-btn:hover {
    background: #444;
}

.control-btn:active {
    background: #222;
}

.current-site {
    font-size: 13px;
    margin-bottom: 10px;
}

/* Progress bar */
.progress-bar {
    width: 100%;
    height: 4px;
    background: #333;
    border-radius: 2px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4CAF50, #45a049);
    width: 0%;
    transition: width 0.1s linear;
}

/* Sites list */
.sites-section {
    margin-top: 20px;
}

.sites-list {
    max-height: 150px;
    overflow-y: auto;
}

.site-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    margin-bottom: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.site-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.site-item.active {
    background: rgba(76, 175, 80, 0.3);
    border: 1px solid #4CAF50;
}

/* Main display */
.display-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.main-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #000;
    position: absolute;
    top: 0;
    left: 0;
}

/* Site info overlay */
.site-info {
    position: absolute;
    bottom: 20px;
    left: 20px;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 15px;
    border-radius: 6px;
    font-size: 14px;
    backdrop-filter: blur(5px);
    display: flex;
    gap: 15px;
    align-items: center;
    transition: opacity 0.3s ease;
}

.site-info.hidden {
    opacity: 0;
}

#site-timer {
    color: #4CAF50;
    font-weight: bold;
}

/* Removed preload indicator - not needed in simplified version */

/* Error display */
.error-display {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.error-display.hidden {
    display: none;
}

.error-content {
    text-align: center;
    padding: 40px;
    background: #1a1a1a;
    border-radius: 8px;
    border: 1px solid #333;
}

.error-content h2 {
    color: #f44336;
    margin-bottom: 15px;
}

.error-content p {
    margin-bottom: 20px;
    color: #ccc;
}

.retry-btn {
    background: #4CAF50;
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.retry-btn:hover {
    background: #45a049;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .control-panel {
        width: 300px;
        right: 10px;
        top: 10px;
    }
    
    .site-info {
        bottom: 10px;
        left: 10px;
        font-size: 12px;
    }
}

/* Hide scrollbars but keep functionality */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #333;
}

::-webkit-scrollbar-thumb {
    background: #666;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #888;
}
