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

body {
    font-family: 'Arial', sans-serif;
    background: linear-gradient(135deg, #1a1a2e, #16213e, #0f3460);
    color: #b0c4de;
    min-height: 100vh;
    overflow-x: hidden;
}

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

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
}

header h1 {
    color: #00ff87;
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(0, 255, 135, 0.5);
}

header p {
    color: #60efff;
    font-size: 1.2em;
    opacity: 0.8;
}

/* Controls section */
.controls {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid rgba(0, 255, 135, 0.2);
    backdrop-filter: blur(10px);
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.control-group label {
    color: #60efff;
    font-weight: bold;
    min-width: 100px;
}

/* Buttons */
.btn-primary, .btn-secondary, .btn-monitor, .btn-trouble {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: linear-gradient(45deg, #00ff87, #60efff);
    color: #1a1a2e;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 135, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: linear-gradient(45deg, #f72585, #b5179e);
    color: white;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(247, 37, 133, 0.4);
}

.btn-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-monitor {
    background: linear-gradient(45deg, #7209b7, #560bad);
    color: white;
}

.btn-monitor:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(114, 9, 183, 0.4);
}

.btn-monitor:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-trouble {
    padding: 10px 20px;
    border: none;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: linear-gradient(45deg, #ff6b6b, #ffa500);
    color: white;
}

.btn-trouble:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.4);
}

/* Input controls */
input[type="range"] {
    width: 150px;
    height: 6px;
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.2);
    outline: none;
    -webkit-appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #00ff87, #60efff);
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.5);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: linear-gradient(45deg, #00ff87, #60efff);
    cursor: pointer;
    border: none;
}

select {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 255, 135, 0.3);
    border-radius: 8px;
    padding: 8px 12px;
    color: #b0c4de;
    font-size: 14px;
    min-width: 150px;
}

select:focus {
    outline: none;
    border-color: #00ff87;
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.3);
}

select option {
    background: #1a1a2e;
    color: #b0c4de;
}

/* Color picker controls */
.color-controls {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-wrap: wrap;
}

.color-controls label {
    font-size: 14px;
    color: #b0c4de;
    margin-right: 5px;
}

input[type="color"] {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(0, 255, 135, 0.3);
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

input[type="color"]:hover {
    border-color: #00ff87;
    box-shadow: 0 0 10px rgba(0, 255, 135, 0.3);
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

#sensitivityValue {
    color: #00ff87;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

/* Display container */
.display-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
}

#canvas {
    border: 2px solid rgba(0, 255, 135, 0.3);
    border-radius: 15px;
    background: #1a1a2e;
    box-shadow: 0 0 30px rgba(0, 255, 135, 0.2);
    max-width: 100%;
    height: auto;
}

.audio-info {
    display: flex;
    gap: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    padding: 15px 25px;
    border: 1px solid rgba(0, 255, 135, 0.2);
}

.audio-info span {
    color: #60efff;
    font-weight: bold;
}

.audio-info span[id] {
    color: #00ff87;
}

/* Status section */
.status {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    margin-top: 20px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    padding: 10px 20px;
    border: 1px solid rgba(0, 255, 135, 0.2);
}

.status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ff6b6b;
    animation: pulse 2s infinite;
}

.status-dot.status-connected {
    background: #00ff87;
}

.status-dot.status-disconnected {
    background: #ff6b6b;
}

.audio-level {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 8px;
    width: 200px;
    height: 20px;
    position: relative;
    overflow: hidden;
}

.level-bar {
    height: 100%;
    border-radius: 6px;
    transition: width 0.1s ease;
    background: linear-gradient(90deg, #00ff87, #60efff);
    width: 0%;
}

.level-bar.level-low {
    background: linear-gradient(90deg, #00ff87, #40e0d0);
}

.level-bar.level-medium {
    background: linear-gradient(90deg, #ffd700, #ff8c00);
}

.level-bar.level-high {
    background: linear-gradient(90deg, #ff6b6b, #ff4757);
}

/* Error notifications */
.error-notifications {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.audio-notification {
    margin-bottom: 10px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideInRight 0.3s ease-out;
    max-width: 100%;
}

.audio-error {
    background: linear-gradient(135deg, #ff4757, #ff3838);
    border-left: 4px solid #ff6b6b;
}

.audio-warning {
    background: linear-gradient(135deg, #ffa502, #ff8c00);
    border-left: 4px solid #ffd700;
}

.notification-content {
    padding: 15px;
    display: flex;
    align-items: center;
    position: relative;
}

.notification-icon {
    font-size: 18px;
    margin-right: 12px;
    flex-shrink: 0;
}

.notification-message {
    color: white;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.4;
    flex-grow: 1;
    margin-right: 30px;
}

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

.notification-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
}

/* Troubleshooting modal */
.trouble-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.trouble-content {
    background: linear-gradient(135deg, #1a1a2e, #16213e);
    border-radius: 15px;
    padding: 30px;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
    border: 2px solid rgba(0, 255, 135, 0.3);
    box-shadow: 0 0 30px rgba(0, 255, 135, 0.2);
}

.trouble-content h3 {
    color: #00ff87;
    margin-bottom: 20px;
    text-align: center;
}

.trouble-content h4 {
    color: #60efff;
    margin-top: 20px;
    margin-bottom: 10px;
}

.trouble-content ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

.trouble-content li {
    margin-bottom: 8px;
    color: #b0c4de;
}

.trouble-content .highlight {
    color: #ffd700;
    font-weight: bold;
}

.trouble-close {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 24px;
    cursor: pointer;
    font-weight: bold;
}

.trouble-close:hover {
    color: #ffffff;
}

/* Animations */
@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }
    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Temporary message styles */
.temp-message {
    animation: slideDown 0.3s ease-out;
}

/* Fullscreen mode styles */
.fullscreen-mode {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    overflow: hidden;
}

.fullscreen-mode .container {
    max-width: none;
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
}

.fullscreen-mode header,
.fullscreen-mode .controls,
.fullscreen-mode .audio-info,
.fullscreen-mode .status {
    display: none !important;
}

.fullscreen-mode .display-container {
    position: relative;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: transparent;
}

.fullscreen-mode #canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    border: none;
    border-radius: 0;
    max-width: none;
    max-height: none;
}

/* Fullscreen exit button */
.fullscreen-exit-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.fullscreen-mode .fullscreen-exit-btn {
    display: flex;
}

.fullscreen-exit-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.1);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .controls {
        padding: 15px;
        gap: 15px;
    }
    
    .control-group {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .control-group label {
        min-width: auto;
    }
    
    #canvas {
        width: 100%;
        height: 400px;
    }
    
    .status {
        flex-direction: column;
        gap: 10px;
    }
    
    .audio-level {
        width: 100%;
    }
    
    .audio-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .error-notifications {
        left: 10px;
        right: 10px;
        width: auto;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 2em;
    }
    
    header p {
        font-size: 1em;
    }
    
    .btn-primary, .btn-secondary, .btn-monitor {
        padding: 10px 20px;
        font-size: 14px;
    }
    
    #canvas {
        height: 300px;
    }
} 