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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

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

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

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

main {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.pet-selector {
    margin-bottom: 30px;
}

.pet-selector label {
    font-weight: bold;
    display: block;
    margin-bottom: 15px;
    color: #555;
}

.pet-options {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
}

.pet-btn {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 15px;
    padding: 15px 25px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.pet-btn:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.pet-btn.active {
    background: #6366f1;
    color: white;
    border-color: #6366f1;
}

.recorder-section {
    text-align: center;
    margin: 40px 0;
}

#waveform {
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    max-width: 100%;
    height: auto;
}

.record-btn {
    background: #ef4444;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 20px 40px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 5px 20px rgba(239,68,68,0.3);
}

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

.record-btn.recording {
    background: #10b981;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

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

.timer {
    margin-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #6366f1;
}

.result-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin: 30px 0;
}

.result-section h2 {
    color: #6366f1;
    margin-bottom: 20px;
}

.emotion-display {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 25px;
}

.emotion-icon {
    font-size: 4rem;
    animation: bounce 1s ease;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-20px); }
    60% { transform: translateY(-10px); }
}

.emotion-details h3 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
}

.emotion-details p {
    color: #666;
    margin-bottom: 15px;
}

.confidence {
    display: flex;
    align-items: center;
    gap: 10px;
}

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

.confidence-fill {
    height: 100%;
    background: #10b981;
    transition: width 0.5s ease;
}

.suggestions {
    background: #fffbeb;
    border-left: 4px solid #f59e0b;
    border-radius: 8px;
    padding: 15px 20px;
    margin-top: 20px;
}

.suggestions p {
    margin: 0;
    color: #92400e;
}

.history-section {
    margin-top: 40px;
}

.history-section h2 {
    color: #6366f1;
    margin-bottom: 20px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.history-item {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
}

.history-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.history-pet, .history-emotion {
    font-size: 1.5rem;
}

.history-confidence {
    background: #6366f1;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
}

.history-time {
    margin-left: auto;
    color: #666;
    font-size: 0.9rem;
}

footer {
    text-align: center;
    color: white;
    margin-top: 40px;
}

.lang-selector {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.lang-btn {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.1);
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .pet-options {
        justify-content: center;
    }
    
    .emotion-display {
        flex-direction: column;
        text-align: center;
    }
    
    #waveform {
        width: 100%;
    }
    
    .history-item {
        flex-wrap: wrap;
    }
    
    .history-time {
        margin-left: 0;
        width: 100%;
        text-align: right;
    }
}