/* Audio-Todo - Mobile-First CSS */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 100%;
    min-height: 100vh;
    padding: 20px;
    display: flex;
    flex-direction: column;
}

/* === TOKEN SCREEN === */
.token-screen {
    justify-content: center;
    align-items: center;
    text-align: center;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.token-screen h1 {
    font-size: 2.5em;
    margin-bottom: 20px;
    color: #667eea;
}

.token-screen p {
    margin-bottom: 30px;
    line-height: 1.6;
    color: #666;
}

.token-screen form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
}

.token-screen input[type="password"] {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.1em;
    border: 2px solid #ddd;
    border-radius: 10px;
    transition: border-color 0.3s;
}

.token-screen input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
}

.token-screen button {
    width: 100%;
    max-width: 300px;
    padding: 15px;
    font-size: 1.2em;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.token-screen button:hover {
    background: #5a67d8;
    transform: translateY(-2px);
}

/* === MAIN SCREEN === */
.main-screen {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
}

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
}

header h1 {
    font-size: 1.8em;
    color: #667eea;
}

.logout {
    padding: 8px 16px;
    background: #dc3545;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-size: 0.9em;
    transition: background 0.3s;
}

.logout:hover {
    background: #c82333;
}

/* === CURRENT TASK === */
.current-task {
    flex: 1;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 250px;
}

.no-tasks {
    text-align: center;
    color: #999;
}

.no-tasks p {
    margin: 10px 0;
}

.no-tasks .hint {
    font-size: 0.9em;
    color: #bbb;
}

.current-task audio {
    width: 100%;
    max-width: 400px;
    margin-bottom: 15px;
    border-radius: 10px;
}

.task-info {
    font-size: 0.9em;
    color: #666;
    text-align: center;
}

/* === PLAY SECTION === */
.play-section {
    padding: 20px;
    text-align: center;
    border-top: 1px solid #eee;
}

.play-current-btn {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: #2196F3;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(33, 150, 243, 0.3);
}

.play-current-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(33, 150, 243, 0.4);
}

.play-current-btn.playing {
    background: #FF9800;
    animation: currentPlayPulse 1.5s infinite;
}

@keyframes currentPlayPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0.7); }
    70% { box-shadow: 0 0 0 15px rgba(255, 152, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 152, 0, 0); }
}

.play-current-icon {
    font-size: 2.5em;
    margin-bottom: 3px;
}

.play-current-text {
    color: white;
    font-size: 0.8em;
    font-weight: bold;
}

/* === TASK ACTIONS === */
.task-actions {
    display: flex;
    gap: 10px;
    padding: 20px;
    justify-content: center;
    flex-wrap: wrap;
    border-top: 1px solid #eee;
}

.task-actions form {
    display: inline;
}

.task-actions button {
    padding: 12px 20px;
    background: #2196F3;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    min-width: 100px;
}

.task-actions button:hover {
    background: #1976D2;
    transform: translateY(-1px);
}

.task-actions button.done {
    background: #28a745;
}

.task-actions button.done:hover {
    background: #218838;
}

/* === RECORD SECTION === */
.record-section {
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid #eee;
    background: #fafafa;
}

.record-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #dc3545;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 0 auto;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3);
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 30px rgba(220, 53, 69, 0.4);
}

.record-btn.recording {
    background: #FF5722;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

.record-icon {
    font-size: 3em;
    margin-bottom: 5px;
}

.record-text {
    color: white;
    font-size: 1em;
    font-weight: bold;
}

#recordStatus {
    margin-top: 15px;
    font-size: 1em;
    color: #666;
    min-height: 20px;
}

/* === FOOTER === */
.footer {
    text-align: center;
    padding: 15px;
    margin-top: 20px;
    border-top: 1px solid #eee;
    background: #f8f9fa;
}

.footer p {
    margin: 0;
    font-size: 0.85em;
    color: #666;
}

.footer strong {
    color: #667eea;
}


/* === RESPONSIVE === */
@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .main-screen {
        border-radius: 10px;
    }
    
    header {
        padding: 15px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .current-task {
        padding: 20px 15px;
        min-height: 200px;
    }
    
    .task-actions {
        padding: 15px;
        gap: 8px;
    }
    
    .task-actions button {
        font-size: 0.8em;
        padding: 10px 15px;
        min-width: 80px;
    }
    
    .record-btn {
        width: 100px;
        height: 100px;
    }
    
    .record-icon {
        font-size: 2.5em;
    }
    
    .play-current-btn {
        width: 80px;
        height: 80px;
    }
    
    .play-current-icon {
        font-size: 2em;
    }
    
    .play-current-text {
        font-size: 0.7em;
    }
    
    
    .token-screen {
        margin: 20px;
        padding: 30px 20px;
    }
}

@media (max-width: 360px) {
    .task-actions {
        flex-direction: column;
    }
    
    .task-actions button {
        width: 100%;
    }
}

/* === LANDSCAPE MODE === */
@media (orientation: landscape) and (max-height: 500px) {
    .current-task {
        min-height: 120px;
        padding: 15px;
    }
    
    .record-section {
        padding: 20px;
    }
    
    .record-btn {
        width: 80px;
        height: 80px;
    }
    
    .record-icon {
        font-size: 2em;
    }
}

/* === DARK MODE === */
@media (prefers-color-scheme: dark) {
    body {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }
    
    .main-screen {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    .token-screen {
        background: #1e1e1e;
        color: #e0e0e0;
    }
    
    header {
        background: #2d2d2d;
        border-bottom-color: #333;
    }
    
    .task-actions {
        border-top-color: #333;
    }
    
    .record-section {
        background: #2d2d2d;
        border-top-color: #333;
    }
    
    .token-screen input[type="password"] {
        background: #2d2d2d;
        color: #e0e0e0;
        border-color: #444;
    }
    
    .task-info {
        color: #aaa;
    }
    
    #recordStatus {
        color: #aaa;
    }
}