/* assets/css/style.css */
:root {
    --primary: #58CC02;
    --primary-dark: #46A302;
    --secondary: #1CB0F6;
    --secondary-dark: #1899D6;
    --accent: #FFC800;
    --error: #EA2B2B;
    --text: #4B4B4B;
    --text-light: #777777;
    --bg: #FFFFFF;
    --gray-light: #F7F7F7;
    --gray-border: #E5E5E5;
    --shadow: 0 4px 0px 0px rgba(0,0,0,0.1);
}

/* Dark Mode Variables */
:root.dark-mode, body.dark-mode {
    --bg: #121212;
    --text: #e0e0e0;
    --text-light: #b0b0b0;
    --gray-light: #1e1e1e;
    --gray-border: #333333;
    --shadow: 0 4px 0px 0px rgba(0,0,0,0.5);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Outfit', 'Inter', sans-serif;
}

html, body {
    background-color: var(--bg);
    color: var(--text);
    transition: background-color 0.2s ease, color 0.2s ease;
}

body {
    line-height: 1.6;
    -webkit-tap-highlight-color: transparent;
}

.container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

/* Desktop Optimization */
@media (min-width: 992px) {
    .container {
        max-width: 1200px;
        padding: 40px;
    }
    .dashboard-grid {
        display: grid;
        grid-template-columns: 350px 1fr;
        gap: 30px;
        align-items: start;
    }
    .subject-grid {
        grid-template-columns: 1fr 1fr 1fr !important;
    }
}

.card {
    background: var(--bg);
    border: 2px solid var(--gray-border);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: var(--shadow);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

.card:hover {
    background-color: var(--gray-light);
}

/* Duolingo Style Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 16px;
    border: 2px solid transparent;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.1s ease;
    text-align: center;
    text-decoration: none;
    font-size: 14px;
    width: 100%;
    margin-bottom: 15px;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    border-bottom: 4px solid var(--primary-dark);
}

.btn-primary:active {
    border-bottom-width: 0;
    transform: translateY(4px);
}

.btn-secondary {
    background-color: var(--secondary);
    color: white;
    border-bottom: 4px solid var(--secondary-dark);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid var(--gray-border);
    color: var(--secondary);
    border-bottom: 4px solid var(--gray-border);
}

/* Header & Progress */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    border-bottom: 2px solid var(--gray-border);
    margin-bottom: 20px;
}

.progress-container {
    background: var(--gray-border);
    height: 16px;
    border-radius: 8px;
    flex-grow: 1;
    margin: 0 15px;
    overflow: hidden;
}

.progress-bar {
    background: var(--primary);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
}

/* Typography */
h1 { font-size: 24px; margin-bottom: 10px; color: var(--text); }
h2, h3 { color: var(--text); }
p { color: var(--text-light); margin-bottom: 20px; }

/* Form inputs */
input {
    width: 100%;
    padding: 15px;
    border-radius: 15px;
    border: 2px solid var(--gray-border);
    background: var(--gray-light);
    color: var(--text);
    margin-bottom: 15px;
    font-size: 16px;
}

input:focus {
    outline: none;
    border-color: var(--secondary);
}

/* Admin Dashboard Table */
table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--gray-border);
    color: var(--text);
}

.badge {
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
}

.badge-admin { background: var(--accent); color: #000; }
.badge-user { background: var(--secondary); color: white; }

/* Dark Mode Toggle Switch Styling */
.theme-toggle {
    background: var(--gray-light);
    border: 2px solid var(--gray-border);
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    transition: all 0.2s ease;
}
.theme-toggle:hover {
    transform: scale(1.1);
}

/* Sidebar navigation style (used in settings) */
.settings-menu a {
    display: block;
    padding: 15px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text);
    margin-bottom: 5px;
    transition: background 0.2s;
}
.settings-menu a:hover, .settings-menu a.active {
    background: var(--gray-light);
    font-weight: bold;
}

/* Feedback Area Contrast Fix */
#feedback-area h2, #feedback-area p {
    color: white !important;
}

/* Animations */
@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.pop { animation: pop 0.3s ease; }

/* Loading Screen */
#loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--gray-border);
    border-top: 5px solid var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }

.logo-text {
    font-weight: 700;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-size: 24px;
}
.logo-icon {
    font-size: 28px;
}
