/* ABCDEEZ Web Components Stylesheet */

/* Reset and Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #3b82f6 0%, #9333ea 100%);
    min-height: 100vh;
    color: #111827;
    line-height: 1.5;
}

/* Layout Components */
.flex-column {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.flex-row {
    display: flex;
    flex-direction: row;
    gap: 10px;
    align-items: center;
}

.stack {
    display: flex;
    flex-direction: column;
}

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

.grid-layout {
    display: grid;
    gap: 16px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

.split-pane {
    display: flex;
    gap: 20px;
    height: 100%;
}

.split-left {
    flex: 1;
    min-width: 300px;
}

.split-right {
    flex: 2;
}

/* Card Components */
.stat-card {
    background: #f9fafb;
    padding: 15px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.stat-card h3 {
    font-size: 12px;
    color: #808080;
    margin-bottom: 5px;
    font-weight: normal;
}

.stat-card p {
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.welcome-card {
    background: white;
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.welcome-card h2 {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 10px;
}

.welcome-card p {
    font-size: 16px;
    color: #808080;
    margin-bottom: 20px;
}

.activity-card {
    padding: 12px 16px;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.activity-card:hover {
    background: #f7fafc;
}

.activity-card.highlighted {
    background: #f0f8ff;
    border-left: 3px solid #3b82f6;
}

.activity-card h4 {
    font-size: 14px;
    font-weight: 500;
    margin: 0;
}

.activity-card .time {
    font-size: 12px;
    color: #808080;
}

/* Navigation Components */
.header-bar {
    background: white;
    padding: 16px 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.nav-bar {
    display: flex;
    gap: 10px;
}

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-around;
    padding: 8px 0;
}

.nav-btn {
    padding: 8px 16px;
    background: transparent;
    border: none;
    color: #808080;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 8px;
    font-size: 14px;
}

.nav-btn:hover {
    background: #f7fafc;
}

.nav-btn.active {
    color: #3b82f6;
    background: #e0f2fe;
}

.sidebar-nav {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* Tab Components */
.tab-bar {
    display: flex;
    gap: 5px;
    border-bottom: 2px solid #e2e8f0;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    background: transparent;
    border: none;
    color: #808080;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    font-size: 14px;
    font-weight: 500;
}

.tab:hover {
    color: #111827;
}

.tab.active {
    color: #3b82f6;
    border-bottom-color: #3b82f6;
}

/* Button Components */
.btn, .action-button {
    display: inline-block;
    padding: 10px 20px;
    background: #3b82f6;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.btn:hover, .action-button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.btn:active, .action-button:active {
    transform: translateY(0);
}

.btn.secondary {
    background: #10b981;
}

.btn.secondary:hover {
    background: #059669;
}

.hint-btn {
    padding: 8px 16px;
    background: #fbbf24;
    color: #78350f;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.hint-btn:hover {
    background: #f59e0b;
}

/* Form Components */
.auth-form {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    max-width: 400px;
    margin: 0 auto;
}

.labeled-input {
    margin-bottom: 20px;
}

.labeled-input label {
    display: block;
    font-size: 14px;
    color: #111827;
    margin-bottom: 5px;
    font-weight: 500;
}

.labeled-input input {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.labeled-input input:focus {
    outline: none;
    border-color: #3b82f6;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 10px 0;
}

.checkbox-wrapper input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* Learning Components */
.task-presenter {
    background: #f7fafc;
    padding: 40px;
    border-radius: 12px;
    text-align: center;
    margin: 20px 0;
}

.task-presenter h2 {
    font-size: 48px;
    margin-bottom: 30px;
    color: #2d3748;
}

.options-grid, .task-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 15px;
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.option-btn, .answer-option {
    padding: 20px;
    font-size: 24px;
    font-weight: bold;
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.option-btn:hover, .answer-option:hover {
    background: #3b82f6;
    color: white;
    transform: scale(1.05);
}

.learning-progress {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.progress-stats {
    display: flex;
    justify-content: space-around;
    margin-top: 15px;
}

.progress-stats div {
    text-align: center;
}

.progress-stats .value {
    font-size: 24px;
    font-weight: bold;
    color: #3b82f6;
}

.progress-stats .label {
    font-size: 12px;
    color: #808080;
    margin-top: 5px;
}

/* Settings Components */
.settings-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.settings-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #2d3748;
}

.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.setting-row:last-child {
    border-bottom: none;
}

.setting-row label {
    font-size: 14px;
    color: #111827;
}

.theme-selector {
    display: flex;
    gap: 10px;
}

/* Visual Components */
.alphabet-sequence {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}

.alphabet-item {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 20px;
    font-weight: bold;
}

.alphabet-item.highlighted {
    background: #3b82f6;
    color: white;
    border-color: #3b82f6;
}

.comparison-visual {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 30px 0;
}

.comparison-item {
    font-size: 48px;
    font-weight: bold;
    padding: 20px 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.comparison-arrow {
    font-size: 36px;
    color: #718096;
}

.missing-item-visual {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin: 30px 0;
}

.sequence-item, .missing-item {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 24px;
    font-weight: bold;
}

.missing-item {
    background: #fef3c7;
    border: 2px dashed #f59e0b;
    color: #f59e0b;
}

.path-visual {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 20px 0;
}

.path-node {
    padding: 15px;
    background: white;
    border-radius: 8px;
    border-left: 4px solid #3b82f6;
    font-size: 18px;
}

.path-steps {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 10px;
}

/* Feedback Components */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #e2e8f0;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 40px;
    color: #808080;
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.error-banner {
    background: #fee;
    border-left: 4px solid #f87171;
    padding: 15px;
    border-radius: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
}

.error-banner p {
    color: #991b1b;
    margin: 0;
}

.dismiss-btn {
    background: transparent;
    border: none;
    color: #991b1b;
    cursor: pointer;
    font-size: 20px;
    padding: 0 5px;
}

.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease;
    z-index: 1000;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.toast.success {
    background: #10b981;
    color: white;
}

.toast.error {
    background: #ef4444;
    color: white;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.error-message {
    color: #ef4444;
    font-size: 14px;
    margin-top: 5px;
}

.success-message {
    color: #10b981;
    font-size: 14px;
    margin-top: 5px;
}

/* Modal Components */
.confirm-modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1001;
    min-width: 400px;
}

.modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
}

.btn-cancel {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-cancel:hover {
    background: #cbd5e0;
}

.btn-confirm {
    background: #3b82f6;
    color: white;
}

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

/* Chart Components */
.histogram, .learning-curve, .performance-chart {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.error-analysis, .strategy-analysis {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.metrics-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
}

/* App Scaffold */
.app-scaffold {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-content {
    flex: 1;
    overflow-y: auto;
    padding-bottom: 80px; /* Space for bottom nav */
}

.scrollable {
    overflow-y: auto;
    height: 100%;
}

/* Responsive Design */
@media (max-width: 768px) {
    .split-pane {
        flex-direction: column;
    }
    
    .split-left, .split-right {
        width: 100%;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .comparison-visual {
        flex-direction: column;
    }
    
    .centered-container {
        padding: 10px;
    }
    
    .task-presenter h2 {
        font-size: 32px;
    }
    
    .option-btn {
        font-size: 18px;
        padding: 15px;
    }
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

.p-10 { padding: 10px; }
.p-15 { padding: 15px; }
.p-20 { padding: 20px; }

.gap-5 { gap: 5px; }
.gap-10 { gap: 10px; }
.gap-15 { gap: 15px; }
.gap-20 { gap: 20px; }

.w-full { width: 100%; }
.h-full { height: 100%; }

/* Divider */
.divider {
    margin: 15px 0;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Label */
.label {
    color: #111827;
    font-size: 14px;
    display: inline-block;
}

/* Card base */
.card {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

/* Answer options */
.answer-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
    margin-top: 20px;
}