/* ==========================================
   BISAYAHUB - PROFESSIONAL STYLES
   Free, Open Source Bisaya Learning Platform
   ========================================== */

/* CSS Variables for theming */
:root {
    --primary: #667eea;
    --primary-dark: #5a67d8;
    --secondary: #f093fb;
    --accent: #feca57;
    --success: #48dbfb;
    --warning: #ff9ff3;
    --error: #ff6b6b;
    --bg: #f7fafc;
    --surface: #ffffff;
    --text: #2d3748;
    --text-light: #718096;
    --border: #e2e8f0;
    --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-lg: 20px;
    --transition: all 0.3s ease;
}

/* Dark mode */
[data-theme="dark"] {
    --bg: #1a202c;
    --surface: #2d3748;
    --text: #f7fafc;
    --text-light: #a0aec0;
    --border: #4a5568;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.logo-animated {
    font-size: 80px;
    animation: float 3s ease-in-out infinite;
    margin-bottom: 20px;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-20px); }
}

.progress-bar {
    width: 200px;
    height: 4px;
    background: rgba(255,255,255,0.3);
    border-radius: 2px;
    margin: 20px auto;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: white;
    width: 0%;
    animation: progress 2s ease forwards;
}

@keyframes progress {
    to { width: 100%; }
}

/* App Header */
.app-header {
    background: var(--surface);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo {
    font-size: 24px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.badge {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge.free {
    background: var(--accent);
    color: #744210;
}

.icon-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: var(--bg);
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.icon-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.1);
}

/* Profile Bar */
.profile-bar {
    background: var(--surface);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
}

.avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 600;
    font-size: 16px;
}

.user-level {
    font-size: 12px;
    color: var(--text-light);
}

.stats-mini {
    display: flex;
    gap: 20px;
}

.stat-item {
    text-align: center;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
}

.stat-label {
    font-size: 11px;
    color: var(--text-light);
    text-transform: uppercase;
}

/* Mode Selector */
.mode-selector {
    display: flex;
    gap: 8px;
    padding: 15px 20px;
    background: var(--surface);
    overflow-x: auto;
    border-bottom: 1px solid var(--border);
}

.mode-btn {
    padding: 10px 20px;
    border-radius: 25px;
    border: 2px solid var(--border);
    background: transparent;
    cursor: pointer;
    font-weight: 500;
    white-space: nowrap;
    transition: var(--transition);
}

.mode-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.mode-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

/* Content Area */
.content-area {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
}

.mode-content {
    display: none;
}

.mode-content.active {
    display: block;
}

/* Chat Mode */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 250px);
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.message {
    max-width: 80%;
    padding: 15px 20px;
    border-radius: var(--radius-lg);
    animation: messagePop 0.3s ease;
    line-height: 1.6;
}

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

.message.user {
    background: var(--primary);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 6px;
}

.message.bot {
    background: var(--surface);
    align-self: flex-start;
    border-bottom-left-radius: 6px;
    box-shadow: var(--shadow);
}

.message.bot.learning {
    border-left: 4px solid var(--accent);
}

.message-header {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    opacity: 0.8;
}

/* Suggestions */
.chat-suggestions {
    padding: 15px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--bg);
}

.suggestion-chip {
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    font-size: 13px;
    transition: var(--transition);
}

.suggestion-chip:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    transform: translateY(-2px);
}

/* Chat Input */
.chat-input-area {
    padding: 20px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--bg);
    padding: 8px;
    border-radius: 30px;
    border: 2px solid var(--border);
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

#chatInput {
    flex: 1;
    border: none;
    background: transparent;
    padding: 12px;
    font-size: 15px;
    outline: none;
}

.voice-btn, .send-btn {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    font-size: 18px;
    transition: var(--transition);
}

.voice-btn {
    background: var(--accent);
}

.voice-btn:hover {
    transform: scale(1.1);
}

.voice-btn.recording {
    background: var(--error);
    animation: pulse 1s infinite;
}

.send-btn {
    background: var(--primary);
    color: white;
}

.send-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1) rotate(-10deg);
}

.input-hint {
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 10px;
}

/* Learn Mode */
.module-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.module-card {
    background: var(--surface);
    padding: 25px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: var(--transition);
}

.module-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.module-icon {
    font-size: 40px;
    margin-bottom: 15px;
}

.module-card h3 {
    font-size: 18px;
    margin-bottom: 8px;
}

.module-card p {
    color: var(--text-light);
    font-size: 14px;
}

.module-progress {
    margin-top: 15px;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    overflow: hidden;
}

.module-progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* Practice Mode */
.activity-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.activity-card {
    background: var(--surface);
    padding: 30px;
    border-radius: var(--radius-lg);
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: 2px solid transparent;
}

.activity-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
}

.card-icon {
    font-size: 50px;
    margin-bottom: 15px;
}

/* Footer */
.app-footer {
    background: var(--surface);
    padding: 30px 20px;
    text-align: center;
    border-top: 1px solid var(--border);
}

.app-footer p {
    margin: 8px 0;
    color: var(--text-light);
    font-size: 14px;
}

.footer-links a {
    color: var(--primary);
    text-decoration: none;
    margin: 0 10px;
}

.footer-links a:hover {
    text-decoration: underline;
}

.license {
    font-size: 12px;
    margin-top: 15px;
    opacity: 0.7;
}

/* Utilities */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }

/* Animations */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Responsive */
@media (max-width: 600px) {
    .chat-container {
        height: calc(100vh - 200px);
    }
    
    .mode-selector {
        padding: 10px;
    }
    
    .mode-btn {
        padding: 8px 15px;
        font-size: 13px;
    }
    
    .stats-mini {
        gap: 15px;
    }
    
    .stat-value {
        font-size: 16px;
    }
}
