/* 
  Custom Bootstrap 5 Theme for Student Learning Platform
  Color Palette:
  - Primary: #1b4a5a (Deep Teal)
  - Accent: #feae55 (Golden)
  - Light: #ffeede (Cream)
  - Background: #fafafa (Off White)
*/

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

:root {
    --primary-color: #1b4a5a;
    --primary-dark: #0f2e38;
    --primary-light: #2a6878;
    --accent-color: #feae55;
    --accent-dark: #e89830;
    --accent-light: #ffc57a;
    --light-color: #ffeede;
    --bg-color: #fafafa;
    --white: #ffffff;
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-dark);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Bootstrap Override */
.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border: none;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-primary:hover, .btn-primary:focus {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    border: none;
    color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow);
}

.btn-accent:hover, .btn-accent:focus {
    background: linear-gradient(135deg, var(--accent-dark) 0%, var(--accent-color) 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: 14px;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 16px;
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    background: white;
}

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

.card-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.card-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    color: var(--primary-color);
}

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

/* Stats Cards */
.stat-card {
    padding: 1.5rem;
    border-radius: 16px;
    background: white;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border-left: 4px solid var(--accent-color);
}

.stat-card:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-lg);
}

.stat-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
}

.stat-icon-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
}

.stat-icon-accent {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-light) 100%);
    color: white;
}

.stat-icon-success {
    background: linear-gradient(135deg, #10b981 0%, #22c55e 100%);
    color: white;
}

.stat-icon-info {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: white;
}

/* Progress Bars */
.progress {
    height: 10px;
    border-radius: 10px;
    background-color: var(--light-color);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-color) 0%, var(--accent-color) 100%);
    transition: width 0.6s ease;
}

.progress-bar-accent {
    background: linear-gradient(90deg, var(--accent-color) 0%, var(--accent-light) 100%);
}

/* Badges */
.badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

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

.badge-accent {
    background-color: var(--accent-color);
    color: var(--primary-color);
}

.badge-light {
    background-color: var(--light-color);
    color: var(--primary-color);
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.nav-link {
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    padding: 0.5rem 1rem;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

/* Bottom Navigation for Mobile */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.75rem 0;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.5rem;
    border-radius: 12px;
}

.bottom-nav-item:hover {
    color: var(--primary-color);
    background-color: var(--light-color);
}

.bottom-nav-item.active {
    color: var(--primary-color);
    font-weight: 600;
}

.bottom-nav-icon {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
}

.bottom-nav-label {
    font-size: 0.75rem;
    font-weight: 500;
}

/* Quiz Question Card */
.question-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.option-btn {
    width: 100%;
    text-align: left;
    padding: 1rem 1.5rem;
    margin-bottom: 0.75rem;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
}

.option-btn:hover {
    border-color: var(--primary-color);
    background-color: var(--light-color);
    transform: translateX(8px);
}

.option-btn.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, var(--light-color) 0%, white 100%);
    box-shadow: var(--shadow);
}

.option-btn.correct {
    border-color: var(--success);
    background: linear-gradient(135deg, #d1fae5 0%, #ecfdf5 100%);
}

.option-btn.incorrect {
    border-color: var(--danger);
    background: linear-gradient(135deg, #fee2e2 0%, #fef2f2 100%);
}

/* Subject Cards */
.subject-card {
    background: white;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    display: block;
    border-left: 4px solid var(--primary-color);
}

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

.subject-icon {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 1rem;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

.slide-up {
    animation: slideUp 0.4s ease-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

.pulse {
    animation: pulse 2s infinite;
}

/* Touch Feedback */
.btn, .card, .option-btn, .subject-card {
    -webkit-tap-highlight-color: transparent;
}

.btn:active, .option-btn:active {
    transform: scale(0.98);
}

/* Responsive Utilities */
@media (max-width: 768px) {
    body {
        padding-bottom: 80px;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

/* Challenge Arena */
.challenge-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: white;
    border-radius: 20px;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.challenge-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    pointer-events: none;
}

.match-key {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-align: center;
    color: white;
}

/* Avatar */
.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
}

.avatar-sm {
    width: 32px;
    height: 32px;
}

.avatar-lg {
    width: 80px;
    height: 80px;
}

/* Loading States */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Utility Classes */
.text-primary {
    color: var(--primary-color) !important;
}

.text-accent {
    color: var(--accent-color) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-accent {
    background-color: var(--accent-color) !important;
}

.bg-light-custom {
    background-color: var(--light-color) !important;
}

.rounded-xl {
    border-radius: 16px !important;
}

.rounded-2xl {
    border-radius: 20px !important;
}

.shadow-sm-custom {
    box-shadow: var(--shadow-sm) !important;
}

.shadow-custom {
    box-shadow: var(--shadow) !important;
}

.shadow-lg-custom {
    box-shadow: var(--shadow-lg) !important;
}
