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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: background 0.3s ease;
}

body.recording {
    background: #cc0000 !important;
}

.hidden {
    display: none !important;
}

/* Login Screen */
.login-container {
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    text-align: center;
}

.card h2 {
    color: #333;
    margin-bottom: 16px;
}

.card p {
    color: #666;
    margin-bottom: 20px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Main App Container */
.app-container {
    height: 100%;
    width: 100%;
    position: relative;
    overflow: hidden;
}

/* Logout Button */
.logout-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 6px 12px;
    font-size: 0.75rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    cursor: pointer;
    z-index: 10;
}

/* Main Screen */
.main-screen {
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: 50px 16px 16px 16px;
    gap: 12px;
}

/* Record Button */
.record-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.95);
    color: #333;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
}

.record-btn .mic-icon {
    font-size: 1.5rem;
}

body.recording .record-btn {
    background: white;
    color: #cc0000;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* Text Area */
.note-textarea {
    flex: 1;
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.2rem;
    line-height: 1.5;
    resize: none;
    background: rgba(255, 255, 255, 0.95);
}

.note-textarea:focus {
    outline: none;
}

/* Interim Text */
.interim-text {
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: white;
    font-size: 0.9rem;
    min-height: 32px;
    flex-shrink: 0;
}

.interim-text:empty {
    display: none;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.cancel-btn, .save-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
}

.cancel-btn {
    background: rgba(255, 255, 255, 0.3);
    color: white;
}

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

.cancel-btn:disabled, .save-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

body.recording .save-btn {
    color: #cc0000;
}

body.recording .cancel-btn {
    background: rgba(255, 255, 255, 0.2);
}

/* Autosave Timer */
.autosave-timer {
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.9rem;
    padding: 8px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    flex-shrink: 0;
}

/* Swipe Hint */
.swipe-hint {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    flex-shrink: 0;
}

/* History Panel */
.history-panel {
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: white;
    transition: right 0.3s ease;
    z-index: 100;
    display: flex;
    flex-direction: column;
}

.history-panel.open {
    right: 0;
}

.history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.history-header h2 {
    color: #333;
    font-size: 1.2rem;
}

.close-history-btn {
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notes-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.note-item {
    padding: 12px;
    background: #f8f8f8;
    border-radius: 8px;
    margin-bottom: 8px;
    border-left: 3px solid #667eea;
    font-size: 0.95rem;
    line-height: 1.4;
}

.placeholder {
    color: #888;
    text-align: center;
    padding: 40px 20px;
}

/* Status Bar */
.status-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    z-index: 1000;
    animation: slideUp 0.3s ease;
}

.status-bar.error {
    background: #ff4757;
}

.status-bar.success {
    background: #2ed573;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}
