/* Variables de colores basados en el logo */
:root {
    --primary-blue: #4a6fa5;
    --secondary-blue: #6b93d6;
    --light-blue: #e8f0fe;
    --accent-orange: #ff8c42;
    --text-dark: #333;
    --text-light: #666;
    --background: #f9f9f9;
    --card-bg: #ffffff;
    --shadow: 0 4px 12px rgba(0,0,0,0.1);
    --border-radius: 12px;
}

/* Reset y estilos base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: var(--background);
    color: var(--text-dark);
    line-height: 1.6;
    max-width: 100%;
    overflow-x: hidden;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo {
    font-size: 2.5rem;
    background: white;
    color: var(--primary-blue);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.subtitle {
    display: block;
    font-size: 0.9rem;
    opacity: 0.9;
    font-weight: 400;
}

.menu-toggle {
    background: transparent;
    border: 2px solid white;
    color: white;
    font-size: 1.5rem;
    width: 45px;
    height: 45px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.menu-toggle:hover {
    background: rgba(255,255,255,0.1);
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: -300px;
    top: 0;
    width: 280px;
    height: 100vh;
    background: white;
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    z-index: 1000;
    padding: 1.5rem;
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
}

.sidebar.active {
    left: 0;
}

.close-menu {
    position: absolute;
    right: 1rem;
    top: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-light);
}

.guide-list {
    list-style: none;
    margin-top: 2rem;
}

.guide-list li {
    margin-bottom: 0.8rem;
}

.guide-list a {
    display: block;
    padding: 0.8rem 1rem;
    background: var(--light-blue);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-blue);
    font-weight: 500;
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

.guide-list a.active,
.guide-list a:hover {
    background: var(--primary-blue);
    color: white;
    border-left: 4px solid var(--accent-orange);
}

.progress {
    margin-top: 2rem;
    padding: 1rem;
    background: var(--light-blue);
    border-radius: var(--border-radius);
}

.progress-bar {
    height: 10px;
    background: #ddd;
    border-radius: 5px;
    overflow: hidden;
    margin: 0.5rem 0;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-orange), #ffb347);
    width: 0%;
    transition: width 0.5s ease;
    border-radius: 5px;
}

/* Main Content */
.main-content {
    padding: 1.5rem;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.guide-card {
    display: none;
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from { transform: translateX(30px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

.guide-card.active {
    display: block;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-blue);
}

.guide-number {
    background: var(--accent-orange);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Theory Section */
.theory-section {
    background: var(--light-blue);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.table-container {
    overflow-x: auto;
    margin-top: 1rem;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

th {
    background: var(--primary-blue);
    color: white;
    padding: 1rem;
    text-align: left;
}

td {
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #eee;
}

tr:hover {
    background: #f5f9ff;
}

.comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-top: 1rem;
}

.col {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.05);
}

.col h4 {
    color: var(--primary-blue);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent-orange);
}

/* Golden Rule Exercise */
.exercise-card {
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 2px solid #ffd54f;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 2rem;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 140, 66, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(255, 140, 66, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 140, 66, 0); }
}

.phrase-box > div {
    margin-bottom: 1rem;
    padding: 0.8rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--primary-blue);
}

.audio-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
    transition: all 0.3s ease;
    width: 100%;
    justify-content: center;
}

.audio-btn:hover {
    background: var(--secondary-blue);
    transform: translateY(-2px);
}

.recording-section {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 2px dashed #ddd;
}

.record-btn, .play-btn {
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 1rem;
    margin-bottom: 1rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.record-btn {
    background: #e53935;
    color: white;
}

.record-btn:hover {
    background: #c62828;
    transform: scale(1.05);
}

.record-btn.recording {
    background: #c62828;
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(229, 57, 53, 0); }
    100% { box-shadow: 0 0 0 0 rgba(229, 57, 53, 0); }
}

.play-btn {
    background: var(--secondary-blue);
    color: white;
}

.play-btn:hover:not(:disabled) {
    background: var(--primary-blue);
}

.play-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.recording-status {
    padding: 0.8rem;
    background: #f5f5f5;
    border-radius: 8px;
    font-style: italic;
    margin-top: 1rem;
}

/* More Exercises */
.more-exercises {
    background: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border: 2px solid var(--light-blue);
}

.exercise {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
}

.answer-input, .answer-select {
    width: 100%;
    padding: 0.8rem;
    border: 2px solid #ddd;
    border-radius: 8px;
    margin: 0.8rem 0;
    font-size: 1rem;
}

.answer-input:focus, .answer-select:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(74, 111, 165, 0.1);
}

.check-btn {
    background: var(--accent-orange);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.check-btn:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

/* Navigation */
.navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding: 1rem;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.nav-btn {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.nav-btn:hover:not(:disabled) {
    background: var(--secondary-blue);
    transform: translateY(-2px);
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalSlide 0.3s ease;
}

@keyframes modalSlide {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-close {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    margin-top: 1.5rem;
}

/* Install Banner */
.install-banner {
    position: fixed;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--primary-blue), var(--secondary-blue));
    color: white;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    z-index: 1500;
    width: 90%;
    max-width: 500px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { transform: translateX(-50%) translateY(100px); opacity: 0; }
    to { transform: translateX(-50%) translateY(0); opacity: 1; }
}

#installBtn {
    background: white;
    color: var(--primary-blue);
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
}

#closeBanner {
    background: transparent;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    margin-left: auto;
}

/* Responsive */
@media (max-width: 768px) {
    .comparison {
        grid-template-columns: 1fr;
    }
    
    .navigation {
        flex-direction: column;
        gap: 1rem;
    }
    
    .current-guide {
        order: -1;
    }
    
    .install-banner {
        flex-direction: column;
        text-align: center;
    }
    
    #closeBanner {
        position: absolute;
        top: 0.5rem;
        right: 0.5rem;
    }
}

@media (max-width: 480px) {
    .header {
        padding: 1rem;
    }
    
    .logo {
        width: 40px;
        height: 40px;
        font-size: 2rem;
    }
    
    h1 {
        font-size: 1.2rem;
    }
    
    .main-content {
        padding: 1rem;
    }
    
    .guide-card {
        padding: 1rem;
    }
}