/* Global Styles */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
.navbar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    color: white !important;
    font-size: 1.5rem;
    font-weight: bold;
    text-decoration: none;
}

    .navbar-brand:hover {
        color: #f8f9fa !important;
    }

/* Main Content */
.main-content {
    min-height: calc(100vh - 80px);
    padding: 2rem 0;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    }

.card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 15px 15px 0 0 !important;
    padding: 1.5rem;
    border: none;
}

.card-body {
    padding: 2rem;
}

/* Button Styles */
.btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

    .btn-primary:hover {
        background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    }

.btn-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
}

    .btn-success:hover {
        background: linear-gradient(135deg, #38a169 0%, #2f855a 100%);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(72, 187, 120, 0.4);
    }

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
}

    .btn-danger:hover {
        background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(245, 101, 101, 0.4);
    }

/* Form Styles */
.form-control {
    border-radius: 10px;
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: all 0.3s ease;
}

    .form-control:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    }

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    font-weight: 600;
    color: #4a5568;
    margin-bottom: 0.5rem;
}

/* Quiz Styles */
.quiz-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

.question-card {
    background: white;
    border-radius: 20px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-left: 5px solid #667eea;
}

.question-number {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 1rem;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.answer-option {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

    .answer-option:hover {
        background: #edf2f7;
        border-color: #cbd5e0;
        transform: translateX(5px);
    }

    .answer-option.selected {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-color: #667eea;
        color: white;
        transform: translateX(10px);
    }

    .answer-option input[type="radio"] {
        margin-right: 1rem;
        transform: scale(1.2);
    }

/* Progress Bar */
.progress-container {
    background: #e2e8f0;
    border-radius: 25px;
    height: 10px;
    margin-bottom: 2rem;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    height: 100%;
    border-radius: 25px;
    transition: width 0.5s ease;
}

/* Timer */
.timer {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    text-align: center;
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 2rem;
    box-shadow: 0 5px 15px rgba(245, 101, 101, 0.3);
}

/* Navigation Buttons */
.quiz-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.quiz-info {
    color: #718096;
    font-weight: 500;
}

/* Exam Results Modern Design */
.exam-results-page {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    margin: 0;
    padding: 20px 0;
}

.exam-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px;
}

.exam-header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

    .exam-header h1 {
        font-size: 2.8rem;
        font-weight: 700;
        margin: 0 auto 10px auto;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
        text-align: center;
        width: 100%;
        display: block;
    }

    .exam-header p {
        font-size: 1.1rem;
        opacity: 0.9;
        font-weight: 300;
        margin: 0 auto;
        text-align: center;
    }

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.result-card {
    background: white;
    border-radius: 20px;
    padding: 30px 25px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

    .result-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 20px 40px rgba(0,0,0,0.15);
    }

    .result-card::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        height: 4px;
        background: var(--card-color);
    }

    .result-card.success {
        --card-color: #28a745;
    }

    .result-card.danger {
        --card-color: #dc3545;
    }

    .result-card.warning {
        --card-color: #ffc107;
    }

    .result-card.info {
        --card-color: #17a2b8;
    }

.result-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 24px;
    color: white;
    background: var(--card-color);
}

.result-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 8px;
}

.result-label {
    font-size: 1rem;
    color: #6c757d;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Level Card */
.level-card {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border-radius: 25px;
    padding: 50px 40px;
    text-align: center;
    box-shadow: 0 20px 50px rgba(238, 90, 36, 0.4);
    margin: 40px auto;
    max-width: 500px;
    position: relative;
    overflow: hidden;
    transform: scale(1.05);
}

    .level-card::before {
        content: '';
        position: absolute;
        top: -50%;
        left: -50%;
        width: 200%;
        height: 200%;
        background: linear-gradient(45deg, transparent, rgba(255,255,255,0.1), transparent);
        transform: rotate(45deg);
        animation: shine 3s infinite;
    }

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }

    50% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }

    100% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
}

.level-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
    font-size: 40px;
    backdrop-filter: blur(10px);
    border: 3px solid rgba(255,255,255,0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

.level-text {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}

.level-label {
    font-size: 1.3rem;
    opacity: 0.95;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.level-description {
    font-size: 1rem;
    opacity: 0.8;
    font-weight: 300;
    font-style: italic;
    margin-top: 15px;
}

/* Alert Styles */
.alert {
    border-radius: 15px;
    padding: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    border: none;
}

.alert-success {
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
}

.alert-danger {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    color: white;
}

.alert-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
}

.alert-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
}

/* Table Styles */
.table {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
}

    .table thead th {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: white;
        border: none;
        padding: 1rem;
        font-weight: 600;
    }

    .table tbody td {
        padding: 1rem;
        border-color: #e2e8f0;
        vertical-align: middle;
    }

    .table tbody tr:hover {
        background-color: #f7fafc;
    }

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }

    .main-content {
        padding: 1rem 0;
    }

    .card-body {
        padding: 1.5rem;
    }

    .quiz-container {
        padding: 1rem;
    }

    .question-card {
        padding: 1.5rem;
    }

    .question-text {
        font-size: 1.1rem;
    }

    .answer-option {
        padding: 0.75rem 1rem;
    }

    .quiz-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .btn {
        padding: 0.5rem 1.5rem;
        font-size: 0.9rem;
    }

    .exam-header h1 {
        font-size: 2.2rem;
    }

    .results-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .result-card {
        padding: 25px 20px;
    }

    .level-card {
        padding: 30px 25px;
        transform: scale(1);
    }

    .level-text {
        font-size: 2.5rem;
    }

    .level-icon {
        width: 80px;
        height: 80px;
        font-size: 32px;
    }
}

@media (max-width: 576px) {
    .navbar-brand {
        font-size: 1.2rem;
    }

    .question-text {
        font-size: 1rem;
    }

    .result-number {
        font-size: 2rem;
    }

    .level-text {
        font-size: 2rem;
    }

    .exam-header h1 {
        font-size: 1.8rem;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-lg {
    box-shadow: 0 10px 30px rgba(0,0,0,0.1) !important;
}

.rounded-lg {
    border-radius: 15px !important;
}

.rounded-xl {
    border-radius: 20px !important;
}

.rounded-2xl {
    border-radius: 25px !important;
}
