/* Professional Medical Design for Heart Sounds Education App - MEDEUON */

* {
    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, #f0f4f8 0%, #e2e8f0 100%);
    min-height: 100vh;
    color: #1e293b;
    line-height: 1.6;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("heart-pattern.svg");
    pointer-events: none;
    z-index: 0;
}

body > * {
    position: relative;
    z-index: 1;
}

/* Login Page */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 50%, #0f172a 100%);
    min-height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: white;
    border-radius: 16px;
    padding: 45px 35px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.logo-container {
    text-align: center;
    margin-bottom: 25px;
}

.logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto;
}

.title-with-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 8px;
}

.icon-heart-large {
    width: 32px;
    height: 32px;
    animation: heartbeat 1.5s ease-in-out infinite;
}

@keyframes heartbeat {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.login-card h1 {
    text-align: center;
    color: #0f172a;
    margin: 0;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.subtitle {
    text-align: center;
    color: #64748b;
    margin-bottom: 35px;
    font-size: 14px;
    font-weight: 500;
}

.form-group {
    margin-bottom: 22px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #334155;
    font-weight: 600;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s;
    background: #f8fafc;
}

.form-group input:focus {
    outline: none;
    border-color: #1e40af;
    background: white;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(30, 64, 175, 0.3);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.btn-primary:active {
    transform: translateY(0);
}

.error-message {
    background: #fef2f2;
    color: #dc2626;
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 22px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #fecaca;
}

.login-note {
    text-align: center;
    margin-top: 25px;
    font-size: 12px;
    color: #94a3b8;
}

/* Header */
.header {
    background: white;
    padding: 16px 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 2px solid #e2e8f0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 45px;
    width: auto;
}

.icon-heart-header {
    width: 28px;
    height: 28px;
    animation: heartbeat 2s ease-in-out infinite;
}

.header-logo-small {
    height: 35px;
    width: auto;
}

.header h1 {
    font-size: 20px;
    color: #0f172a;
    font-weight: 700;
    margin: 0;
}

.header h2 {
    font-size: 18px;
    color: #0f172a;
    font-weight: 700;
    margin: 0;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 18px;
    font-size: 14px;
    color: #475569;
    font-weight: 500;
}

.logout-btn {
    background: #dc2626;
    color: white;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.3s;
}

.logout-btn:hover {
    background: #b91c1c;
    box-shadow: 0 4px 6px -1px rgba(220, 38, 38, 0.3);
}

.back-btn {
    color: #1e40af;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    transition: color 0.3s;
}

.back-btn:hover {
    color: #1e3a8a;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px;
}

/* Stats Bar */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-item {
    background: white;
    padding: 24px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
    transition: all 0.3s;
    position: relative;
}

.stat-item:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.stat-icon {
    width: 32px;
    height: 32px;
    color: #1e40af;
    margin-bottom: 12px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 600;
}

.stat-value {
    display: block;
    font-size: 32px;
    font-weight: 700;
    color: #1e40af;
}

/* Categories */
.categories {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.category-card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    border: 1px solid #e2e8f0;
}

.category-title {
    font-size: 22px;
    color: #0f172a;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

.category-title::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url("heart.png");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.sounds-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sound-item {
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s;
    overflow: hidden;
    background: #f8fafc;
}

.sound-item:hover {
    border-color: #1e40af;
    transform: translateX(4px);
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.15);
    background: white;
}

.sound-item.listened {
    border-color: #f59e0b;
    background: #fffbeb;
}

.sound-item.completed {
    border-color: #10b981;
    background: #ecfdf5;
}

.sound-link {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    text-decoration: none;
    color: #1e293b;
    gap: 16px;
}

.sound-icon {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e2e8f0;
    border-radius: 10px;
    flex-shrink: 0;
    color: #475569;
}

.sound-icon svg {
    width: 20px;
    height: 20px;
}

.sound-item.completed .sound-icon {
    background: #10b981;
    color: white;
}

.sound-item:hover .sound-icon {
    background: #1e40af;
    color: white;
    transform: scale(1.1);
    transition: all 0.3s;
}

.sound-name {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    color: #0f172a;
}

.sound-status {
    font-size: 12px;
    color: #64748b;
    padding: 5px 12px;
    background: rgba(15, 23, 42, 0.05);
    border-radius: 6px;
    font-weight: 600;
}

/* Player Page */
.player-container {
    max-width: 650px;
    margin: 24px auto;
    padding: 0 24px;
}

.player-card {
    background: white;
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #e2e8f0;
}

.player-info {
    text-align: center;
    margin-bottom: 32px;
}

.player-heart-icon {
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
}

.player-heart-icon svg {
    width: 60px;
    height: 60px;
    animation: heartbeat 1.5s ease-in-out infinite;
    filter: drop-shadow(0 4px 6px rgba(220, 38, 38, 0.3));
}

.player-info h3 {
    font-size: 26px;
    color: #0f172a;
    margin-bottom: 12px;
    font-weight: 700;
}

.category-badge {
    display: inline-block;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    padding: 7px 18px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    box-shadow: 0 2px 4px rgba(30, 64, 175, 0.2);
}

.audio-player-wrapper {
    margin: 32px 0;
}

.audio-player-wrapper audio {
    width: 100%;
    border-radius: 10px;
}

.player-controls {
    display: flex;
    gap: 16px;
    justify-content: center;
    margin: 28px 0;
}

.control-btn {
    padding: 13px 28px;
    background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 6px -1px rgba(30, 64, 175, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
}

.btn-icon {
    width: 18px;
    height: 18px;
}

.control-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(30, 64, 175, 0.3);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
}

.control-btn:active {
    transform: translateY(0);
}

.progress-info {
    margin-top: 28px;
}

.progress-info p {
    text-align: center;
    margin-bottom: 12px;
    font-weight: 600;
    color: #475569;
    font-size: 15px;
}

.progress-bar {
    width: 100%;
    height: 10px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #1e40af 0%, #1e3a8a 100%);
    width: 0%;
    transition: width 0.3s;
    border-radius: 10px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 12px;
        text-align: center;
        padding: 14px 20px;
    }
    
    .header-left {
        flex-direction: column;
        gap: 10px;
    }
    
    .header h1 {
        font-size: 18px;
    }
    
    .header h2 {
        font-size: 16px;
    }
    
    .header-logo {
        height: 40px;
    }
    
    .stats-bar {
        grid-template-columns: 1fr;
    }
    
    .stat-value {
        font-size: 28px;
    }
    
    .category-title {
        font-size: 20px;
    }
    
    .sound-name {
        font-size: 15px;
    }
    
    .player-card {
        padding: 24px;
    }
    
    .player-info h3 {
        font-size: 22px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 35px 25px;
    }
    
    .logo {
        max-width: 150px;
    }
    
    .container {
        padding: 16px;
    }
    
    .category-card {
        padding: 20px;
    }
    
    .sound-link {
        padding: 14px 16px;
        gap: 12px;
    }
    
    .player-controls {
        flex-direction: column;
    }
    
    .control-btn {
        width: 100%;
    }
    
    .header-logo-small {
        height: 30px;
    }
}
