/* Base styles */
body {
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-weight: 500;
    margin: 0;
    height: 100vh;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f4f3 0%, #ebe9e7 100%);
    color: #1a1a1a;
    display: flex;
    flex-direction: column;
}

/* Buttons */
button, select {
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background: #ccc6c1;
    color: #222;
    cursor: pointer;
    transition: background 0.2s;
}
button:hover,
.index-page button:hover {
    background: #ab9f95;
}
button:disabled {
    background: #e5e1dd;
    cursor: not-allowed;
    color: #999;
}
.index-page button {
    padding: 15px 25px;
    font-size: 18px;
}

/* Main container */
#main-container {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f2f1f0;
    overflow: hidden;
}

/* Status */
#status {
    color: #1a1a1a;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 18px;
    text-align: center;
    max-width: 80%;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
}
.error {
    color: red;
}

/* Device page overrides */
.device-page #status {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.95);
    padding: 20px 30px;
    border-radius: 16px;
    z-index: 20;
    border: 1px solid rgba(204, 198, 193, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(10px);
}

.device-page #main-container,
.device-page #video-container,
.device-page #video {
    min-height: 0 !important;
    width: auto !important;
    max-width: none !important;
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: stretch;
    justify-content: center;
}
.device-page #video {
    object-fit: contain;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0;
    background: linear-gradient(135deg, #f5f4f3 0%, #ebe9e7 100%);
    object-fit: cover;
    box-shadow: none;
}
.device-page #video-container {
    height: 100vh !important;
    aspect-ratio: 9 / 19.5;
    width: auto !important;
    max-width: 100vw !important;
    border: none !important;
    border-radius: 0;
    background: linear-gradient(135deg, #f5f4f3 0%, #ebe9e7 100%);
    box-shadow: 0 8px 32px rgba(0,0,0,0.10), 0 2px 8px rgba(0,0,0,0.05);
    overflow: hidden;
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

/* Video container and video */
#video-container {
    position: relative;
    margin: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
    z-index: 5;
}
#video-container video,
video {
    display: block;
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    max-width: 100vw !important;
    max-height: 100vh !important;
    background-color: #f2f1f0;
}

/* Mousepad overlay */
/* Mousepad overlay */
#mousepad-overlay {
    position: absolute;
    inset: 0;
    border: 2px solid rgba(26,26,26,.15);
    border-radius: 0;
    pointer-events: auto;
    z-index: 10;
}


#mousepad-status {
    position: absolute;
    top: 15px;
    right: 15px;
    color: #1a1a1a;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-weight: 600;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 16px;
    border-radius: 16px;
    z-index: 15;
    border: 1px solid rgba(204, 198, 193, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
}

/* Latency display */
#latency-display {
    position: absolute;
    top: 15px;
    left: 15px;
    color: #1a1a1a;
    font-family: 'Montserrat', Arial, Helvetica, sans-serif;
    font-weight: 500;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.95);
    padding: 12px 16px;
    border-radius: 0;
    z-index: 15;
    border: 1px solid rgba(204, 198, 193, 0.2);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1), 0 1px 4px rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(8px);
    min-width: 160px;
    line-height: 1.4;
}

/* Stats */
.stats-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2px;
}
.stats-row:last-child {
    margin-bottom: 0;
}
.stats-label {
    color: #666;
    margin-right: 8px;
    font-weight: 500;
}
.stats-value {
    color: #1a1a1a;
    font-weight: 700;
}
.low-latency {
    color: #4ade80 !important;
}
.medium-latency {
    color: #fbbf24 !important;
}
.high-latency {
    color: #f87171 !important;
}
.stats-disconnected {
    color: #666;
    text-align: center;
    font-style: italic;
    font-weight: 500;
}

/* Index page overrides */
.index-page #main-container {
    flex-direction: column;
}
.index-page #status {
    margin-bottom: 20px;
}
.index-page #generate-button {
    border-radius: 12px;
}