/* MI∞ND Learning Platform - Custom Styles */

/* ========== Global Styles ========== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --info-color: #0dcaf0;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    --gradient-warning: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-info: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-purple: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --border-radius: 0.75rem;
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
}

/* ========== Gradient Backgrounds ========== */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
    color: white;
}

.bg-gradient-success {
    background: var(--gradient-success) !important;
    color: white;
}

.bg-gradient-warning {
    background: var(--gradient-warning) !important;
    color: white;
}

.bg-gradient-info {
    background: var(--gradient-info) !important;
    color: white;
}

.bg-purple {
    background-color: #6f42c1 !important;
}

/* ========== Typography ========== */
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-weight: 700;
    line-height: 1.2;
}

.fw-bold {
    font-weight: 700 !important;
}

/* ========== Navigation Enhancements ========== */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.navbar-brand:hover {
    transform: scale(1.05);
    transition: var(--transition);
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 0.5rem;
    transition: var(--transition);
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* ========== Cards and Containers ========== */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
}

.card-body {
    padding: 1.5rem;
}

/* ========== Feature Cards ========== */
.feature-card {
    height: 100%;
    transition: var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.feature-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
}

/* ========== Buttons ========== */
.btn {
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    transition: var(--transition);
    border: none;
    text-transform: none;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

.progress-bar {
    border-radius: 0.5rem;
    transition: width 1s ease-in-out;
}

/* ========== Badges ========== */
.badge {
    font-weight: 600;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
}

/* ========== Hero Section ========== */
.hero-section {
    min-height: 80vh;
    position: relative;
    overflow: hidden;
}

.hero-illustration {
    position: relative;
    padding: 2rem;
}

.floating-elements {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.math-symbol {
    position: absolute;
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.3);
    animation: float 3s ease-in-out infinite;
}

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

/* ========== Learning Steps ========== */
.step-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}

.step-item {
    position: relative;
}

.step-item:not(:last-child)::after {
    content: '';
    position: absolute;
    left: 19px;
    top: 60px;
    width: 2px;
    height: 40px;
    background: linear-gradient(to bottom, var(--primary-color), transparent);
}

/* ========== Achievement Elements ========== */
.achievement-float {
    position: absolute;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

.achievement-card {
    transition: var(--transition);
    cursor: pointer;
}

.achievement-card:hover {
    transform: scale(1.02);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.achievement-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Dashboard Specific ========== */
.welcome-card {
    background: var(--gradient-primary);
    border-radius: var(--border-radius);
    position: relative;
    overflow: hidden;
}

.welcome-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.stat-card {
    transition: var(--transition);
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.stat-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ========== Exercise Interface ========== */
.question-content {
    font-size: 1.1rem;
    line-height: 1.8;
    border: 2px solid var(--light-color);
    transition: var(--transition);
}

.question-content:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.answer-section .btn-check:checked + .btn {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    transform: scale(1.02);
}

/* ========== Leaderboard Styles ========== */
.podium-container {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 1rem;
    padding: 2rem 0;
}

.podium-place {
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: slideUp 0.8s ease-out;
}

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

.podium-avatar {
    margin-bottom: 1rem;
    border: 3px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition);
}

.podium-avatar:hover {
    transform: scale(1.1);
}

.podium-base {
    border-radius: 0.5rem 0.5rem 0 0;
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.podium-base::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background: linear-gradient(to right, transparent, rgba(0, 0, 0, 0.1), transparent);
}

/* ========== Peer Collaboration ========== */
.peer-card {
    transition: var(--transition);
    cursor: pointer;
}

.peer-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

.session-card {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(40, 167, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(40, 167, 69, 0); }
}

/* ========== Forms ========== */
.form-control {
    border: 2px solid var(--light-color);
    border-radius: 0.5rem;
    padding: 0.75rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

.input-group-text {
    border: 2px solid var(--light-color);
    border-left: none;
    background: var(--light-color);
}

/* ========== Modal Enhancements ========== */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1.5rem;
}

/* ========== Tables ========== */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table th {
    border: none;
    background: var(--light-color);
    font-weight: 600;
    padding: 1rem;
}

.table td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ========== Alerts ========== */
.alert {
    border: none;
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}

/* ========== Learning Path Styles ========== */
.topic-card {
    transition: var(--transition);
    cursor: pointer;
    height: 100%;
}

.topic-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.topic-card.border-warning {
    border-left: 4px solid var(--warning-color) !important;
}

.topic-card.border-info {
    border-left: 4px solid var(--info-color) !important;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .display-6 {
        font-size: 1.75rem;
    }
    
    .hero-section {
        min-height: 60vh;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .podium-container {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .podium-place {
        width: 100%;
        max-width: 200px;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .feature-icon {
        width: 60px;
        height: 60px;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
    }
    
    .display-6 {
        font-size: 1.5rem;
    }
}

/* ========== Print Styles ========== */
@media print {
    .navbar,
    .btn,
    .modal,
    .floating-elements {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
    }
}

/* ========== Utility Classes ========== */
.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-5px);
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.min-vh-75 {
    min-height: 75vh;
}

.fa-10x {
    font-size: 10em;
}

/* ========== Dark Mode Support ========== */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #343a40;
        --dark-color: #f8f9fa;
    }
    
    body {
        background-color: #1a1a1a;
        color: var(--dark-color);
    }
    
    .card {
        background-color: #2d3748;
        color: var(--dark-color);
    }
    
    .bg-light {
        background-color: #343a40 !important;
    }
    
    .text-muted {
        color: #9ca3af !important;
    }
    
    .table {
        color: var(--dark-color);
    }
    
    .table th {
        background-color: #374151;
    }
}

/* ========== Accessibility ========== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ========== AI ASSISTANT - PREMIUM GLASS EFFECT ========== */
/* AI Assistant Container with Glassmorphism */
.ai-assistant-container {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: 380px;
    max-height: 600px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 25px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    z-index: 9999;
    animation: slideInUp 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    overflow: hidden;
}

/* Glass Header */
.ai-assistant-header {
    background: rgba(255, 255, 255, 0.1);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(10px);
}

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

.ai-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: glow 2s ease-in-out infinite alternate;
}

@keyframes glow {
    from { box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3); }
    to { box-shadow: 0 4px 20px rgba(102, 126, 234, 0.6); }
}

.ai-title-section h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.ai-powered-by {
    font-size: 11px;
    color: #666;
    margin: 2px 0;
    opacity: 0.8;
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.ai-session-info {
    font-size: 10px;
    color: #888;
    display: flex;
    gap: 8px;
    margin-top: 2px;
}

.ai-session-info span {
    background: rgba(255, 255, 255, 0.2);
    padding: 2px 6px;
    border-radius: 10px;
    backdrop-filter: blur(5px);
}

/* Glass Controls */
.ai-controls {
    display: flex;
    gap: 8px;
}

.ai-btn-icon {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    color: #666;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-btn-icon:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    color: #333;
}

/* Glass Chat Area */
.ai-chat-area {
    height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
}

.ai-message {
    margin-bottom: 16px;
    padding: 12px 16px;
    border-radius: 16px;
    max-width: 85%;
    backdrop-filter: blur(5px);
}

.ai-message.user {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    margin-left: auto;
    text-align: right;
}

.ai-message.ai {
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-right: auto;
}

/* Glass Input Area */
.ai-input-area {
    background: rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: 16px 20px;
    backdrop-filter: blur(10px);
}

.ai-input-row {
    display: flex;
    gap: 12px;
    align-items: center;
}

.ai-input {
    flex: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 25px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(5px);
    color: #333;
    font-size: 14px;
    outline: none;
    transition: all 0.3s ease;
}

.ai-input:focus {
    border-color: rgba(102, 126, 234, 0.5);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.ai-input::placeholder {
    color: rgba(0, 0, 0, 0.5);
}

.ai-send-btn {
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.ai-send-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Glass Toggle Button */
.ai-toggle-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-size: 24px;
    cursor: pointer;
    z-index: 9998;
    transition: all 0.3s ease;
    box-shadow: 
        0 8px 25px rgba(102, 126, 234, 0.3),
        0 4px 15px rgba(0, 0, 0, 0.1);
    animation: float 3s ease-in-out infinite;
}

.ai-toggle-btn:hover {
    transform: scale(1.1);
    box-shadow: 
        0 12px 30px rgba(102, 126, 234, 0.4),
        0 6px 20px rgba(0, 0, 0, 0.15);
}

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

.ai-toggle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.ai-notification-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 10px;
    font-weight: bold;
}

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

/* Mobile Responsive Glass Effect */
@media (max-width: 768px) {
    .ai-assistant-container {
        width: calc(100vw - 40px);
        right: 20px;
        left: 20px;
        max-height: 70vh;
    }
    
    .ai-toggle-btn {
        width: 55px;
        height: 55px;
        font-size: 20px;
    }
}

/* Progress indicators for AI operations */
.ai-progress-container {
    padding: 15px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
    transition: width 0.5s ease;
    width: 0%;
}

.ai-progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    text-align: center;
}

/* Suggestion chips */
.ai-suggestions {
    padding: 15px 20px 10px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.suggestion-chip {
    background: rgba(255, 255, 255, 0.15);
    color: rgba(0, 0, 0, 0.8);
    padding: 6px 12px;
    border-radius: 15px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.suggestion-chip:hover {
    background: rgba(102, 126, 234, 0.3);
    color: rgba(0, 0, 0, 0.9);
    transform: scale(1.05);
}

/* Focus indicators for keyboard navigation */
.btn:focus,
.form-control:focus,
.nav-link:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid var(--dark-color);
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}
