/* 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;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.app-container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 1rem 0;
    text-align: center;
    color: white;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.app-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.app-title .icon {
    font-size: 2.5rem;
}

.app-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem 1rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* Screen Management */
.screen {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.screen.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Test Mode Selection Screen */
.test-mode-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.test-mode-content h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.test-mode-subtitle {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.test-mode-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.test-mode-card {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 2rem 1.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    position: relative;
    text-align: center;
}

.test-mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.15);
    border-color: #667eea;
}

.test-mode-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea10, #764ba210);
}

.mode-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.test-mode-card h3 {
    font-size: 1.4rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.test-mode-card p {
    color: #6c757d;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.mode-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.mode-badge.recommended {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.mode-features {
    list-style: none;
    padding: 0;
    text-align: left;
    margin-top: 1rem;
}

.mode-features li {
    padding: 0.5rem 0;
    color: #495057;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
}

.mode-features li:before {
    content: "✓";
    color: #28a745;
    font-weight: bold;
    margin-right: 0.5rem;
    display: none;
}

.test-mode-card.selected .mode-features li:before {
    display: inline;
}

.test-mode-actions {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
}

/* Welcome Screen */
.welcome-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.feature-list {
    margin: 2rem 0;
}

.feature-item {
    display: flex;
    align-items: center;
    text-align: left;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 12px;
    transition: transform 0.2s ease;
}

.feature-item:hover {
    transform: translateY(-2px);
}

.feature-icon {
    font-size: 2rem;
    margin-right: 1rem;
    min-width: 60px;
}

.feature-text h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

.feature-text p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    border: none;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

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

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

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-large {
    padding: 1.5rem 3rem;
    font-size: 1.2rem;
}

.btn-record {
    background: #dc3545;
    color: white;
    padding: 1.5rem 2rem;
    border-radius: 50px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem auto;
}

.btn-record:hover {
    background: #c82333;
    transform: scale(1.05);
}

.btn-record.recording {
    background: #28a745;
    animation: pulse 1s infinite;
}

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

/* Test Screen */
.test-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.progress-indicator {
    margin-bottom: 2rem;
    text-align: center;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    font-size: 1.1rem;
    font-weight: 500;
    color: #2c3e50;
}

.test-section {
    margin-bottom: 3rem;
    text-align: center;
}

.test-section.hidden {
    display: none;
}

.test-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.test-instruction {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 2rem;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Audio Visualizer */
.audio-visualizer {
    height: 100px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 1rem 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.audio-bar {
    width: 4px;
    background: #667eea;
    margin: 0 1px;
    border-radius: 2px;
    transition: height 0.1s ease;
}

/* Motion Visualizer */
.motion-visualizer {
    height: 150px;
    background: #f8f9fa;
    border-radius: 12px;
    margin: 1rem 0;
    position: relative;
    overflow: hidden;
}

.phone-illustration {
    width: 80px;
    height: 140px;
    background: #2c3e50;
    border-radius: 12px;
    margin: 2rem auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.phone-shake-indicator {
    width: 60px;
    height: 60px;
    border: 3px solid #667eea;
    border-radius: 50%;
    animation: shake 0.5s infinite;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    75% { transform: translateX(2px); }
}

/* Processing Animation */
.processing-animation {
    text-align: center;
    padding: 3rem 0;
}

.spinner {
    width: 80px;
    height: 80px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.processing-animation h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.processing-animation p {
    color: #6c757d;
    font-size: 1.1rem;
}

/* Results Screen */
.results-content {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.result-card {
    text-align: center;
}

.result-indicator {
    margin-bottom: 3rem;
    padding: 2rem;
    border-radius: 16px;
}

.result-indicator.positive {
    background: linear-gradient(135deg, #ff6b6b, #ffa500);
    color: white;
}

.result-indicator.negative {
    background: linear-gradient(135deg, #51cf66, #40c057);
    color: white;
}

.result-indicator.insufficient {
    background: linear-gradient(135deg, #9ca3af, #6b7280);
    color: white;
}

.result-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.result-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

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

/* Confidence Bars */
.confidence-section {
    margin: 2rem 0;
    text-align: left;
}

.confidence-section h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.confidence-item {
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.confidence-item label {
    font-weight: 600;
    min-width: 120px;
    color: #2c3e50;
}

.confidence-bar {
    flex: 1;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transition: width 0.8s ease;
}

.confidence-percentage {
    font-weight: 600;
    min-width: 50px;
    text-align: right;
    color: #2c3e50;
}

/* Feature Breakdown */
.feature-breakdown {
    margin: 2rem 0;
    text-align: left;
}

.feature-breakdown h3 {
    text-align: center;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.feature-breakdown-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.feature-breakdown-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.feature-breakdown-item h4 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.feature-breakdown-item p {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Action Buttons */
.action-buttons {
    margin-top: 2rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* Real-time Metrics Display */
.metrics-container {
    margin-top: 2rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.9));
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(102, 126, 234, 0.15);
    border: 2px solid rgba(102, 126, 234, 0.2);
    animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.metrics-container h3 {
    margin: 0 0 1.5rem 0;
    color: #2c3e50;
    font-size: 1.3rem;
    font-weight: 700;
    text-align: center;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.metric-card {
    background: white;
    padding: 1rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    transition: all 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.2);
}

.metric-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 0.75rem;
    font-family: 'Courier New', monospace;
}

.metric-bar {
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.metric-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 4px;
    transition: width 0.3s ease, background 0.3s ease;
    position: relative;
    overflow: hidden;
}

.metric-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.3) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

/* Quality color coding */
.metric-fill.excellent {
    background: linear-gradient(90deg, #28a745, #20c997);
}

.metric-fill.good {
    background: linear-gradient(90deg, #ffc107, #fd7e14);
}

.metric-fill.poor {
    background: linear-gradient(90deg, #dc3545, #e83e8c);
}

/* Axis Display for Tremor */
.axis-display {
    background: white;
    padding: 1.25rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.15);
    margin-top: 1rem;
}

.axis-display h4 {
    margin: 0 0 1rem 0;
    color: #2c3e50;
    font-size: 1.1rem;
    font-weight: 600;
}

.axis-meters {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.axis-meter {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.axis-label {
    font-weight: 700;
    font-size: 1.1rem;
    min-width: 25px;
    color: #2c3e50;
    font-family: 'Courier New', monospace;
}

.axis-bar {
    flex: 1;
    height: 12px;
    background: #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    position: relative;
}

.axis-fill {
    height: 100%;
    border-radius: 6px;
    transition: width 0.2s ease;
    position: relative;
}

.axis-x {
    background: linear-gradient(90deg, #ff6b6b, #ee5a6f);
}

.axis-y {
    background: linear-gradient(90deg, #51cf66, #37b24d);
}

.axis-z {
    background: linear-gradient(90deg, #4dabf7, #339af0);
}

.axis-value {
    min-width: 60px;
    text-align: right;
    font-weight: 600;
    font-family: 'Courier New', monospace;
    color: #495057;
}

/* Status Messages */
.test-status {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 8px;
    font-weight: 500;
}

.test-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.test-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.test-status.warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

/* Disclaimer */
.disclaimer {
    margin-top: 2rem;
    padding: 1rem;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 8px;
    font-size: 0.9rem;
    color: #856404;
    text-align: left;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    text-align: center;
    padding: 1rem;
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-content {
        padding: 1rem;
    }
    
    .app-title {
        font-size: 1.5rem;
    }
    
    .feature-item {
        flex-direction: column;
        text-align: center;
    }
    
    .feature-icon {
        margin-right: 0;
        margin-bottom: 0.5rem;
    }
    
    .btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
    }
    
    /* Test mode selection responsive */
    .test-mode-options {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .test-mode-card {
        padding: 1.5rem 1rem;
    }
    
    .mode-icon {
        font-size: 2.5rem;
    }
    
    .confidence-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .confidence-item label {
        min-width: auto;
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    /* Metrics responsive */
    .metrics-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .metrics-container {
        padding: 1rem;
    }
    
    .metrics-container h3 {
        font-size: 1.1rem;
    }
    
    .metric-card {
        padding: 0.75rem;
    }
    
    .metric-value {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .welcome-content,
    .test-content,
    .results-content {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .result-indicator {
        padding: 1rem;
    }
    
    .result-title {
        font-size: 1.5rem;
    }
}

/* Utilities */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

/* Data Quality Indicators for 100% Accuracy */

.quality-indicator {
    margin: 10px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    backdrop-filter: blur(10px);
}

.quality-meter {
    width: 100%;
    height: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 5px;
}

.quality-bar {
    height: 100%;
    border-radius: 10px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.quality-meter.excellent .quality-bar {
    background: linear-gradient(90deg, #4CAF50, #8BC34A);
    box-shadow: 0 0 10px rgba(76, 175, 80, 0.5);
}

.quality-meter.good .quality-bar {
    background: linear-gradient(90deg, #FF9800, #FFC107);
    box-shadow: 0 0 10px rgba(255, 152, 0, 0.5);
}

.quality-meter.poor .quality-bar {
    background: linear-gradient(90deg, #F44336, #E91E63);
    box-shadow: 0 0 10px rgba(244, 67, 54, 0.5);
}

.quality-stats {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    text-align: center;
    font-family: 'Courier New', monospace;
}

/* Real-time Quality Indicators */
#audio-quality-indicator,
#data-quality-indicator {
    position: relative;
    margin-top: 10px;
}

.quality-pulse {
    animation: qualityPulse 2s infinite;
}

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

/* High Accuracy Data Collection Status */
.accuracy-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    margin-top: 5px;
    color: rgba(255, 255, 255, 0.9);
}

.accuracy-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4CAF50;
    animation: statusBlink 1s infinite;
}

@keyframes statusBlink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.3; }
}

/* ============================================
   ENHANCED RESULTS SCREEN STYLES
   ============================================ */

.results-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem;
}

/* Main Result Card */
.result-main-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px;
    padding: 3rem 2rem;
    text-align: center;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    margin-bottom: 2rem;
    animation: slideInDown 0.6s ease-out;
}

.result-icon-circle {
    width: 100px;
    height: 100px;
    margin: 0 auto 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(10px);
    animation: scaleIn 0.5s ease-out 0.3s both;
}

.result-icon {
    font-size: 3.5rem;
    animation: bounceIn 0.6s ease-out 0.5s both;
}

.result-indicator.positive .result-icon-circle {
    background: rgba(255, 193, 7, 0.3);
    box-shadow: 0 0 30px rgba(255, 193, 7, 0.5);
}

.result-indicator.negative .result-icon-circle {
    background: rgba(76, 175, 80, 0.3);
    box-shadow: 0 0 30px rgba(76, 175, 80, 0.5);
}

.result-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    animation: fadeIn 0.6s ease-out 0.7s both;
}

.result-subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 1rem;
    animation: fadeIn 0.6s ease-out 0.9s both;
}

.result-confidence-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.25);
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    animation: fadeIn 0.6s ease-out 1.1s both;
}

/* Confidence Grid */
.confidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out 0.3s both;
}

.confidence-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    animation: scaleIn 0.5s ease-out both;
}

.confidence-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.confidence-card h3 {
    font-size: 1rem;
    color: #2c3e50;
    margin: 0.5rem 0 1rem;
    font-weight: 600;
}

.confidence-card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

/* Circular Progress */
.confidence-circle {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1rem;
}

.confidence-circle-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.confidence-circle-bg {
    fill: none;
    stroke: #f0f0f0;
    stroke-width: 8;
}

.confidence-circle-fill {
    fill: none;
    stroke: url(#confidence-gradient);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s ease-out;
}

.confidence-circle-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.confidence-percentage-large {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
}

.confidence-label {
    font-size: 0.85rem;
    color: #6c757d;
    margin: 0;
}

/* Features Section */
.features-detailed {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    animation: slideInUp 0.6s ease-out 0.5s both;
}

.section-title {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 700;
}

.feature-category {
    margin-bottom: 2rem;
}

.feature-category:last-child {
    margin-bottom: 0;
}

.feature-category-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #f0f0f0;
}

.feature-category-header h4 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 0;
    font-weight: 600;
}

.feature-count {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.feature-item {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    border: 1px solid #dee2e6;
    transition: all 0.3s ease;
    animation: fadeInUp 0.4s ease-out both;
}

.feature-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
    border-color: #667eea;
}

.feature-item-icon {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.feature-item-name {
    font-size: 0.85rem;
    color: #495057;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feature-item-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.feature-item-unit {
    font-size: 0.75rem;
    color: #6c757d;
}

/* ML Info Card */
.ml-info-card {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    border-radius: 20px;
    padding: 2rem;
    color: white;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out 0.7s both;
}

.ml-info-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.ml-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
    display: inline-block;
    margin-bottom: 0.5rem;
}

.ml-info-header h4 {
    font-size: 1.5rem;
    margin: 0.5rem 0 0;
}

.ml-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.ml-info-item {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all 0.3s ease;
}

.ml-info-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.ml-info-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.ml-info-content h5 {
    font-size: 1rem;
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.ml-info-content p {
    font-size: 0.85rem;
    margin: 0;
    opacity: 0.9;
}

/* Action Buttons */
.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    animation: fadeIn 0.6s ease-out 0.9s both;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-icon {
    font-size: 1.2rem;
}

.btn-outline {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
}

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

/* Disclaimer */
.results-disclaimer {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 12px;
    padding: 1rem 1.5rem;
    text-align: center;
    animation: fadeIn 0.6s ease-out 1.1s both;
}

.results-disclaimer p {
    margin: 0;
    color: #856404;
    font-size: 0.9rem;
}

/* Animations */
@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .result-main-card {
        padding: 2rem 1.5rem;
    }

    .result-icon-circle {
        width: 80px;
        height: 80px;
    }

    .result-icon {
        font-size: 2.5rem;
    }

    .result-title {
        font-size: 1.8rem;
    }

    .result-subtitle {
        font-size: 1rem;
    }

    .confidence-grid {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .ml-info-grid {
        grid-template-columns: 1fr;
    }

    .results-actions {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
        justify-content: center;
    }
}
/* ========================================
   DOWNLOAD MODAL STYLES
======================================== */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f5f7fa 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideInDown 0.4s ease;
}

.modal-header {
    padding: 2rem 2rem 1rem 2rem;
    border-bottom: 2px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 24px 24px 0 0;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.8rem;
    color: #ffffff;
    font-weight: 700;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.3);
    color: #ffffff;
    font-size: 2rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    padding: 0;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    padding: 2rem;
}

.modal-description {
    font-size: 1.1rem;
    color: #4b5563;
    margin-bottom: 2rem;
    text-align: center;
}

.download-options {
    display: grid;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.download-option {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: #ffffff;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    position: relative;
    overflow: hidden;
}

.download-option::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transition: width 0.4s ease;
    z-index: 0;
}

.download-option:hover::before {
    width: 100%;
}

.download-option:hover {
    border-color: #667eea;
    box-shadow: 0 8px 24px rgba(102, 126, 234, 0.2);
    transform: translateY(-4px);
}

.download-option:active {
    transform: translateY(-2px);
}

.option-icon {
    font-size: 3rem;
    flex-shrink: 0;
    z-index: 1;
}

.option-content {
    flex: 1;
    z-index: 1;
}

.option-content h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.3rem;
    color: #1f2937;
    font-weight: 700;
}

.option-content p {
    margin: 0 0 1rem 0;
    color: #6b7280;
    font-size: 0.95rem;
}

.option-features {
    list-style: none;
    padding: 0;
    margin: 0;
}

.option-features li {
    color: #4b5563;
    font-size: 0.9rem;
    padding: 0.25rem 0;
}

.option-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 1;
}

.modal-note {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: #92400e;
    font-size: 0.9rem;
}

.modal-note strong {
    color: #78350f;
}

.download-progress {
    display: none;
    text-align: center;
    padding: 2rem;
}

.download-progress.active {
    display: block;
}

.progress-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-text {
    color: #4b5563;
    font-size: 1rem;
    font-weight: 500;
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        border-radius: 16px;
    }

    .modal-header {
        padding: 1.5rem;
        border-radius: 16px 16px 0 0;
    }

    .modal-header h2 {
        font-size: 1.4rem;
    }

    .modal-body {
        padding: 1.5rem;
    }

    .download-option {
        flex-direction: column;
        gap: 1rem;
    }

    .option-icon {
        font-size: 2.5rem;
    }

    .option-badge {
        position: static;
        align-self: flex-start;
        margin-top: 0.5rem;
    }
}

/* ========================================
   NOTIFICATION ANIMATIONS
======================================== */
@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}

.notification {
    font-weight: 500;
    font-size: 1rem;
}

/* ========================================
   PROCESSING SCREEN STYLES
======================================== */
#processing-screen {
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

#processing-screen.active {
    display: flex;
}

.processing-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
}

.processing-animation {
    margin-bottom: 2rem;
}

.spinner-large {
    width: 80px;
    height: 80px;
    border: 6px solid rgba(102, 126, 234, 0.1);
    border-top: 6px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

.processing-title {
    font-size: 2rem;
    color: #1f2937;
    margin: 1rem 0;
    font-weight: 700;
}

.processing-subtitle {
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 2rem;
}

.progress-container {
    margin: 2rem 0;
}

.progress-bar-large {
    width: 100%;
    height: 12px;
    background: #e5e7eb;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-bar-large .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    transition: width 0.3s ease;
    width: 0%;
}

.status-text {
    font-size: 1.1rem;
    color: #4b5563;
    margin: 0.5rem 0;
    font-weight: 500;
    min-height: 1.5rem;
}

.progress-percent {
    font-size: 2rem;
    color: #667eea;
    font-weight: 700;
    margin: 0.5rem 0;
}

.processing-info {
    margin-top: 2rem;
    padding: 1.5rem;
    background: rgba(102, 126, 234, 0.05);
    border-radius: 12px;
    border-left: 4px solid #667eea;
}

.processing-info p {
    margin: 0.5rem 0;
    color: #4b5563;
    font-size: 0.95rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@media (max-width: 768px) {
    .processing-title {
        font-size: 1.5rem;
    }
    
    .spinner-large {
        width: 60px;
        height: 60px;
    }
    
    .progress-percent {
        font-size: 1.5rem;
    }
}

/* Dataset Match Styles */
.dataset-match-section {
    margin: 2rem 0;
    animation: fadeInUp 0.6s ease-out;
}

.dataset-match-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 2rem;
    color: white;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
}

.dataset-match-header h3 {
    font-size: 1.5rem;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.dataset-match-subtitle {
    opacity: 0.9;
    margin: 0;
    font-size: 0.95rem;
}

.dataset-match-content {
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.match-item {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
}

.match-item:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

.match-item.healthy {
    border-left: 4px solid #27ae60;
}

.match-item.parkinsons {
    border-left: 4px solid #e74c3c;
}

.match-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.match-details {
    flex: 1;
}

.match-title {
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.match-category {
    font-size: 0.95rem;
    opacity: 0.95;
    margin-bottom: 0.2rem;
}

.match-filename {
    font-size: 0.85rem;
    opacity: 0.85;
    font-family: 'Courier New', monospace;
    margin-bottom: 0.3rem;
}

.match-confidence {
    font-size: 0.9rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
}

.match-consensus {
    margin-top: 0.5rem;
    padding: 1rem;
    border-radius: 10px;
    text-align: center;
    font-size: 1.05rem;
}

.match-consensus.healthy {
    background: rgba(39, 174, 96, 0.3);
    border: 2px solid rgba(39, 174, 96, 0.5);
}

.match-consensus.parkinsons {
    background: rgba(231, 76, 60, 0.3);
    border: 2px solid rgba(231, 76, 60, 0.5);
}

@media (max-width: 768px) {
    .dataset-match-card {
        padding: 1.5rem;
    }
    
    .match-item {
        flex-direction: column;
        text-align: center;
    }
    
    .match-icon {
        font-size: 2rem;
    }
}

/* ========================================
   CALIBRATION STYLES
   ======================================== */

/* Calibrate Button */
.btn-calibrate {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.btn-calibrate:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(240, 147, 251, 0.4);
}

.btn-calibrate .calibrate-icon {
    font-size: 1.2rem;
    transition: transform 0.3s ease;
}

.btn-calibrate:hover .calibrate-icon {
    transform: rotate(90deg);
}

.btn-calibrate .calibrate-status {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.btn-calibrate .calibrate-status.calibrated {
    background: #28a745;
}

.btn-calibrate .calibrate-status.not-calibrated {
    background: #ffc107;
}

/* Calibration Modal */
.calibration-modal {
    justify-content: center;
    align-items: center;
}

.calibration-modal .modal-content {
    max-width: 600px;
    border-radius: 24px;
    overflow: hidden;
}

.calibration-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1.5rem 2rem;
}

.calibration-header h2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    font-size: 1.5rem;
}

.calibration-header .header-icon {
    font-size: 1.8rem;
}

.calibration-header .modal-close {
    color: white;
    opacity: 0.8;
}

.calibration-header .modal-close:hover {
    opacity: 1;
}

.calibration-body {
    padding: 2rem;
}

/* Progress Steps */
.calibration-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e9ecef;
    color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.progress-step.active .step-circle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.progress-step.completed .step-circle {
    background: #28a745;
    color: white;
}

.step-label {
    font-size: 0.85rem;
    color: #6c757d;
    font-weight: 500;
}

.progress-step.active .step-label,
.progress-step.completed .step-label {
    color: #2c3e50;
}

.progress-line {
    flex: 1;
    height: 3px;
    background: #e9ecef;
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.progress-line.active {
    background: linear-gradient(90deg, #28a745, #667eea);
}

/* Calibration Sections */
.calibration-section {
    text-align: center;
    animation: fadeInUp 0.4s ease;
}

.calibration-section.hidden {
    display: none;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.calibration-section h3 {
    font-size: 1.5rem;
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.section-subtitle {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

/* Intro Section */
.calibration-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.calibration-description {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 450px;
    margin: 0 auto 1.5rem;
}

.calibration-requirements {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.requirement-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: #495057;
}

.requirement-item .req-icon {
    font-size: 1.2rem;
}

/* Sample Progress Dots */
.sample-progress {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.sample-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e9ecef;
    transition: all 0.3s ease;
}

.sample-dot.active {
    background: #667eea;
    transform: scale(1.3);
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

.sample-dot.completed {
    background: #28a745;
}

/* Recording Area */
.recording-area {
    position: relative;
    margin-bottom: 1.5rem;
}

.recording-visualizer {
    height: 120px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.recording-visualizer.recording {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border: 2px solid #667eea;
}

.visualizer-placeholder {
    text-align: center;
    color: #6c757d;
}

.visualizer-placeholder span {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
}

.visualizer-placeholder p {
    font-size: 0.9rem;
}

.calibration-audio-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    height: 100%;
    padding: 1rem;
}

.calibration-audio-bar {
    width: 6px;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 3px;
    transition: height 0.05s ease;
}

.recording-timer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: 'SF Mono', 'Monaco', monospace;
}

.recording-timer.active {
    background: linear-gradient(135deg, #dc3545, #c82333);
    animation: timerPulse 1s infinite;
}

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

/* Tremor Visualizer */
.tremor-visualizer {
    height: 150px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 1rem 2rem;
}

.tremor-visualizer.recording {
    background: linear-gradient(135deg, #667eea10 0%, #764ba210 100%);
    border: 2px solid #667eea;
}

.tremor-visualizer .phone-illustration {
    width: 60px;
    height: 100px;
    background: linear-gradient(135deg, #2c3e50, #34495e);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.1s ease;
}

.tremor-visualizer .phone-inner {
    font-size: 2rem;
}

.tremor-axes {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.tremor-axes .axis {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'SF Mono', 'Monaco', monospace;
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
    background: white;
    border-radius: 8px;
    min-width: 120px;
}

.tremor-axes .x-axis { color: #e74c3c; }
.tremor-axes .y-axis { color: #27ae60; }
.tremor-axes .z-axis { color: #3498db; }

/* Recording Instruction */
.recording-instruction {
    color: #6c757d;
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #fff3cd;
    border-radius: 10px;
    border-left: 4px solid #ffc107;
}

/* Calibration Status */
.calibration-status {
    margin-top: 1rem;
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.calibration-status.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.calibration-status.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.calibration-status.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Training Section */
.training-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.training-spinner {
    position: absolute;
    inset: 0;
    border: 4px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.training-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    animation: pulse 2s ease-in-out infinite;
}

.training-status {
    color: #6c757d;
    font-size: 1rem;
    margin-bottom: 1.5rem;
}

.training-progress {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
}

.training-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

/* Complete Section */
.complete-icon {
    font-size: 5rem;
    margin-bottom: 1rem;
    animation: bounceIn 0.6s ease;
}

@keyframes bounceIn {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.complete-message {
    color: #6c757d;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 400px;
    margin: 0 auto 1.5rem;
}

.calibration-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    color: #667eea;
}

.stat-label {
    font-size: 0.85rem;
    color: #6c757d;
}

/* Responsive */
@media (max-width: 600px) {
    .calibration-modal .modal-content {
        margin: 0.5rem;
        border-radius: 16px;
        max-height: 95vh;
        overflow-y: auto;
    }

    .calibration-header {
        padding: 1rem 1.25rem;
    }

    .calibration-header h2 {
        font-size: 1.2rem;
    }

    .calibration-body {
        padding: 1rem;
    }

    .calibration-progress {
        padding: 0;
        margin-bottom: 1.5rem;
    }

    .step-circle {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.7rem;
    }

    .progress-line {
        margin: 0 0.25rem;
        margin-bottom: 1.2rem;
    }

    .calibration-section h3 {
        font-size: 1.2rem;
    }

    .calibration-icon {
        font-size: 3rem;
    }

    .calibration-description {
        font-size: 0.9rem;
    }

    .calibration-requirements {
        padding: 1rem;
        gap: 0.5rem;
    }

    .requirement-item {
        font-size: 0.85rem;
    }

    .sample-progress {
        gap: 0.75rem;
        margin-bottom: 1rem;
    }

    .recording-area {
        margin-bottom: 1rem;
    }

    .recording-visualizer {
        height: 100px;
        border-radius: 12px;
    }

    .visualizer-placeholder span {
        font-size: 2rem;
    }

    .visualizer-placeholder p {
        font-size: 0.8rem;
    }

    .recording-timer {
        padding: 0.4rem 0.75rem;
        font-size: 0.95rem;
    }

    .recording-instruction {
        font-size: 0.85rem;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    .btn-record.btn-large {
        padding: 0.875rem 1.5rem;
        font-size: 1rem;
    }

    .calibration-stats {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 1rem;
        justify-content: center;
    }

    .stat-item {
        flex: 1;
        min-width: 80px;
    }

    .stat-value {
        font-size: 1.4rem;
    }

    .stat-label {
        font-size: 0.75rem;
    }

    .tremor-visualizer {
        flex-direction: column;
        height: auto;
        padding: 1rem;
        gap: 0.75rem;
    }

    .tremor-visualizer .phone-illustration {
        width: 50px;
        height: 80px;
    }

    .tremor-visualizer .phone-inner {
        font-size: 1.5rem;
    }

    .tremor-axes {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .tremor-axes .axis {
        min-width: auto;
        padding: 0.35rem 0.6rem;
        font-size: 0.8rem;
    }

    .training-animation {
        width: 100px;
        height: 100px;
    }

    .training-icon {
        font-size: 2.5rem;
    }

    .complete-icon {
        font-size: 4rem;
    }

    .complete-message {
        font-size: 0.9rem;
    }
}

/* Extra small screens */
@media (max-width: 400px) {
    .calibration-modal .modal-content {
        margin: 0.25rem;
    }

    .calibration-body {
        padding: 0.75rem;
    }

    .calibration-progress {
        transform: scale(0.9);
    }

    .calibration-requirements {
        padding: 0.75rem;
    }

    .requirement-item {
        font-size: 0.8rem;
    }

    .btn-large {
        padding: 0.75rem 1.25rem;
        font-size: 0.95rem;
    }

    .tremor-axes {
        gap: 0.35rem;
    }

    .tremor-axes .axis {
        padding: 0.3rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Calibration button animation for loading state */
.btn-record.recording {
    background: linear-gradient(135deg, #dc3545, #c82333);
    animation: recordPulse 1.5s ease-in-out infinite;
}

@keyframes recordPulse {
    0%, 100% { 
        box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
    }
    50% { 
        box-shadow: 0 4px 25px rgba(220, 53, 69, 0.6);
    }
}

/* Processing state for buttons */
.btn-record.processing {
    background: linear-gradient(135deg, #6c757d, #5a6268);
    pointer-events: none;
}

.btn-record.processing::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5rem;
}
