/* Apna MCQs - Custom Styles */

:root {
    --primary-color: #007bff;
    --secondary-color: #6c757d;
    --success-color: #28a745;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --medical-blue: #2c5aa0;
    --medical-green: #28a745;
    --gradient-primary: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    --gradient-success: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    --box-shadow: 0 2px 15px rgba(0,0,0,0.1);
    --border-radius: 8px;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* Disable text selection and right-click for security */
body {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

/* Allow text selection for input fields and editable content */
input, textarea, [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* Navigation */
.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.navbar-nav .nav-link:hover {
    color: rgba(255,255,255,0.8) !important;
}

/* Home Page Styles */
.home-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.hero-section {
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
}

.hero-content h1 {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.feature-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none !important;
}

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

.feature-icon {
    margin-bottom: 1rem;
}

/* Login Page */
.login-page {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-icon, .admin-login-icon {
    color: var(--primary-color);
}

/* Dashboard Styles */
.welcome-card {
    background: var(--gradient-primary) !important;
    border: none;
    box-shadow: var(--box-shadow);
}

.profile-photo-large {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border: 4px solid rgba(255,255,255,0.2);
}

.stat-card {
    border: none;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
}

.action-card {
    border: none;
    box-shadow: var(--box-shadow);
}

.quick-action-btn {
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.test-card, .performance-card, .whatsapp-card {
    border: none;
    box-shadow: var(--box-shadow);
}

.test-item-card {
    transition: all 0.3s ease;
}

.test-item-card:hover {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.performance-item {
    transition: background-color 0.3s ease;
}

.performance-item:hover {
    background-color: rgba(0,0,0,0.02);
}

.footer-stats {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: none;
}

/* Tests Page */
.hero-header {
    background: var(--gradient-primary);
    color: white;
    padding: 3rem 0;
    border-radius: var(--border-radius);
    margin-bottom: 2rem;
}

.info-card {
    transition: transform 0.3s ease;
    border: none;
}

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

.test-stats .stat-item {
    padding: 15px;
    border-radius: var(--border-radius);
    background: rgba(0,0,0,0.05);
    transition: background-color 0.3s ease;
}

.test-stats .stat-item:hover {
    background: rgba(0,0,0,0.08);
}

.locked-test {
    opacity: 0.7;
}

.lock-info .progress {
    border-radius: 10px;
    overflow: hidden;
}

.empty-state {
    background: linear-gradient(135deg, #f8f9fa 0%, #e3f2fd 100%);
}

.instructions-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
}

/* Test Taking Page */
.test-page {
    background: #f8f9fa;
}

.test-header {
    background: var(--gradient-primary) !important;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.test-progress {
    height: 6px;
    background: rgba(255,255,255,0.3);
}

.question-card {
    border: none;
    box-shadow: var(--box-shadow);
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.question-card:hover {
    box-shadow: 0 4px 25px rgba(0,0,0,0.15);
}

.question-number {
    background: var(--gradient-primary);
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.option-label {
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid #e9ecef !important;
    background: white;
}

.option-label:hover {
    background-color: #f8f9fa !important;
    border-color: var(--primary-color) !important;
}

.form-check-input:checked + .option-label {
    background: var(--gradient-primary) !important;
    color: white !important;
    border-color: var(--primary-color) !important;
}

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

/* Test Results Page */
.result-header {
    background: var(--gradient-primary) !important;
    color: white;
}

.score-circle {
    position: relative;
    margin: 0 auto;
}

.score-circle::before {
    content: '';
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    top: -15px;
    left: -15px;
    z-index: -1;
}

.question-review {
    border-left: 4px solid #dee2e6;
    transition: all 0.3s ease;
}

.question-review.correct {
    border-left-color: var(--success-color);
    background-color: rgba(40, 167, 69, 0.05);
}

.question-review.incorrect {
    border-left-color: var(--danger-color);
    background-color: rgba(220, 53, 69, 0.05);
}

/* Leaderboard */
.champion-card {
    position: relative;
    transform: scale(1.05);
    z-index: 2;
}

.rank-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
}

.rank-number.top-rank {
    font-weight: bold;
    font-size: 1.1rem;
}

/* Profile Page */
.profile-photo-container {
    position: relative;
    display: inline-block;
}

.profile-photo {
    border: 4px solid #e9ecef;
    transition: border-color 0.3s ease;
}

.profile-photo:hover {
    border-color: var(--primary-color);
}

/* Admin Styles */
.admin-login-page {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    min-height: 100vh;
}

.sidebar {
    min-height: calc(100vh - 56px);
    box-shadow: 2px 0 5px rgba(0,0,0,0.1);
}

.list-group-item {
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
}

.list-group-item:hover {
    background-color: #e9ecef;
    padding-left: 1.5rem;
}

.list-group-item.active {
    background: var(--gradient-primary);
    border-color: transparent;
}

/* Animations */
.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0.7);
    }
    70% { 
        transform: scale(1.05); 
        box-shadow: 0 0 0 10px rgba(0, 123, 255, 0);
    }
    100% { 
        transform: scale(1); 
        box-shadow: 0 0 0 0 rgba(0, 123, 255, 0);
    }
}

.timer-warning {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0.5; }
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2rem;
    }
    
    .stat-card {
        margin-bottom: 1rem;
    }
    
    .quick-action-btn {
        height: 100px;
        font-size: 0.9rem;
    }
    
    .question-card {
        margin-bottom: 1rem;
    }
    
    .score-circle {
        width: 120px;
        height: 120px;
    }
    
    .score-circle::before {
        width: 150px;
        height: 150px;
        top: -15px;
        left: -15px;
    }
    
    .profile-photo-large {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 576px) {
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin-bottom: 1rem;
    }
    
    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 1rem;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .test-stats .stat-item {
        padding: 10px;
        margin-bottom: 0.5rem;
    }
}

/* Utility Classes */
.border-start {
    border-left: 4px solid !important;
}

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

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

.shadow-lg {
    box-shadow: 0 1rem 3rem rgba(0,0,0,0.175) !important;
}

.text-shadow {
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

/* Form Enhancements */
.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background: var(--gradient-primary);
    border: none;
}

.btn-success {
    background: var(--gradient-success);
    border: none;
}

/* Card Enhancements */
.card {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--box-shadow);
}

.card-header {
    background: rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.125);
    font-weight: 600;
}

/* Badge Enhancements */
.badge {
    font-weight: 500;
    border-radius: 20px;
}

.badge-sm {
    font-size: 0.7rem;
    padding: 0.25em 0.5em;
}

/* Loading States */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Print Styles */
@media print {
    .navbar, .btn, .modal, .sidebar {
        display: none !important;
    }
    
    .container {
        max-width: 100% !important;
    }
    
    .card {
        box-shadow: none !important;
        border: 1px solid #dee2e6 !important;
    }
    
    body {
        background: white !important;
        color: black !important;
    }
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    :root {
        --light-color: #212529;
        --dark-color: #f8f9fa;
    }
}

/* Accessibility Improvements */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for better accessibility */
.btn:focus,
.form-control:focus,
.form-select:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

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

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