/* Global Styles */
:root {
    --primary-color: #1e40af;
    --secondary-color: #3b82f6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-color: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --background-color: #f3f4f6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

/* Auth Pages (Login/Register) */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--primary-color);
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

.auth-form .form-control {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    transition: border-color 0.2s;
}

.auth-form .form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.auth-form .btn {
    padding: 0.75rem;
    font-weight: 500;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.auth-form .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.auth-form .btn-primary:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-1px);
}

.auth-footer {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* Dashboard Styles */
.dashboard {
    min-height: 100vh;
    display: flex;
}

.sidebar {
    width: 250px;
    background: white;
    padding: 1.5rem;
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    padding-bottom: 1rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    color: var(--text-color);
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s;
}

.sidebar-nav a:hover {
    background-color: var(--background-color);
}

.sidebar-nav a.active {
    background-color: var(--primary-color);
    color: white;
}

.main-content {
    flex: 1;
    padding: 2rem;
}

/* Exam Styles */
.exam-container {
    max-width: 800px;
    margin: 0 auto;
}

.exam-header {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.exam-timer {
    display: inline-block;
    padding: 0.5rem 1rem;
    background-color: var(--primary-color);
    color: white;
    border-radius: 0.5rem;
    font-weight: 500;
}

.question-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.question-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

.answer-options {
    display: grid;
    gap: 1rem;
}

.answer-option {
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.answer-option:hover {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.05);
}

.answer-option.selected {
    border-color: var(--primary-color);
    background-color: rgba(59, 130, 246, 0.1);
}

/* Results Styles */
.results-container {
    max-width: 800px;
    margin: 0 auto;
}

.results-header {
    text-align: center;
    margin-bottom: 2rem;
}

.score-display {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 1rem 0;
}

.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.summary-card {
    background: white;
    padding: 1.5rem;
    border-radius: 1rem;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.summary-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.summary-label {
    color: var(--text-muted);
}

/* Question Analysis Styles */
.question-result {
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.5rem;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.question-result.border-success {
    border-left: 4px solid #10b981;
}

.question-result.border-danger {
    border-left: 4px solid #ef4444;
}

.question-text {
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: #1f2937;
}

.options {
    margin-bottom: 1rem;
}

.option {
    padding: 0.75rem;
    border-radius: 0.375rem;
    background-color: #f9fafb;
    margin-bottom: 0.5rem;
}

.option.selected-answer {
    background-color: #e9f5ff;
    border: 1px solid #2563eb;
}

.option.correct-answer {
    background-color: #e8f5e9;
    border: 1px solid #10b981;
}

.option.selected-answer.correct-answer {
    background-color: #d1fae5;
    border: 1px solid #10b981;
}

.option-label {
    font-weight: 600;
    color: #4b5563;
}

.answer-details {
    padding-top: 0.5rem;
    border-top: 1px solid #e5e7eb;
}

.answer-details .text-muted {
    color: #6b7280 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .dashboard {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }

    .main-content {
        padding: 1rem;
    }

    .results-summary {
        grid-template-columns: 1fr;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Component System Styles */

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    color: white;
}

.loading-content h4 {
    margin-top: 1rem;
    font-weight: 600;
}

/* Dashboard Layout */
.dashboard {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg, #0f172a);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.2s ease-in-out;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sidebar-logo h2 {
    font-weight: 800;
    font-size: 1.5rem;
    margin: 0;
    color: white;
    letter-spacing: -0.025em;
}

.sidebar-logo .logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.25rem;
}

.sidebar-nav {
    padding: 1rem 1rem 2rem;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 0.25rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 0.5rem;
    transition: all 0.2s ease-in-out;
    font-weight: 500;
    font-size: 0.875rem;
}

.sidebar-nav a:hover {
    background: rgba(255, 255, 255, 0.05);
    color: white;
}

.sidebar-nav a.active {
    background: #2563eb;
    color: white;
}

.sidebar-nav i {
    font-size: 1.125rem;
    width: 20px;
    display: flex;
    align-items: center;
}

.sidebar-footer {
    padding: 1rem;
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-logout {
    width: 100%;
    padding: 0.75rem;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Main Content */
.main-content {
    margin-left: 280px;
    flex: 1;
    background: #f8fafc;
    min-height: 100vh;
    padding: 2rem;
    padding-bottom: 6rem;
}

.content-header {
    margin-bottom: 2rem;
}

.content-header h1 {
    font-size: 1.875rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.content-header p {
    color: #64748b;
    font-size: 0.875rem;
    margin: 0;
}

/* Cards */
.card-custom {
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    transition: all 0.2s ease-in-out;
    overflow: hidden;
}

.card-custom:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    transform: translateY(-2px);
}

.stat-card {
    padding: 1.5rem;
    background: white;
    border-radius: 1rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease-in-out;
    height: 100%;
}

.stat-card:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    transform: translateY(-2px);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

.stat-icon.primary { background: #e0e7ff; color: #2563eb; }
.stat-icon.success { background: #d1fae5; color: #10b981; }
.stat-icon.warning { background: #fef3c7; color: #f59e0b; }
.stat-icon.info { background: #dbeafe; color: #0ea5e9; }

.stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.stat-label {
    color: #64748b;
    font-size: 0.875rem;
    font-weight: 600;
}

.stat-change {
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}

.stat-change.positive { color: #10b981; }
.stat-change.negative { color: #ef4444; }

/* Quick Actions */
.quick-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.quick-action-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    text-decoration: none;
    color: #0f172a;
    font-weight: 600;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}

.quick-action-btn:hover {
    box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -1px rgb(0 0 0 / 0.06);
    transform: translateY(-2px);
    border-color: #2563eb;
    color: #2563eb;
}

.quick-action-btn i {
    font-size: 1.25rem;
}

/* Buttons */
.btn-custom {
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary-custom {
    background: #2563eb;
    color: white;
}

.btn-primary-custom:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.btn-secondary-custom {
    background: #f1f5f9;
    color: #64748b;
}

.btn-secondary-custom:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Tables */
.custom-table {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.custom-table table {
    width: 100%;
    margin: 0;
}

.custom-table thead th {
    background: #f8fafc;
    padding: 1rem 1.5rem;
    font-weight: 700;
    color: #0f172a;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.custom-table tbody td {
    padding: 1rem 1.5rem;
    vertical-align: middle;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.875rem;
}

.custom-table tbody tr:last-child td {
    border-bottom: none;
}

.custom-table tbody tr:hover {
    background: #f8fafc;
}

/* User Avatar */
.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.875rem;
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.user-details .name {
    font-weight: 700;
    color: #0f172a;
    font-size: 0.875rem;
}

.user-details .email,
.user-details .last-active {
    font-size: 0.75rem;
    color: #64748b;
}

/* Badges */
.custom-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-primary { background: #e0e7ff; color: #3730a3; }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-warning { background: #fef3c7; color: #92400e; }
.badge-danger { background: #fee2e2; color: #991b1b; }
.badge-secondary { background: #f1f5f9; color: #475569; }

/* Forms */
.form-control-custom {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    transition: all 0.2s ease-in-out;
}

.form-control-custom:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .quick-action-btn {
        justify-content: center;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.slide-out-right {
    animation: slideOutRight 0.3s ease-in;
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Component-specific styles */
.question-item {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1rem;
}

.option-item {
    margin-bottom: 0.5rem;
}

.option-item .input-group-text {
    background: transparent;
    border-right: none;
}

.option-item .form-control {
    border-left: none;
}

.option-item .form-control:focus {
    border-left: none;
    box-shadow: none;
}

/* Chart containers */
.chart-container {
    position: relative;
    height: 300px;
    width: 100%;
}

/* Loading states */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: #64748b;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h4 {
    margin-bottom: 0.5rem;
    color: #475569;
}

.empty-state p {
    margin-bottom: 1.5rem;
}

/* Notification styles */
.notification-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

/* Modal enhancements */
.modal-content {
    border-radius: 1rem;
    border: none;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 10px 10px -5px rgb(0 0 0 / 0.04);
}

.modal-header {
    border-bottom: 1px solid #e2e8f0;
    padding: 1.5rem;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e2e8f0;
    padding: 1.5rem;
}

/* Breadcrumb styles */
.breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: ">";
    color: #64748b;
}

.breadcrumb-item a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #64748b;
}

/* Progress bars */
.progress {
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
}

.progress-bar {
    border-radius: 3px;
}

/* Dropdown enhancements */
.dropdown-menu {
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -2px rgb(0 0 0 / 0.05);
}

.dropdown-item {
    padding: 0.5rem 1rem;
    color: #374151;
}

.dropdown-item:hover {
    background: #f8fafc;
    color: #0f172a;
}

.dropdown-item.text-danger:hover {
    background: #fee2e2;
    color: #991b1b;
} 