/* Numera Finance LXP Dashboard Styles */

* {
    box-sizing: border-box;
}

body.dashboard-body {
    margin: 0 !important;
    padding: 0 !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif !important;
    background: linear-gradient(135deg, #f7f8fc 0%, #eef1f7 100%) !important;
    min-height: 100vh;
    line-height: 1.6;
    color: #2d3748;
    display: block !important;
    align-items: initial !important;
    justify-content: initial !important;
    height: auto !important;
}

/* Header Styles */
.dashboard-header {
    background: linear-gradient(135deg, #1a365d 0%, #2b6cb0 100%);
    color: white;
    padding: 1.25rem 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
    width: 100%;
    display: block;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header-logo {
    height: 40px;
    filter: brightness(0) invert(1);
}

.logo-section h1 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    text-align: right;
}

.user-name {
    display: block;
    font-weight: 600;
    font-size: 1rem;
}

.user-role {
    display: block;
    font-size: 0.85rem;
    opacity: 0.8;
    text-transform: capitalize;
}

.user-actions {
    display: flex;
    gap: 0.5rem;
}

.profile-btn, .logout-btn {
    padding: 0.5rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.profile-btn:hover, .logout-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Main Dashboard */
.dashboard-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 2rem;
    min-height: calc(100vh - 120px);
    width: 100%;
    display: block;
}

/* Loading State */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2D60EC;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 2rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Welcome Section */
.welcome-section {
    background: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    margin-bottom: 3rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #2b6cb0, #3182ce, #4299e1);
}

.welcome-section h2 {
    color: #1a365d;
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
}

.welcome-section p {
    color: #4a5568;
    font-size: 1.125rem;
    margin: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: white;
    padding: 2rem 1.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3182ce, #4299e1, #63b3ed);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

.stat-card:hover::before {
    transform: translateX(0);
}

.stat-icon {
    font-size: 2.5rem;
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.stat-info {
    flex: 1;
}

.stat-number {
    display: block;
    font-size: 2.5rem;
    font-weight: 800;
    color: #1a365d;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-label {
    display: block;
    color: #4a5568;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.75px;
}

/* Actions Section */
.actions-section {
    margin-bottom: 3rem;
}

.actions-section h3 {
    color: #1a365d;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    letter-spacing: -0.025em;
}

.action-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.75rem;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    color: white;
    position: relative;
    overflow: hidden;
}

.action-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.action-btn:hover::before {
    left: 100%;
}

.action-btn.primary {
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    box-shadow: 0 6px 20px rgba(49, 130, 206, 0.25);
}

.action-btn.secondary {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    box-shadow: 0 6px 20px rgba(66, 153, 225, 0.25);
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(49, 130, 206, 0.35);
}

.action-icon {
    font-size: 1.25rem;
    z-index: 1;
    position: relative;
}

/* Courses Section */
.courses-section, .activity-section {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
    margin-bottom: 3rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.courses-section h3, .activity-section h3 {
    color: #1a365d;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 2rem;
    letter-spacing: -0.025em;
    position: relative;
    padding-bottom: 1rem;
}

.courses-section h3::after, .activity-section h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #3182ce, #4299e1);
    border-radius: 2px;
}

.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
}

.course-card {
    background: white;
    border: 1px solid rgba(226, 232, 240, 0.8);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
    position: relative;
}

.course-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #3182ce, #4299e1, #63b3ed);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.course-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.12);
    border-color: rgba(49, 130, 206, 0.2);
}

.course-card:hover::before {
    transform: scaleX(1);
}

.course-thumbnail {
    width: 100%;
    height: 180px;
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 3rem;
    position: relative;
    overflow: hidden;
}

.course-thumbnail::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(49, 130, 206, 0.1) 0%, rgba(43, 108, 176, 0.2) 100%);
    z-index: 1;
}

.course-thumbnail span {
    position: relative;
    z-index: 2;
}

.course-info {
    padding: 1.5rem;
}

.course-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a365d;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.course-description {
    color: #4a5568;
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.course-progress {
    margin-bottom: 1rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, #2D60EC 0%, #667eea 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 0.8rem;
    color: #666;
    margin-top: 0.25rem;
}

.course-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: space-between;
}

.enrolled-section {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.enrolled-badge {
    background: #22c55e;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.unenroll-btn {
    background: #dc2626;
    color: white;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    opacity: 0.8;
}

.unenroll-btn:hover {
    opacity: 1;
    transform: scale(1.1);
    background: #b91c1c;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.course-btn {
    flex: 1;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.course-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.4s;
}

.course-btn:hover::before {
    left: 100%;
}

.course-btn.primary {
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.course-btn.secondary {
    background: rgba(49, 130, 206, 0.1);
    color: #2b6cb0;
    border: 1px solid rgba(49, 130, 206, 0.3);
}

.course-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(49, 130, 206, 0.4);
}

/* No Courses State */
.no-courses {
    text-align: center;
    padding: 4rem 2rem;
    color: #4a5568;
    background: rgba(49, 130, 206, 0.02);
    border-radius: 16px;
    border: 2px dashed rgba(49, 130, 206, 0.2);
}

.no-courses p {
    font-size: 1.125rem;
    margin-bottom: 1.5rem;
    color: #718096;
}

.explore-btn {
    margin-top: 1rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #3182ce 0%, #2b6cb0 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(49, 130, 206, 0.3);
}

.explore-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(49, 130, 206, 0.4);
}

/* Activity Section */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9ff;
    border-radius: 8px;
    border-left: 4px solid #2D60EC;
}

.activity-icon {
    font-size: 1.5rem;
    width: 40px;
    text-align: center;
}

.activity-content {
    flex: 1;
}

.activity-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.activity-description {
    color: #666;
    font-size: 0.9rem;
}

.activity-time {
    color: #999;
    font-size: 0.8rem;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    height: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid #e1e1e1;
    background: #f8f9ff;
}

.modal-header h3 {
    margin: 0;
    color: #333;
}

.close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.1);
}

.modal-body {
    flex: 1;
    overflow: hidden;
}

#lessonViewer {
    width: 100%;
    height: 100%;
}

/* Error State */
.error-state {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 2rem;
    color: #666;
}

.auth-error-content {
    max-width: 400px;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

.auth-error-content h3 {
    color: #333;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.auth-error-content p {
    margin-bottom: 2rem;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.primary-btn, .secondary-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
}

.primary-btn {
    background: #2D60EC;
    color: white;
}

.primary-btn:hover {
    background: #1e4ccc;
}

.secondary-btn {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #e1e1e1;
}

.secondary-btn:hover {
    background: #e9ecef;
}

.retry-btn {
    margin-top: 2rem;
    padding: 0.75rem 2rem;
    background: #2D60EC;
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    padding: 0.75rem;
    z-index: 100;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.06);
    backdrop-filter: blur(8px);
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    flex: 1;
    padding: 0.5rem;
    text-decoration: none;
    color: #666;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-item.active {
    color: #2D60EC;
    background: #f8f9ff;
}

.nav-icon {
    font-size: 1.2rem;
}

.nav-label {
    font-size: 0.7rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard-header {
        padding: 1rem;
    }
    
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .dashboard-main {
        padding: 1rem;
        padding-bottom: 100px; /* Account for mobile nav */
    }
    
    .stats-section {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .stat-card {
        padding: 1rem;
    }
    
    .stat-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
    
    .action-buttons {
        grid-template-columns: 1fr;
    }
    
    .courses-grid {
        grid-template-columns: 1fr;
    }
    
    .mobile-nav {
        display: flex;
    }
    
    .user-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-content {
        width: 95%;
        height: 95%;
    }
    
    .modal-header {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .stats-section {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        align-items: stretch;
    }
    
    .user-section {
        justify-content: center;
    }
}