/* ================================
   CHITONGA LEARNING WEBSITE
   Green & White Theme Stylesheet
   ================================ */

/* ===== RESET & 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: #2c3e50;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    min-height: 100vh;
}

/* ===== CONTAINER ===== */
.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

/* ===== HEADER ===== */
header {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    margin-bottom: 30px;
    text-align: center;
}

h1 {
    color: #059669;
    font-size: 2.5em;
    margin-bottom: 10px;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2em;
    font-style: italic;
}

/* ===== SEARCH BAR ===== */
.search-container {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    position: relative;
}

#searchInput {
    width: 100%;
    padding: 15px 45px 15px 15px;
    font-size: 1.1em;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    transition: all 0.3s;
    font-family: inherit;
}

#searchInput:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.clear-btn {
    position: absolute;
    right: 30px;
    top: 50%;
    transform: translateY(-50%);
    background: #e0e0e0;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.2em;
    color: #666;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.clear-btn:hover {
    background: #d0d0d0;
}

.clear-btn.visible {
    display: flex;
}

/* ===== SEARCH RESULTS ===== */
.search-results {
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    max-height: 500px;
    overflow-y: auto;
    display: none;
}

.search-results.visible {
    display: block;
}

.search-results-header {
    padding: 15px 20px;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
    font-weight: 600;
    color: #059669;
    border-radius: 10px 10px 0 0;
}

.no-results {
    padding: 40px 20px;
    text-align: center;
    color: #7f8c8d;
}

/* ===== NAVIGATION ===== */
nav {
    background: white;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    margin-bottom: 30px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

.nav-btn {
    background: #10b981;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 1em;
    transition: all 0.3s;
    font-weight: 600;
}

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

.nav-btn.active {
    background: #047857;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

/* ===== SECTIONS ===== */
.section {
    display: none;
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.section.active {
    display: block;
    animation: fadeIn 0.5s;
}

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

/* ===== PHRASE CARDS ===== */
.phrase-card {
    background: #f8f9fa;
    padding: 25px;
    margin-bottom: 20px;
    border-radius: 10px;
    border-left: 5px solid #10b981;
    transition: all 0.3s;
}

.phrase-card:hover {
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    transform: translateX(5px);
}

.phrase-card.highlight {
    background: #d1fae5;
    border-left-color: #047857;
    animation: highlightPulse 1s ease-in-out;
}

@keyframes highlightPulse {
    0%, 100% { background: #d1fae5; }
    50% { background: #a7f3d0; }
}

.tonga {
    font-size: 1.5em;
    color: #059669;
    font-weight: 600;
    margin-bottom: 10px;
}

.english {
    font-size: 1.1em;
    color: #555;
    margin-bottom: 15px;
}

/* ===== BUTTONS ===== */
.play-button {
    background: #059669;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.9em;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.play-button:hover {
    background: #047857;
    transform: scale(1.05);
}

.play-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
}

.play-button:active {
    transform: scale(0.98);
}

/* ===== CATEGORY TITLES ===== */
.category-title {
    color: #059669;
    font-size: 1.8em;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 3px solid #10b981;
}

/* ===== TEXT CONTENT ===== */
.intro-text {
    font-size: 1.1em;
    line-height: 1.8;
    color: #555;
    margin-bottom: 20px;
}

/* ===== WELCOME BOX ===== */
.welcome-box {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    padding: 30px;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.welcome-box h2 {
    font-size: 2em;
    margin-bottom: 15px;
}

/* ===== NOTE BOXES ===== */
.note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 15px;
    margin: 20px 0;
    border-radius: 5px;
}

.note strong {
    display: block;
    margin-bottom: 8px;
    color: #856404;
}

.note ul {
    margin-top: 10px;
}

.note ul li {
    margin-bottom: 8px;
    color: #856404;
}

.note code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.note pre {
    background: white;
    padding: 15px;
    border-radius: 5px;
    margin-top: 10px;
    overflow-x: auto;
    font-size: 0.85em;
    line-height: 1.5;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    h1 {
        font-size: 1.8em;
    }
    
    .tonga {
        font-size: 1.3em;
    }
    
    nav {
        flex-direction: column;
    }
    
    .nav-btn {
        width: 100%;
    }

    #searchInput {
        font-size: 1em;
        padding: 12px 40px 12px 12px;
    }

    .container {
        padding: 15px;
    }

    .phrase-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    header {
        padding: 20px;
    }

    h1 {
        font-size: 1.5em;
    }

    .subtitle {
        font-size: 1em;
    }

    .category-title {
        font-size: 1.5em;
    }

    .welcome-box h2 {
        font-size: 1.5em;
    }
}

/* ===== SCROLLBAR STYLING ===== */
.search-results::-webkit-scrollbar {
    width: 8px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #10b981;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb:hover {
    background: #059669;
}

/* ===== ACCESSIBILITY ===== */
.nav-btn:focus,
.play-button:focus,
#searchInput:focus {
    outline: 2px solid #047857;
    outline-offset: 2px;
}

/* ===== PRINT STYLES ===== */
@media print {
    body {
        background: white;
    }

    .search-container,
    nav,
    .play-button {
        display: none;
    }

    .section {
        display: block !important;
        page-break-inside: avoid;
    }

    .phrase-card {
        page-break-inside: avoid;
        border: 1px solid #ddd;
    }
}
