/* ============================================ */
/* CLES Apple-Style CSS - Clean Version */
/* ============================================ */

/* CSS Variables */
:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --primary: #b85c1a;
    --primary-light: #e6a017;
    --text: #1c1c1e;
    --text-secondary: #8e8e93;
    --separator: #e9ecef;
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 20px rgba(0,0,0,0.06);
    --radius-card: 24px;
}

/* Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* ============================================ */
/* App Container */
/* ============================================ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============================================ */
/* Sidebar */
/* ============================================ */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--separator);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar.open {
    transform: translateX(0);
}

/* Custom scrollbar */
.sidebar::-webkit-scrollbar {
    width: 4px;
}
.sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--primary-light);
    border-radius: 10px;
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--separator);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 10;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
}

/* User Info */
.user-info {
    padding: 20px;
    border-bottom: 1px solid var(--separator);
}

.user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(184,92,26,0.1);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 8px;
}

.user-region {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.user-top-badge {
    font-size: 0.7rem;
    background: rgba(230,160,23,0.2);
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    margin-top: 0.5rem;
    color: var(--primary-light);
}

/* ============================================ */
/* Navigation Menu */
/* ============================================ */
.nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    padding-bottom: 20px;
}

/* Regular nav items */
.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.nav-item a:hover,
.nav-item a.active {
    background: var(--bg);
    color: var(--primary);
}

.nav-icon {
    width: 24px;
    font-size: 1.2rem;
}

/* Navigation Dividers */
.nav-divider {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 0.8rem 1.5rem 0.3rem;
    letter-spacing: 0.5px;
    border-top: 0.5px solid var(--separator);
    margin-top: 0.5rem;
}

.nav-divider:first-of-type {
    border-top: none;
    margin-top: 0;
}

/* ============================================ */
/* CLES Apple-Style CSS - Working Accordion */
/* ============================================ */

:root {
    --bg: #f5f5f7;
    --surface: #ffffff;
    --primary: #b85c1a;
    --primary-light: #e6a017;
    --text: #1c1c1e;
    --text-secondary: #8e8e93;
    --separator: #e9ecef;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
}

/* App Container */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: 280px;
    background: var(--surface);
    border-right: 1px solid var(--separator);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.sidebar.open {
    transform: translateX(0);
}

/* Sidebar Header */
.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid var(--separator);
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    text-decoration: none;
}

/* User Info */
.user-info {
    padding: 20px;
    border-bottom: 1px solid var(--separator);
}

.user-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.user-role {
    font-size: 0.75rem;
    color: var(--primary);
    background: rgba(184,92,26,0.1);
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    margin-top: 8px;
}

.user-region {
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 5px;
}

.user-top-badge {
    font-size: 0.7rem;
    background: rgba(230,160,23,0.2);
    display: inline-block;
    padding: 4px 10px;
    border-radius: 20px;
    margin-top: 8px;
    color: var(--primary-light);
}

/* Navigation Menu */
.nav-menu {
    list-style: none;
    padding: 10px 0;
}

.nav-item a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    transition: background 0.2s;
}

.nav-item a:hover,
.nav-item a.active {
    background: var(--bg);
    color: var(--primary);
}

.nav-icon {
    width: 24px;
    font-size: 1.2rem;
}

/* Accordion Styles */
.nav-section {
    list-style: none;
}

.section-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--text);
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    font-size: 0.9rem;
}

.section-toggle:hover {
    background: var(--bg);
}

.toggle-icon {
    margin-left: auto;
    font-size: 0.7rem;
}

/* CRITICAL: Submenu items hidden by default */
.section-items {
    list-style: none;
    padding-left: 56px;
    display: none;
}

/* Submenu items visible when parent has 'open' class */
.nav-section.open .section-items {
    display: block;
}

/* Rotate icon when open */
.nav-section.open .toggle-icon {
    transform: rotate(180deg);
}

.section-items li a {
    display: block;
    padding: 10px 0 10px 16px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
}

.section-items li a:hover {
    color: var(--primary);
}

/* Mobile Header */
.mobile-header {
    display: none;
    background: var(--surface);
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--separator);
    z-index: 1001;
}

.hamburger {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--primary);
    padding: 8px;
}

.mobile-logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

/* Overlay */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: 24px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    border: 1px solid var(--separator);
}

/* Bottom Tabs */
.bottom-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--separator);
    padding: 8px 16px;
    justify-content: space-around;
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.tab-item span:first-child {
    font-size: 1.3rem;
}

.tab-item.active {
    color: var(--primary);
}

/* Footer */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--separator);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    .bottom-tabs {
        display: flex;
    }
    .main-content {
        padding: 80px 16px 70px 16px;
    }
}

@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
        position: relative;
    }
    .mobile-header, .bottom-tabs {
        display: none;
    }
}
/* ============================================ */
/* Mobile Header */
/* ============================================ */
.mobile-header {
    display: none;
    background: var(--surface);
    padding: 12px 16px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--separator);
    z-index: 1001;
}

.hamburger {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: var(--primary);
    padding: 8px;
}

.mobile-logo {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary);
}

/* ============================================ */
/* Overlay */
/* ============================================ */
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
}

.overlay.active {
    display: block;
}

/* ============================================ */
/* Bottom Tabs (Mobile) */
/* ============================================ */
.bottom-tabs {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--surface);
    border-top: 1px solid var(--separator);
    padding: 8px 16px;
    justify-content: space-around;
    z-index: 1000;
}

.tab-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.7rem;
    transition: color 0.2s;
}

.tab-item span:first-child {
    font-size: 1.3rem;
}

.tab-item.active,
.tab-item:hover {
    color: var(--primary);
}

/* ============================================ */
/* Main Content */
/* ============================================ */
.main-content {
    flex: 1;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* ============================================ */
/* Cards */
/* ============================================ */
.card {
    background: var(--surface);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-sm);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 0.5px solid rgba(0,0,0,0.02);
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text);
}

.card h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    color: var(--primary);
}

/* ============================================ */
/* Stats Grid */
/* ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--surface);
    border-radius: 28px;
    padding: 1.2rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.8rem;
}

/* ============================================ */
/* Buttons */
/* ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary);
    color: white;
    padding: 0.6rem 1.2rem;
    border-radius: 40px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s;
    border: none;
    cursor: pointer;
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

/* ============================================ */
/* Forms */
/* ============================================ */
.form-section {
    background: var(--surface);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--separator);
}

label {
    font-weight: 500;
    display: block;
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    color: var(--text-secondary);
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--separator);
    border-radius: 12px;
    font-size: 1rem;
    font-family: inherit;
}

/* ============================================ */
/* Badges */
/* ============================================ */
.badge {
    display: inline-block;
    background: #f0e3cf;
    padding: 0.2rem 0.8rem;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    color: #7a4b1a;
}

.badges-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.badge-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.7rem;
    border-radius: 30px;
    font-size: 0.7rem;
    font-weight: 500;
    background: #f0e3cf;
    color: #7a4b1a;
}

/* Role Badges */
.role-contributor {
    background: #e3f2fd;
    color: #1976d2;
}
.role-moderator {
    background: #fff3e0;
    color: #e6a017;
}
.role-admin {
    background: #fce4ec;
    color: #c62828;
}

/* Level Badges */
.badge-gold {
    background: #fff8e1;
    color: #f57f17;
    border-left: 3px solid #ffd700;
}
.badge-silver {
    background: #f5f5f5;
    color: #757575;
    border-left: 3px solid #c0c0c0;
}
.badge-bronze {
    background: #fff3e0;
    color: #e65100;
    border-left: 3px solid #cd7f32;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: bold;
    color: white;
}
.status-verified { background: #2a7a2a; }
.status-pending { background: #e6a017; }
.status-draft { background: #666; }
.status-rejected { background: #a13e3e; }

/* ============================================ */
/* Tables */
/* ============================================ */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border-radius: 20px;
    overflow: hidden;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 0.5px solid var(--separator);
}

th {
    background: #2c2b28;
    color: white;
}

/* ============================================ */
/* Success/Error Messages */
/* ============================================ */
.success {
    background: #d4edda;
    color: #155724;
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}
.error {
    background: #f8d7da;
    color: #721c24;
    padding: 0.8rem;
    border-radius: 12px;
    margin-bottom: 1rem;
}

/* ============================================ */
/* Footer */
/* ============================================ */
footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 0.5px solid var(--separator);
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* ============================================ */
/* Utilities */
/* ============================================ */
.text-center { text-align: center; }
.mt-2 { margin-top: 1rem; }
.mb-2 { margin-bottom: 1rem; }

/* ============================================ */
/* Responsive Design */
/* ============================================ */

/* Tablet & Mobile */
@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .bottom-tabs {
        display: flex;
    }
    
    .main-content {
        padding: 80px 16px 70px 16px;
    }
    
    .sidebar {
        width: 80%;
        max-width: 320px;
        top: 0;
        height: 100%;
        padding-bottom: 80px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .sidebar {
        transform: translateX(0);
        position: relative;
    }
    
    .main-content {
        margin-left: 0;
        padding: 20px;
    }
    
    .mobile-header,
    .bottom-tabs {
        display: none;
    }
    
    .overlay {
        display: none !important;
    }
}

/* Small Phones */
@media (max-width: 480px) {
    .card {
        padding: 1rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    .stats-grid {
        gap: 0.5rem;
    }
    
    .stat-card {
        padding: 0.8rem;
    }
    
    .stat-number {
        font-size: 1.8rem;
    }
    
    .sidebar {
        width: 85%;
    }
    
    .section-items {
        padding-left: 48px;
    }
    
    .main-content {
        padding: 70px 12px 65px 12px;
    }
}

/* Mini audio player styles */
.audio-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #f5f5f7;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9rem;
    margin-left: 0.25rem;
    vertical-align: middle;
}

.audio-mini:hover {
    background: #e6a017;
    color: white;
    transform: scale(1.05);
}

.audio-mini.playing {
    background: #e6a017;
    color: white;
}

.word-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.word-title {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.3rem;
}

.word-title h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: #b85c1a;
    margin: 0;
}

.word-title .phonetic {
    font-size: 1rem;
    color: #8e8e93;
    margin-left: 0.3rem;
}

.example-audio {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.3rem;
}

.example-audio .audio-mini {
    width: 24px;
    height: 24px;
    font-size: 0.8rem;
}

/* For inline word display */
.word-with-audio {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    flex-wrap: wrap;
}
/* Yonkal AI Lookup Section */
.yonkal-lookup {
    background: linear-gradient(135deg, #2a1a0a, #3a2a1a);
    border-radius: 20px;
    padding: 1rem;
    margin-bottom: 2rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    border: 1px solid #e6a017;
}

.yonkal-lookup input {
    flex: 2;
    padding: 0.7rem 1rem;
    border: 1px solid #e6a017;
    border-radius: 40px;
    font-size: 0.9rem;
    background: #1a0a00;
    color: #e6a017;
}

.yonkal-lookup input::placeholder {
    color: #8e6a3a;
}

.yonkal-lookup button {
    background: #e6a017;
    border: none;
    padding: 0.7rem 1.2rem;
    border-radius: 40px;
    color: #2a1a0a;
    cursor: pointer;
    font-weight: 500;
}

.yonkal-loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #e9ecef;
    border-top-color: #e6a017;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.yonkal-response {
    background: #2a1a0a;
    padding: 0.8rem;
    border-radius: 16px;
    font-size: 0.85rem;
    color: #e6a017;
    border-left: 4px solid #e6a017;
}

.yonkal-response strong {
    color: #ffc107;
}
