* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Roboto', 'Arial', sans-serif;
    line-height: 1.6;
    color: #2c3e50;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
    border-bottom: 4px solid #ffd700;
}

.header h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
}

.header h1 i {
    color: #ffd700;
    margin-right: 15px;
}

.header p {
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
}

.logo-center {
    text-align: center;
    margin-bottom: 2rem;
}

.school-logo {
    width: 150px;
    height: 150px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    padding: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.title-section {
    text-align: center;
}

.title-section h1 {
    font-size: 2.8rem;
    margin-bottom: 1rem;
    font-weight: 600;
    letter-spacing: 1px;
    line-height: 1.3;
}

.main-title {
    font-size: 1em;
    font-weight: 700;
    color: #ffffff;
    display: inline-block;
    margin-bottom: 0.5rem;
}

.school-name {
    font-size: 0.85em;
    font-weight: 600;
    color: #ffd700;
    display: inline-block;
    margin-bottom: 0.3rem;
}

.class-info {
    font-size: 0.7em;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(255, 215, 0, 0.2);
    padding: 0.3rem 1rem;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.5);
    display: inline-block;
}

.title-section p {
    font-size: 1.3rem;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.9);
}

.header-badge {
    display: inline-block;
    background: rgba(255, 215, 0, 0.2);
    border: 2px solid #ffd700;
    padding: 8px 24px;
    border-radius: 25px;
    color: #ffd700;
    font-weight: 600;
    font-size: 0.9rem;
    letter-spacing: 1px;
}


/* Exam Location Info Section */
.exam-location-info {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 25px rgba(30, 60, 114, 0.1);
    margin-bottom: 2rem;
}

.exam-location-info h3 {
    color: #1e3c72;
    font-size: 1.4rem;
    margin-bottom: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.exam-location-info h3 i {
    margin-right: 0.5rem;
    color: #ffd700;
}

.location-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.location-card {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    transition: all 0.3s ease;
    position: relative;
}

.location-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.location-card-same {
    background: linear-gradient(135deg, #e8f5e8 0%, #f0f8f0 100%);
    border-left: 4px solid #28a745;
}

.location-header {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #2c3e50;
}

.location-header i {
    margin-right: 0.5rem;
    font-size: 1.1rem;
}

.location-card-same .location-header i {
    color: #28a745;
}

.location-body p {
    margin: 0.4rem 0;
    font-size: 0.9rem;
    color: #495057;
}

.location-body strong {
    color: #2c3e50;
}

/* กำหนดสไตล์สำหรับจังหวัดและสนามสอบ */
.province-name {
    color: #dc3545 !important;
    font-size: 1.2em !important;
    font-weight: 700 !important;
}

.location-body .exam-venue {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 700 !important;
}

.location-body .exam-province {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
}

/* เพิ่มความเฉพาะเจาะจงมากขึ้น */
.location-card .location-body strong.exam-venue {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 700 !important;
}

.location-card .location-body span.exam-province {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
}

/* เพิ่ม CSS ที่เฉพาะเจาะจงมากที่สุด */
.location-card-same .location-header .province-name {
    color: #dc3545 !important;
    font-size: 1.2em !important;
    font-weight: 700 !important;
}

.location-card-same .location-body strong.exam-venue {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 700 !important;
}

.location-card-same .location-body span.exam-province {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
}

/* CSS ที่เฉพาะเจาะจงมากที่สุด - ใช้ ID หรือ attribute selector */
div.location-card-same div.location-header strong span.province-name {
    color: #dc3545 !important;
    font-size: 1.2em !important;
    font-weight: 700 !important;
}

div.location-card-same div.location-body p strong.exam-venue {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 700 !important;
}

div.location-card-same div.location-body p span.exam-province {
    color: #dc3545 !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
}


.map-section {
    margin-top: 0.8rem;
    padding-top: 0.8rem;
    border-top: 1px solid #dee2e6;
}

.map-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: #007bff !important;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    background: rgba(0, 123, 255, 0.1);
    border-radius: 4px;
    transition: all 0.3s ease;
}

.map-link:hover {
    background: rgba(0, 123, 255, 0.2);
    color: #0056b3 !important;
    text-decoration: none;
    transform: translateY(-1px);
}

.map-link i {
    font-size: 1rem;
}

/* Search Results */
.search-results {
    margin-top: 1rem;
    display: none;
}

.search-loading {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
    font-size: 1.1rem;
}

.search-loading i {
    margin-right: 0.5rem;
    color: #1e3c72;
}

.search-error {
    text-align: center;
    padding: 2rem;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    font-size: 1.1rem;
}

.search-error i {
    margin-right: 0.5rem;
}

.search-info {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    border: 1px solid #dee2e6;
}

.search-info h3 {
    color: #495057;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.result-count {
    color: #007bff;
    font-weight: 600;
}

.search-info p {
    color: #6c757d;
    margin: 0;
    font-size: 0.9rem;
}


/* Search Section */
.search-section {
    background: white;
    border-radius: 8px;
    padding: 3rem;
    margin: 2rem 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e8e8e8;
}

.search-section h2 {
    color: #2c3e50;
    font-size: 1.8rem;
    margin-bottom: 2rem;
    text-align: center;
    font-weight: 600;
}

.search-section h2 i {
    color: #1e3c72;
    margin-right: 10px;
}

.search-form {
    display: flex;
    gap: 15px;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.search-input-container {
    position: relative;
    flex: 5;
    min-width: 700px;
}

.search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #d1d5db;
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
}

.search-input:focus {
    border-color: #1e3c72;
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.1);
}



.search-btn {
    background: linear-gradient(135deg, #1e3c72, #2a5298);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(30, 60, 114, 0.3);
    transition: all 0.3s ease;
}

.search-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 60, 114, 0.4);
}

.reset-btn {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    border: none;
    padding: 16px 32px;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
    transition: all 0.3s ease;
}

.reset-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
    background: linear-gradient(135deg, #5a6268, #3d4043);
}

/* Results */
.results {
    margin-top: 2rem;
}

.result-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1.8rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.result-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #1e3c72, #2a5298);
}

.result-item:hover {
    border-color: #1e3c72;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 60, 114, 0.15);
}

.student-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.student-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.detail-item {
    margin-bottom: 0.5rem;
    color: #555;
}

.detail-item strong {
    color: #2c3e50;
    font-weight: 600;
}

.exam-info {
    background: rgba(30, 60, 114, 0.08);
    padding: 1.2rem;
    border-radius: 6px;
    margin-top: 1rem;
    border-left: 3px solid #1e3c72;
}

.exam-info h4 {
    color: #1e3c72;
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.no-results {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #f39c12;
}


/* Footer */
.footer {
    background: #1a2332;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 4rem;
    border-top: 4px solid #ffd700;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-main h4,
.footer-contact h4 {
    color: #ffd700;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.footer-main p,
.footer-contact p {
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
    line-height: 1.4;
}

.footer-contact i {
    color: #ffd700;
    margin-right: 8px;
    width: 16px;
}

.footer-bottom {
    background: #0f1419;
    border-top: 1px solid #2c3e50;
    padding: 1rem 0;
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
}

.copyright p {
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
}

.copyright p:first-child {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.2rem;
}

/* Responsive */
@media (max-width: 1024px) {
    .search-input-container {
        min-width: 400px;
    }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }
    
    .school-logo {
        width: 120px;
        height: 120px;
    }
    
    .title-section h1 {
        font-size: 1.8rem;
    }

    .main-title {
        font-size: 1em;
    }

    .school-name {
        font-size: 0.8em;
    }

    .class-info {
        font-size: 0.65em;
        padding: 0.25rem 0.8rem;
    }
    
    .title-section p {
        font-size: 1rem;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-input-container {
        min-width: auto;
        flex: 1;
    }
    
    .search-input {
        min-width: auto;
    }

    .search-btn, .reset-btn {
        width: 100%;
        min-width: unset;
    }
    
    .student-details {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding: 1.5rem 1rem;
        text-align: center;
    }

        .footer-bottom-content {
            padding: 0 1rem;
        }
        
        .location-grid {
            grid-template-columns: 1fr;
            gap: 1rem;
        }
        
        .exam-location-info {
            padding: 1.5rem 1rem;
        }
        
        .exam-location-info h3 {
            font-size: 1.2rem;
        }
    }
