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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
}

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 2.5em;
    font-weight: 300;
}

.subtitle {
    text-align: center;
    color: #7f8c8d;
    margin-bottom: 30px;
    font-size: 1.1em;
}

.main-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.monitor-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.monitor-bezel {
    position: relative;
    background: #2c3e50;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 
        0 20px 40px rgba(0,0,0,0.3),
        inset 0 2px 10px rgba(255,255,255,0.1);
    border: 3px solid #34495e;
}

.monitor-bezel::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 6px;
    background: #95a5a6;
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.3);
}

#einkDisplay {
    background: #f8f9fa;
    border: 2px solid #34495e;
    border-radius: 5px;
    cursor: crosshair;
    transition: all 0.3s ease;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.1);
}

#einkDisplay:hover {
    box-shadow: 
        inset 0 0 20px rgba(0,0,0,0.1),
        0 0 10px rgba(52, 152, 219, 0.3);
}

.power-led {
    position: absolute;
    bottom: 10px;
    right: 15px;
    width: 8px;
    height: 8px;
    background: #e74c3c;
    border-radius: 50%;
    transition: all 0.3s ease;
    box-shadow: 0 0 5px rgba(231, 76, 60, 0.5);
}

.power-led.on {
    background: #27ae60;
    box-shadow: 0 0 10px rgba(39, 174, 96, 0.8);
}

.monitor-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.refresh-btn, .power-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.refresh-btn:hover, .power-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.refresh-btn:active, .power-btn:active {
    transform: translateY(0);
}

.control-panel {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border: 1px solid #e1e8ed;
}

.control-panel h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3em;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.control-group {
    margin-bottom: 20px;
}

.control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #34495e;
    font-size: 14px;
}

.control-group select,
.control-group input[type="range"] {
    width: 100%;
    padding: 8px;
    border: 2px solid #bdc3c7;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.control-group select:focus,
.control-group input[type="range"]:focus {
    outline: none;
    border-color: #3498db;
}

input[type="range"] {
    -webkit-appearance: none;
    height: 6px;
    background: #ecf0f1;
    border-radius: 3px;
    padding: 0;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(52, 152, 219, 0.3);
}

.checkbox-label {
    display: flex !important;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.utility-btn {
    padding: 8px 16px;
    background: linear-gradient(135deg, #95a5a6, #7f8c8d);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
    margin-right: 10px;
    transition: all 0.3s ease;
}

.utility-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #7f8c8d, #6c7b7d);
}

.control-group small {
    display: block;
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 5px;
    font-style: italic;
}

.info-panel {
    background: #ecf0f1;
    padding: 15px;
    border-radius: 8px;
    margin-top: 20px;
}

.info-panel h4 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-size: 1em;
}

.info-panel ul {
    list-style: none;
    padding: 0;
}

.info-panel li {
    padding: 3px 0;
    font-size: 13px;
    color: #34495e;
    position: relative;
    padding-left: 15px;
}

.info-panel li::before {
    content: '•';
    color: #3498db;
    position: absolute;
    left: 0;
}

.footer {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-top: 20px;
}

.footer p {
    color: #7f8c8d;
    font-size: 14px;
}

.footer a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
}

.footer a:hover {
    text-decoration: underline;
}

/* Loading states and animations */
@keyframes refresh-pulse {
    0% { background-color: #3498db; }
    50% { background-color: #2980b9; }
    100% { background-color: #3498db; }
}

.refresh-btn.refreshing {
    animation: refresh-pulse 0.5s infinite;
    cursor: not-allowed;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .app-container {
        padding: 10px;
    }
    
    h1 {
        font-size: 2em;
    }
    
    .monitor-bezel {
        padding: 20px;
    }
    
    #einkDisplay {
        width: 100%;
        height: auto;
        max-width: 400px;
    }
    
    .monitor-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .refresh-btn, .power-btn {
        width: 100%;
        max-width: 200px;
    }
}