/* Global */
:root {
    --primary-color: #0d7559;
    --secondary-color: #6b6e68;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --text-color: #495057;
    --border-radius: 0.25rem;
    --shadow-sm: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

body {
    font-family: 'Sarabun', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
    background-color: var(--light-color);
}

/* Navbar */
.navbar {
    background-color: var(--primary-color) !important;
    box-shadow: var(--shadow-sm);
}

.navbar-brand {
    color: white !important;
    font-weight: 600;
}

.navbar-brand .glyphicon {
    color: white !important;
}

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

.nav-link:hover {
    color: #fff !important;
    background-color: rgba(255, 255, 255, 0.1);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    padding: 6rem 0;
}

.hero-section .search-box {
    max-width: 600px;
    margin: 2rem auto;
}

.search-box .form-control {
    border-radius: var(--border-radius);
    padding: 1rem;
    font-size: 1.1rem;
}

.search-box .btn {
    padding: 1rem 2rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
}

/* Featured Tests */
.featured-tests .card {
    transition: transform 0.3s ease;
    height: 100%;
}

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

.featured-tests .card-img-top {
    height: 200px;
    object-fit: cover;
}

.featured-tests .card-title {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.featured-tests .card-text {
    color: var(--text-color);
}

/* Categories */
.categories .card {
    transition: transform 0.3s ease;
    height: 100%;
}

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

.categories .card-body {
    padding: 2rem;
}

.categories .card-title {
    font-weight: 600;
    margin-bottom: 1rem;
}

.categories .card-text {
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

/* Statistics */
.statistics {
    background-color: var(--light-color);
}

.statistics .counter {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Call to Action */
.call-to-action {
    background-color: var(--primary-color);
    color: white;
}

.call-to-action h2 {
    font-weight: 600;
}

.call-to-action .lead {
    font-size: 1.25rem;
}

.call-to-action .btn {
    padding: 1rem 2.5rem;
    font-size: 1.1rem;
    border-radius: var(--border-radius);
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5d44;
    border-color: #0b5d44;
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
}

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

.card-title {
    font-weight: 600;
}

.card-text {
    color: var(--text-color);
}

/* Badges */
.badge {
    font-weight: 500;
}

.badge-primary {
    background-color: var(--primary-color);
}

/* Sections */
.section-title {
    font-weight: 600;
    margin-bottom: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 4rem 0;
    }
    
    .search-box .form-control,
    .search-box .btn {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    .statistics .counter {
        font-size: 2rem;
    }
    
    .call-to-action .btn {
        width: 100%;
    }
}

/* Footer */
.footer {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    margin-top: 2rem;
}

.footer-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
    align-items: flex-start;
}

.footer-section {
    margin: 1rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section ul {
    list-style: none;
    padding: 0;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
}

.footer-section a:hover {
    color: #e3f2fd;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    display: none;
    z-index: 999;
}

.back-to-top a {
    display: block;
    width: 50px;
    height: 50px;
    line-height: 50px;
    text-align: center;
    background-color: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: all 0.3s ease;
}

.back-to-top a:hover {
    background-color: #0c6a4d;
    transform: translateY(-3px);
}

/* Loading Animation */
.loading {
    display: none;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: rgba(255, 255, 255, 0.9);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

.loading.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* SEO Font Weight Improvements */
h1 {
    font-weight: 700; /* Boldest for main heading */
}

h2 {
    font-weight: 600; /* Bolder for sub-headings */
}

strong, b {
    font-weight: 600; /* Bolder for emphasized text, consistent with h2 */
}
