/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #cc1288 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

/* Header */
header {
    background: linear-gradient(135deg, #ff0eea 0%, #764ba2 100%);
    color: white;
    padding: 40px 30px;
    text-align: center;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Main Content */
main {
    padding: 40px 30px;
}

/* Instructions Section */
.instructions {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 30px;
}

.instructions h2 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: #667eea;
}

.instructions ul {
    list-style: none;
    padding-left: 0;
}

.instructions li {
    padding: 8px 0;
    padding-left: 30px;
    position: relative;
    line-height: 1.6;
}

.instructions li::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #667eea;
    font-weight: bold;
}

/* Controls Section */
.controls {
    margin-bottom: 30px;
}

.control-group {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary.recording {
    background: #e74c3c;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

.btn-secondary {
    background: #764ba2;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #653a8a;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(118, 75, 162, 0.4);
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #cc1288;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(39, 174, 96, 0.4);
}

/* Audio Feedback */
.audio-feedback {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.audio-feedback label {
    font-weight: 600;
    color: #555;
    min-width: 100px;
}

.level-meter {
    flex: 1;
    height: 30px;
    background: #e0e0e0;
    border-radius: 15px;
    overflow: hidden;
    position: relative;
}

.level-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #f7f763, #e590fc, #fc4299);
    border-radius: 15px;
    transition: width 0.1s ease;
}

.level-text {
    font-weight: 600;
    color: #667eea;
    min-width: 50px;
    text-align: right;
}

/* Status */
.status {
    padding: 15px;
    background: #e8f4f8;
    border-left: 4px solid #667eea;
    border-radius: 4px;
}

#statusText {
    font-weight: 500;
    color: #555;
}

/* Canvas Container */
.canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    background: #d8e3db;
    border-radius: 12px;
    padding: 30px;
    min-height: 400px;
}

#blotCanvas {
    max-width: 100%;
    height: auto;
    border: 2px solid #d8e3db;
    border-radius: 8px;
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
    background: #abffd6;
    padding: 20px 30px;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    header h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 1rem;
    }

    main {
        padding: 20px 15px;
    }

    .control-group {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }

    .audio-feedback {
        flex-direction: column;
        align-items: stretch;
    }

    .audio-feedback label {
        min-width: auto;
    }

    #blotCanvas {
        width: 100%;
    }
}

@media (max-width: 480px) {
    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .instructions {
        padding: 20px;
    }

    .canvas-container {
        padding: 15px;
    }
}
