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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

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

header {
    text-align: center;
    margin-bottom: 30px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

.recording-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    text-align: center;
}

.record-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.record-btn {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(45deg, #ff6b6b, #ee5a24);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.record-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 20px rgba(0,0,0,0.3);
}

.record-btn.recording {
    background: linear-gradient(45deg, #e74c3c, #c0392b);
    animation: pulse 2s infinite;
}

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

.record-indicator {
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    position: absolute;
    top: 10px;
    right: 10px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.record-btn.recording .record-indicator {
    opacity: 1;
    animation: blink 1s infinite;
}

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

.recording-status {
    font-size: 1.1rem;
    color: #666;
    font-weight: 500;
}

.audio-visualizer {
    width: 100%;
    height: 60px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-top: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.visualizer-bars {
    display: flex;
    align-items: center;
    gap: 2px;
}

.visualizer-bar {
    width: 3px;
    background: linear-gradient(to top, #667eea, #764ba2);
    border-radius: 2px;
    transition: height 0.1s ease;
}

.analysis-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.analysis-section h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.result-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
    padding: 25px;
    border-left: 5px solid;
    transition: transform 0.3s ease;
}

.result-card:hover {
    transform: translateY(-5px);
}

.mood-card {
    border-left-color: #ff6b6b;
}

.health-card {
    border-left-color: #51cf66;
}

.music-card {
    border-left-color: #339af0;
}

.advice-card {
    border-left-color: #ffd43b;
}

.result-card h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

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

.mood-emoji {
    font-size: 3rem;
    margin-bottom: 10px;
}

.mood-text {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #333;
}

.mood-confidence {
    font-size: 0.9rem;
    color: #666;
}

.health-indicators {
    margin-bottom: 15px;
}

.health-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 8px;
    background: white;
    border-radius: 8px;
}

.health-advice {
    background: #e8f5e8;
    padding: 15px;
    border-radius: 10px;
    color: #2d5a2d;
}

.music-suggestions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.music-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border-radius: 8px;
}

.music-emoji {
    font-size: 1.5rem;
}

.advice-content {
    line-height: 1.6;
    color: #333;
}

.chat-section {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.chat-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.chat-container {
    border: 2px solid #e9ecef;
    border-radius: 15px;
    height: 400px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.4;
}

.user-message {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.assistant-message {
    align-self: flex-start;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e9ecef;
}

.chat-input {
    display: flex;
    padding: 15px;
    border-top: 2px solid #e9ecef;
    gap: 10px;
}

.chat-input input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
}

.chat-input input:focus {
    border-color: #667eea;
}

.send-btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.send-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

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

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .results-grid {
        grid-template-columns: 1fr;
    }
    
    .record-btn {
        width: 100px;
        height: 100px;
    }
    
    .chat-container {
        height: 300px;
    }
}