:root {
    --primary-color: #0f172a;
    --secondary-color: #f59e0b;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #334155;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --header-bg: #dde8f6; /* Similar to the DDEBF7 word doc color */
    --sub-header-bg: #f1f5f9; /* Similar to F2F2F2 word doc color */
    
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Rubik', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Navbar */
.navbar {
    background-color: var(--primary-color);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--secondary-color);
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--secondary-color);
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: var(--transition);
}

.nav-links a.active::after {
    width: 100%;
}

/* App Container */
.app-container {
    display: flex;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background-color: white;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 74px); /* Adjust based on navbar height */
    position: sticky;
    top: 74px;
    overflow: hidden;
    transition: var(--transition);
    z-index: 100;
}

.sidebar-header {
    padding: 1.5rem;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar-header h3 {
    color: var(--primary-color);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.sidebar-stats {
    padding: 1rem 1.5rem;
    background-color: var(--sub-header-bg);
    border-bottom: 1px solid var(--border-color);
}

.stat-question {
    font-weight: 600;
    color: var(--secondary-color);
    cursor: pointer;
    transition: color 0.2s;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
}

.stat-question:hover {
    color: #d97706;
}

.stat-answer {
    margin-top: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-main);
    animation: fadeIn 0.3s ease;
    padding: 0.5rem;
    background: white;
    border-radius: 4px;
    border: 1px dashed var(--border-color);
}

.close-sidebar-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-light);
    cursor: pointer;
}

.sidebar-search {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-search input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: inherit;
    outline: none;
}

.sidebar-search input:focus {
    border-color: var(--secondary-color);
}

.sidebar-word-list {
    list-style: none;
    overflow-y: auto;
    flex: 1;
}

.sidebar-word-list li {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    direction: ltr; /* English words */
    text-align: left;
    font-weight: 500;
    color: var(--primary-color);
    transition: background-color 0.2s;
}

.sidebar-word-list li:hover {
    background-color: var(--sub-header-bg);
    color: var(--secondary-color);
}

.mobile-sidebar-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: var(--secondary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    cursor: pointer;
    z-index: 1000;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 2rem;
    width: 100%;
}

.page {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.page.active {
    display: block;
}

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

/* Hero & Search */
.hero {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem 0;
}

.hero h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.hero h2 {
    font-size: 1.6rem;
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 500;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 2rem;
}

.search-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.sticky-note-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
    margin-bottom: 2rem;
}

.sticky-note {
    position: relative;
    background-color: #fef08a; /* Yellow sticky note color */
    color: #854d0e;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.1);
    transform: rotate(-2deg);
    font-size: 1.05rem;
    max-width: 90%;
    display: inline-block;
}

.sticky-note::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 20px;
    height: 20px;
    background: linear-gradient(135deg, transparent 50%, rgba(0,0,0,0.05) 50%);
    border-bottom-right-radius: 4px;
}

.pin-icon {
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    color: #dc2626;
    font-size: 1.5rem;
    text-shadow: 1px 2px 3px rgba(0,0,0,0.2);
}

.sticky-note a {
    color: #b91c1c;
    text-decoration: underline;
    font-weight: 600;
}

.sticky-note a:hover {
    color: #991b1b;
}

/* Feedback Widget */
.feedback-widget-wrapper {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.feedback-widget {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
    border: 1px solid #bfdbfe;
    padding: 1.2rem;
    border-radius: 12px;
    width: 220px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    text-align: right;
    transition: transform 0.3s, box-shadow 0.3s;
}

.feedback-widget:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.feedback-widget h3 {
    color: #1e40af;
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.feedback-widget p {
    color: #475569;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    line-height: 1.4;
}

.feedback-btn {
    display: block;
    text-align: center;
    background-color: #3b82f6;
    color: white;
    padding: 0.5rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: background-color 0.2s;
}

.feedback-btn:hover {
    background-color: #2563eb;
}

.search-container {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-radius: 50px;
}

.search-icon {
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.2rem;
}

#searchInput {
    width: 100%;
    padding: 1.2rem 3rem 1.2rem 1.5rem;
    border: 2px solid transparent;
    border-radius: 50px;
    font-size: 1.2rem;
    font-family: inherit;
    background-color: white;
    transition: var(--transition);
    outline: none;
    direction: ltr; /* English input */
    text-align: left;
}

#searchInput:focus {
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.1);
}

.results-info {
    text-align: center;
    margin-bottom: 2rem;
    font-weight: 500;
    color: var(--text-light);
}

/* Results Grid */
.results-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Card Design (Table Alternative) */
.word-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    border: 1px solid var(--border-color);
    transition: var(--transition);
}

.word-card:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.card-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background-color: var(--header-bg);
    border-bottom: 2px solid var(--border-color);
}

.header-cell {
    padding: 1rem;
    font-weight: 600;
    text-align: center;
    color: var(--primary-color);
}

.header-cell:first-child {
    border-left: 1px solid var(--border-color);
}

.word-pair-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: 1px solid var(--border-color);
}

.pair-cell {
    padding: 1rem;
    text-align: center;
    font-size: 1.1rem;
}

.pair-cell.english {
    direction: ltr;
    font-weight: 500;
    border-right: 1px solid var(--border-color);
    color: var(--primary-color);
}

.section-header {
    background-color: var(--sub-header-bg);
    padding: 0.75rem 1rem;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    color: var(--primary-color);
}

.section-content {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    white-space: pre-line;
}

.section-content:last-child {
    border-bottom: none;
}

/* Highlight matching text */
.highlight {
    background-color: rgba(245, 158, 11, 0.3);
    padding: 0 2px;
    border-radius: 3px;
    font-weight: 600;
}

/* Static Pages */
.content-box {
    background: white;
    padding: 3rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.content-box h2 {
    color: var(--primary-color);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 2rem;
}

.text-content {
    font-size: 1.2rem;
    line-height: 1.9;
    color: #334155;
    max-width: 850px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: justify;
}

.text-content h3 {
    margin-top: 2.5rem;
    margin-bottom: 1.2rem;
    color: var(--primary-color);
    font-size: 1.4rem;
    border-bottom: 2px solid var(--secondary-color);
    display: inline-block;
    padding-bottom: 0.3rem;
}

.text-content p {
    margin-bottom: 1.5rem;
}

.bullet-item {
    margin-bottom: 1.2rem !important;
    padding-right: 1.5rem;
    position: relative;
}

.bullet-title {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.25rem;
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 0.1rem;
    display: inline-block;
}

.nav-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 1.5rem;
    font-size: 1.1rem;
    font-family: inherit;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.nav-button:hover {
    background-color: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.example-box {
    background: #f8fafc;
    border-right: 4px solid var(--secondary-color);
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.example-word {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 1.25rem;
    display: block;
    margin-bottom: 0.5rem;
}

.example-explanation {
    color: #475569;
    font-size: 1.1rem;
}

.memory-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.memory-table td {
    border: 1px solid var(--secondary-color);
    padding: 0.5rem 1rem;
    vertical-align: middle;
}

.placeholder-content {
    text-align: center;
    color: var(--text-light);
    padding: 3rem 0;
}

.placeholder-content i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 1.5rem;
}

.placeholder-content p {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.temp-note {
    color: var(--secondary-color) !important;
    font-weight: 500;
}

/* Footer */
footer {
    text-align: center;
    padding: 1.5rem;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    color: var(--text-color);
    margin-top: auto;
}

.footer-donate-link {
    color: var(--secondary-color);
    text-decoration: underline;
    font-size: 0.9rem;
    transition: color 0.2s;
}

.footer-donate-link:hover {
    color: #ef4444; /* soft red on hover */
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav-links {
        width: 100%;
        justify-content: center;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .word-pair-row, .card-header-row {
        grid-template-columns: 1fr;
    }
    
    .header-cell:first-child {
        border-left: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .pair-cell.english {
        border-right: none;
        border-top: 1px dashed var(--border-color);
        background-color: #fafafa;
    }
}

@media (max-width: 992px) {
    .feedback-widget-wrapper {
        position: static;
        display: flex;
        justify-content: center;
        margin: 2rem 0;
        width: 100%;
    }
    
    .feedback-widget {
        width: 90%;
        max-width: 300px;
    }

    .sidebar {
        position: fixed;
        right: -300px; /* Hide off screen */
        top: 0;
        height: 100vh;
        z-index: 2000;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        border-left: none;
    }
    
    .sidebar.open {
        right: 0;
    }
    
    .close-sidebar-btn {
        display: block;
    }
    
    .mobile-sidebar-toggle {
        display: block;
    }
}

/* Beginner Explanation */
.beginner-header {
    background-color: #f1f8e9; /* Light green background */
    color: #2e7d32;
    border-top: 1px solid #c5e1a5;
    border-bottom: 1px solid #c5e1a5;
}

.beginner-content {
    background-color: #f9fbe7;
}

/* Dictionary Images extracted from Word */
.dictionary-image {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
    display: block;
    margin: 15px auto;
    box-shadow: 0 2px 5px rgba(0,0,0,0.15);
}

.header-disclaimer {
    font-size: 0.75rem;
    color: #cbd5e1; /* Subtle light gray */
    font-weight: 300;
    white-space: nowrap;
    opacity: 0.9;
}
