/* General Styles */
body {
    font-family: 'Kanit', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

a {
    color: #0d6efd;
    text-decoration: none;
    transition: all 0.3s ease;
}

a:hover {
    color: #0b5ed7;
}

/* Header */
.main-header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.logo img {
    max-height: 50px;
}

.main-nav .nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
}

.main-nav .nav-list li {
    margin-left: 20px;
}

.main-nav .nav-list li a {
    font-weight: 500;
    padding: 5px 0;
    position: relative;
}

.main-nav .nav-list li a:after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: #0d6efd;
    bottom: 0;
    left: 0;
    transition: width 0.3s ease;
}

.main-nav .nav-list li a:hover:after {
    width: 100%;
}

.mobile-menu-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #333;
}

/* Hero Section */
.hero-section {
    padding: 80px 0;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #fff;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 20px;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 30px;
    opacity: 0.9;
}

/* Category/Department/Position Cards */
.category-card, 
.department-card, 
.position-card,
.subject-card,
.exam-mode-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 25px;
    height: 100%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.category-card:hover, 
.department-card:hover, 
.position-card:hover,
.subject-card:hover,
.exam-mode-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.category-icon,
.department-icon,
.position-icon,
.subject-icon,
.exam-mode-icon {
    width: 60px;
    height: 60px;
    background-color: rgba(13, 110, 253, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: #0d6efd;
    font-size: 1.5rem;
}

.category-title,
.department-title,
.position-title,
.subject-title,
.exam-mode-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
}

.category-description,
.department-description,
.position-description,
.subject-description,
.exam-mode-description {
    color: #666;
    margin-bottom: 20px;
}

/* Section Styles */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: '';
    position: absolute;
    width: 50px;
    height: 3px;
    background-color: #0d6efd;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
}

.section-subtitle {
    color: #666;
    font-size: 1.1rem;
}

/* Exam Section */
.exam-section {
    padding: 50px 0;
}

.exam-header {
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.exam-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.exam-subtitle {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 20px;
}

.exam-info {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.info-item {
    display: flex;
    align-items: center;
}

.info-label {
    font-weight: 600;
    margin-right: 5px;
}

.info-value {
    color: #0d6efd;
    font-weight: 600;
}

.exam-content {
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.question-container {
    max-width: 800px;
    margin: 0 auto;
}

.question-number {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 20px;
}

.question-text {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 30px;
    line-height: 1.6;
}

.answers-container {
    margin-bottom: 30px;
}

.answer-option {
    margin-bottom: 15px;
}

.answer-option input[type="radio"] {
    display: none;
}

.answer-option label {
    display: block;
    padding: 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    padding-left: 45px;
}

.answer-option label:before {
    content: '';
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.answer-option input[type="radio"]:checked + label {
    border-color: #0d6efd;
    background-color: rgba(13, 110, 253, 0.05);
}

.answer-option input[type="radio"]:checked + label:before {
    border-color: #0d6efd;
    background-color: #0d6efd;
    box-shadow: inset 0 0 0 3px #fff;
}

.answer-option label:hover {
    border-color: #0d6efd;
}

.exam-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

/* Result Section */
.result-section {
    padding: 50px 0;
}

.result-header {
    text-align: center;
    margin-bottom: 40px;
}

.result-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.result-subtitle {
    font-size: 1.2rem;
    color: #666;
}

.score-card {
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    text-align: center;
    margin-bottom: 30px;
}

.score-percentage {
    font-size: 3rem;
    font-weight: 700;
    color: #0d6efd;
    margin-bottom: 20px;
}

.score-details {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
}

.detail-item {
    text-align: left;
}

.detail-label {
    font-weight: 600;
    color: #666;
}

.detail-value {
    font-weight: 600;
}

.result-chart {
    background-color: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    height: 100%;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

.simulation-details {
    margin-top: 50px;
}

/* Footer */
.main-footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 50px 0 20px;
}

.footer-widget {
    margin-bottom: 30px;
}

.widget-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 10px;
}

.widget-title:after {
    content: '';
    position: absolute;
    width: 40px;
    height: 2px;
    background-color: #0d6efd;
    bottom: 0;
    left: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: #adb5bd;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #fff;
}

.footer-contact {
    list-style: none;
    padding: 0;
}

.footer-contact li {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
}

.footer-contact i {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.copyright {
    text-align: center;
    padding-top: 20px;
    margin-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: #adb5bd;
    font-size: 0.9rem;
}

/* Breadcrumb */
.breadcrumb {
    background-color: transparent;
    padding: 0;
    margin-bottom: 20px;
}

.breadcrumb-item + .breadcrumb-item::before {
    color: #adb5bd;
}

.breadcrumb-item.active {
    color: #666;
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
}

@media (max-width: 767.98px) {
    .main-nav .nav-list {
        display: none;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .hero-section {
        padding: 60px 0;
        text-align: center;
    }
    
    .hero-image {
        margin-top: 30px;
    }
    
    .exam-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .result-actions {
        flex-direction: column;
    }
}

@media (max-width: 575.98px) {
    .hero-title {
        font-size: 1.8rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .exam-title {
        font-size: 1.5rem;
    }
    
    .exam-subtitle {
        font-size: 1rem;
    }
    
    .score-details {
        grid-template-columns: 1fr;
    }
}

/* Header Styles */
.main-header {
    background-color: #1a2a3a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 15px 0;
    position: static;
    top: 0;
    z-index: 1030;
    transition: all 0.3s ease;
}

.main-header:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.logo img {
    height: 71px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo img:hover {
    transform: scale(1.05);
}

.search-box {
    position: relative;
}

.search-box .form-control {
    border-radius: 30px;
    padding: 10px 20px;
    border: 2px solid #2c3e50;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
}

.search-box .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.btn-search {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #2c3e50;
    z-index: 5;
}

/* Footer Styles */
.main-footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 50px 0 20px;
    position: relative;
}

.footer-logo img {
    height: auto;
    width: 102px;
    margin-bottom: 15px;
}

.social-links a {
    display: inline-block;
    width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    background-color: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background-color: #0d6efd;
    transform: translateY(-3px);
}

/* Contact Page Styles */
.contact-section .card {
    border: none;
    border-radius: 10px;
}

.contact-section .form-control {
    padding: 12px;
    border: 1px solid #ddd;
}

.contact-section .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.contact-section .btn-primary {
    background-color: #2c3e50;
    border-color: #2c3e50;
    transition: all 0.3s ease;
}

.contact-section .btn-primary:hover {
    background-color: #1a2a3a;
    transform: translateY(-2px);
}

.social-links .btn-outline-primary {
    transition: all 0.3s ease;
}

.social-links .btn-outline-primary:hover {
    background-color: #0d6efd;
    color: #fff;
}

/* Modern Header Styles */
.modern-header {
    background-color: #0f263d;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.2);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo-img {
    height: 50px;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.navbar {
    padding: 0;
}

.nav-link {
    color: #ffffff;
    font-weight: 500;
    padding: 10px 15px;
    position: relative;
    transition: all 0.3s ease;
}

.nav-link:hover,
.nav-link:focus {
    color: #4fc3f7;
}

.nav-link.active {
    color: #4fc3f7;
}

.search-form {
    max-width: 300px;
    width: 100%;
}

.search-form .form-control {
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 25px 0 0 25px;
    border-right: none;
    padding: 10px 20px;
    border-color: transparent;
}

.search-form .btn-search {
    background-color: #4fc3f7;
    color: #0f263d;
    border-radius: 0 25px 25px 0;
    border-left: none;
    padding: 0 20px;
    transition: all 0.3s ease;
    border-color: transparent;
}

.search-form .btn-search:hover {
    background-color: #3ab5eb;
}

.navbar-toggler {
    border: none;
    padding: 8px;
    color: #ffffff;
}

.navbar-toggler:focus {
    box-shadow: none;
}

.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3E%3Cpath stroke='rgba(255, 255, 255, 0.8)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3E%3C/svg%3E");
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .search-form {
        margin-top: 15px;
        max-width: 100%;
    }
    
    .navbar-nav {
        margin-bottom: 15px;
    }
    
}

@media (min-width: 992px) {
    .navbar-expand-lg .navbar-nav .nav-link {
        padding-right: 1rem;
        padding-left: 1rem;
    }
}

.content-preview {
    max-height: 150px;
    overflow: hidden;
    position: relative;
}

.content-preview:after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to bottom, rgba(248, 249, 250, 0), rgba(248, 249, 250, 1));
}

.d-flex.flex-wrap.gap-2 {
    gap: 0.5rem;
}

.position-content .card-body {
    padding: 1.5rem;
}

.position-content .card-body img {
    max-width: 100%;
    height: auto;
}

.position-content .card-body table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.position-content .card-body table, 
.position-content .card-body th, 
.position-content .card-body td {
    border: 1px solid #dee2e6;
}

.position-content .card-body th,
.position-content .card-body td {
    padding: 0.75rem;
    vertical-align: top;
}

.position-content .card-body th {
    background-color: #f8f9fa;
}

/* ส่วนที่แก้ไขเพิ่มเติม/ปรับปรุง */
.question-card {
    background-color: #ffffff; /* เปลี่ยนเป็นสีขาวเต็มๆ */
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08); /* เพิ่มเงาเล็กน้อย */
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.question-body {
    background-color: #ffffff;
    padding: 1rem;
    border-radius: 6px;
}

.question-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #333; /* สีเข้มขึ้นเล็กน้อย */
    margin-bottom: 1.5rem;
}

.answers-list {
    background-color: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
}

.answer-item {
    transition: all 0.2s;
    background-color: #ffffff !important; /* เปลี่ยนพื้นหลังเป็นสีขาว */
    cursor: pointer;
    border: 1px solid #dee2e6 !important;
    margin-bottom: 0.75rem;
    padding: 1rem;
    border-radius: 6px;
}

.answer-item:hover {
    background-color: #f1f8ff !important; /* สีเมื่อโฮเวอร์ */
    border-color: #86b7fe !important;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

.answer-item .form-check-input:checked {
    background-color: #0d6efd;
    border-color: #0d6efd;
}

/* ส่วนเดิมที่ยังใช้ได้ดี */
.question-navigation .btn {
    min-width: 120px;
}
@media (max-width: 576px) {
    .answer-item {
        margin-bottom: 0.8rem !important;
        padding: 1rem !important;
    }
    .form-check-input {
        transform: scale(1.2);
        margin-top: 0.4rem !important;
    }
    .question-navigation .btn {
        min-width: 100px;
        padding: 0.5rem;
    }
}
.no-answer-alert {
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}
.exam-timer {
    font-size: 1.1rem;
    font-weight: bold;
}

/* ส่วนสรุปผลใหม่ */
.result-summary-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    border: 1px solid #e0e0e0;
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-percentage {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: <?php 
        if ($score_percentage >= 60) echo '#4CAF50'; 
        elseif ($score_percentage >= 50) echo '#FF9800'; 
        else echo '#F44336'; 
    ?>;
}

.score-grade {
    display: block;
    font-size: 1.2rem;
    color: #666;
    margin-top: 5px;
}

.score-details {
    max-width: 300px;
    margin: 0 auto;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.score-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.detail-label {
    font-weight: 600;
    color: #555;
}

.detail-value {
    font-weight: bold;
    color: #333;
}

/* ปุ่มแชร์ผลสอบ */
#share-result-btn {
    position: relative;
    overflow: hidden;
}

#share-result-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: rgba(255,255,255,0.2);
    transform: rotate(30deg);
    transition: all 0.3s;
}

#share-result-btn:hover::after {
    left: 100%;
}

/* ส่วนรายละเอียดผลการสอบ */
.result-details-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    border: 1px solid #e0e0e0;
    height: 100%;
}

.review-item {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.review-item.correct {
    border-left-color: #4CAF50;
    background-color: #f8fff8;
}

.review-item.incorrect {
    border-left-color: #F44336;
    background-color: #fff8f8;
}

.review-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e0e0e0;
}

.question-number {
    font-weight: bold;
    color: #333;
}

.review-item-body {
    padding: 0.5rem 0;
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1rem;
}

.user-answer, .correct-answer {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.user-answer {
    background-color: #ffebee;
}

.correct-answer {
    background-color: #e8f5e9;
}

.explanation {
    background-color: #e3f2fd;
    padding: 0.75rem;
    border-radius: 4px;
    margin-top: 1rem;
    font-size: 0.95rem;
}

.view-detail-btn {
    transition: all 0.2s;
}

.view-detail-btn:hover {
    background-color: #0d6efd;
    color: white;
}

/* ปุ่มกรองคำถาม */
.review-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.review-actions .btn.active {
    background-color: #0d6efd;
    color: white;
}

/* สไตล์สำหรับส่วนแชร์ผลสอบ */
.share-card {
    position: relative;
    border: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
}

.logo-watermark {
    position: absolute;
    top: 10px;
    right: 10px;
}

.score-circle-sm {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px auto;
    border: 6px solid;
    font-size: 1.8rem;
    font-weight: bold;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.share-card h4 {
    color: #333;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid #eee;
    display: inline-block;
}

.share-card p {
    margin-bottom: 5px;
    color: #444;
}

/* สไตล์สำหรับวงกลมคะแนนในส่วนแชร์ผลสอบ */
.share-score-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 15px auto;
}

.share-score-circle {
    width: 100%;
    height: 100%;
}

.share-progress-ring {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.share-progress-ring-bg {
    opacity: 0.3;
}

.share-progress-ring-fill {
    transition: stroke-dashoffset 0.5s ease;
}

.share-score-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

/* เพิ่มเอฟเฟกต์เมื่อโฮเวอร์ */
.share-score-percent {
    transition: transform 0.3s ease;
}

.share-score-container:hover .share-score-percent {
    transform: translate(-50%, -50%) scale(1.05);
}

/* สไตล์อื่นๆ ที่มีอยู่เดิม */
.share-card {
    position: relative;
    border: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    padding: 1.5rem;
}

.logo-watermark {
    position: absolute;
    top: 15px;
    right: 15px;
}

.share-card h4 {
    color: #333;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid #eee;
    display: inline-block;
    margin-top: 0.5rem;
}

.share-card p {
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95rem;
}

/* สไตล์สำหรับส่วนสรุปผล */
.result-summary-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    border: 1px solid #e0e0e0;
}

.score-circle {
    position: relative;
    width: 200px;
    height: 200px;
    margin: 0 auto 20px;
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.5s ease;
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.score-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.score-percentage {
    display: block;
    font-size: 2.5rem;
    font-weight: bold;
    color: #4CAF50;
}

.score-grade {
    display: block;
    font-size: 1.2rem;
    color: #666;
}

.score-details {
    max-width: 300px;
    margin: 0 auto;
    background-color: #f8f9fa;
    border-radius: 10px;
    padding: 1rem;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.05);
}

.score-detail-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 10px;
    background-color: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.detail-label {
    font-weight: 600;
    color: #555;
}

.detail-value {
    font-weight: bold;
    color: #333;
}

/* สไตล์สำหรับส่วนรายละเอียดผลการสอบ */
.result-details-card {
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    border: 1px solid #e0e0e0;
    height: 100%;
}

.review-item {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.review-item.correct {
    border-left-color: #4CAF50;
    background-color: #f8fff8;
}

.review-item.incorrect {
    border-left-color: #F44336;
    background-color: #fff8f8;
}

.review-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.review-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px dashed #e0e0e0;
}

.question-number {
    font-weight: bold;
    color: #333;
}

.review-item-body {
    padding: 0.5rem 0;
}

.question-text {
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
    margin-bottom: 1rem;
}

.user-answer, .correct-answer {
    padding: 0.5rem;
    border-radius: 4px;
    margin-bottom: 0.5rem;
}

.user-answer {
    background-color: #ffebee;
}

.correct-answer {
    background-color: #e8f5e9;
}

/* สไตล์ใหม่สำหรับกล่องคำอธิบาย */
.explanation-box {
    background-color: #e3f2fd;
    border-radius: 8px;
    margin-top: 1rem;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.explanation-header {
    background-color: #0d6efd;
    color: white;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.explanation-header i {
    font-size: 1.1rem;
}

.explanation-content {
    padding: 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ปุ่มกรองคำถาม */
.review-actions .btn {
    margin-right: 0.5rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s;
}

.review-actions .btn.active {
    background-color: #0d6efd;
    color: white;
}

/* สไตล์สำหรับส่วนแชร์ผลสอบ */
.share-score-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 15px auto;
}

.share-score-circle {
    width: 100%;
    height: 100%;
}

.share-progress-ring {
    transform: rotate(-90deg);
    transform-origin: 50% 50%;
}

.share-progress-ring-bg {
    opacity: 0.3;
}

.share-progress-ring-fill {
    transition: stroke-dashoffset 0.5s ease;
}

.share-score-percent {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.8rem;
    font-weight: bold;
    text-align: center;
    width: 100%;
}

.share-card {
    position: relative;
    border: 1px solid #e0e0e0;
    background: linear-gradient(135deg, #f9f9f9 0%, #ffffff 100%);
    padding: 1.5rem;
}

.logo-watermark {
    position: absolute;
    top: 15px;
    right: 15px;
}

.share-card h4 {
    color: #333;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 2px solid #eee;
    display: inline-block;
    margin-top: 0.5rem;
}

.share-card p {
    margin-bottom: 8px;
    color: #444;
    font-size: 0.95rem;
}

/* Hero Section ที่แก้ไขแล้ว */
.hero-section {
    background: linear-gradient(135deg, #2c3e50 0%, #3498db 100%);
    color: white;
    padding: 5rem 0;
    position: relative;
    /* ลบ overflow: hidden ออก */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('<?= BASE_URL ?>assets/images/hero-pattern.png') repeat;
    opacity: 0.05;
    z-index: 0;
}

/* เพิ่มส่วนนี้เพื่อให้เนื้อหาและปุ่มอยู่ด้านบน */
.hero-section > .container {
    position: relative;
    z-index: 1;
}

.hero-title {
    font-size: 2.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-cta {
    position: relative;
    z-index: 2; /* ให้ปุ่มอยู่ด้านบนสุด */
}

.hero-cta .btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
    border-radius: 50px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative; /* เพิ่มเพื่อความปลอดภัย */
}

.hero-cta .btn-primary {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.hero-cta .btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.hero-image {
    border-radius: 10px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.5s ease;
    position: relative; /* เพิ่มเพื่อความปลอดภัย */
}

.hero-image:hover {
    transform: scale(1.03);
}

.hero-stats {
    display: flex;
    gap: 1.5rem;
    margin-top: 2rem;
    position: relative; /* เพิ่มเพื่อความปลอดภัย */
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    display: block;
    line-height: 1;
}

.stat-label {
    font-size: 0.9rem;
    opacity: 0.8;
}

/* ส่วนอื่นๆ เหมือนเดิม ไม่ต้องแก้ไข */
.how-to-section {
    padding: 5rem 0;
    background-color: #f8f9fa;
}

.section-header {
    margin-bottom: 3rem;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.2rem;
    color: #7f8c8d;
    margin-bottom: 1.5rem;
}

.section-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1.5rem;
}

.divider-line {
    height: 2px;
    width: 100px;
    background: linear-gradient(to right, transparent, #3498db, transparent);
}

.divider-icon {
    margin: 0 1.5rem;
    background-color: #3498db;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.step-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    height: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    border: 1px solid #e0e0e0;
}

.step-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.step-number-wrapper {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.step-number {
    background-color: #3498db;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.step-line {
    height: 2px;
    flex-grow: 1;
    background: linear-gradient(to right, #3498db, #e0e0e0);
    margin: 0 1rem;
}

.step-content {
    position: relative;
    z-index: 1;
}

.step-icon {
    font-size: 2.5rem;
    color: #3498db;
    margin-bottom: 1.5rem;
}

.step-title {
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

.step-description {
    color: #7f8c8d;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 992px) {
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .step-card {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
        text-align: center;
    }
    
    .hero-stats {
        justify-content: center;
    }
    
    .hero-cta .btn {
        display: block;
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .hero-cta .btn:last-child {
        margin-bottom: 0;
    }
    
    .step-number-wrapper {
        justify-content: center;
    }
    
    .step-content {
        text-align: center;
    }
    
    .step-icon {
        margin-left: auto;
        margin-right: auto;
    }
}

/* สไตล์พิเศษสำหรับ dropdown เมนู */
.dropdown-menu-custom {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: none;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    padding: 10px 0;
    min-width: 250px;
    margin-top: 10px !important;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.dropdown-menu-custom .dropdown-item {
    padding: 8px 20px;
    margin: 3px 10px;
    border-radius: 6px;
    color: #2c3e50;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.dropdown-menu-custom .dropdown-item:hover {
    background: linear-gradient(90deg, #3498db 0%, #2c3e50 100%);
    color: white !important;
    transform: translateX(5px);
}

.dropdown-menu-custom .dropdown-item i {
    width: 20px;
    text-align: center;
    margin-right: 10px;
    color: #3498db;
}

.dropdown-menu-custom .dropdown-item:hover i {
    color: white;
}

.dropdown-menu-custom .badge {
    font-size: 0.7rem;
    font-weight: 400;
    padding: 4px 8px;
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate__animated.animate__fadeIn {
    animation: fadeIn 0.3s ease forwards;
}

.hero-image {
  object-fit: cover; /* รักษาสัดส่วนรูป */
  background-color: #f5f5f5; /* สีพื้นหลังหากรูปโหลดช้า */
}