/* ===== GLOBAL LAYOUT ===== */

/* จัด layout ให้ footer อยู่ด้านล่างเสมอ */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: 'Graphik Thai Loop', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* ===== NAVIGATION BAR STYLES ===== */

/* Logo NIDA */
.nida-logo-img {
    height: 60px;
    width: auto;
}

/* ข้อความชื่อสถาบัน */
.institute-text {
    line-height: 1.2;
}

.institute-name-thai {
    font-family: 'Graphik Thai Loop', sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 2px;
}

.institute-name-english {
    font-family: 'Manifestor', sans-serif;
    font-size: 12px;
    color: #7f8c8d;
    font-weight: 400;
}

/* Navigation Links */
.nav-link {
    color: #2c3e50 !important;
    font-weight: 500;
    padding: 8px 16px !important;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.nav-link:hover {
    color: #3498db !important;
    background-color: #f8f9fa;
    transform: translateY(-1px);
}

/* ซ่อน navbar menu ใน mobile */
@media (max-width: 991.98px) {
    .navbar-nav {
        display: none !important;
    }
    
    .navbar-toggler {
        display: none !important;
    }
    
    .navbar-collapse {
        display: none !important;
    }
}

/* Search Button */
.btn-outline-secondary {
    border: 2px solid #bdc3c7;
    color: #7f8c8d;
    border-radius: 8px;
    padding: 8px 12px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background-color: #ecf0f1;
    border-color: #95a5a6;
    color: #2c3e50;
}

/* Register Button */
.btn-register {
    background-color: #c0392b;
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-register:hover {
    background-color: #a93226;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.3);
}

/* Dropdown Menu */
.dropdown-menu {
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    margin-top: 8px;
}

.dropdown-item {
    color: #2c3e50;
    padding: 8px 16px;
    transition: all 0.3s ease;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #3498db;
}

/* ===== HERO SECTION STYLES ===== */

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 600"><rect fill="%23667eea" width="1200" height="600"/><path fill="%23764ba2" d="M0 400c150-50 300-100 600-80s450 70 600 40v240H0z"/><circle fill="%23ffffff" fill-opacity="0.1" cx="200" cy="150" r="100"/><circle fill="%23ffffff" fill-opacity="0.1" cx="800" cy="200" r="80"/><circle fill="%23ffffff" fill-opacity="0.05" cx="1000" cy="100" r="120"/></svg>');
    background-size: cover;
    background-position: center;
    flex: 1;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-overlay {
    background: rgba(102, 126, 234, 0.8);
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    position: relative;
}

.hero-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
    z-index: 1;
}

.hero-overlay .container {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-family: 'Manifestor', sans-serif;
    font-size: 3.5rem;
    font-weight: 500;
    color: white;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    animation: fadeInUp 0.8s ease forwards;
}

.hero-subtitle {
    font-family: 'Manifestor', sans-serif;
    font-size: 2.2rem;
    font-weight: 400;
    color: #f8f9fa;
    margin-bottom: 1.5rem;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.2s;
}

.hero-description {
    font-family: 'Graphik Thai Loop', sans-serif;
    font-size: 1.3rem;
    color: #ecf0f1;
    margin-bottom: 2.5rem;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.4s;
}

.btn-hero-cta {
    font-family: 'Graphik Thai Loop', sans-serif;
    background-color: #c0392b;
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.4s ease;
    box-shadow: 0 6px 20px rgba(192, 57, 43, 0.3);
    text-transform: none;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.6s;
    text-decoration: none;
}

.btn-hero-cta:hover {
    background-color: #a93226;
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(192, 57, 43, 0.4);
    color: white;
}

.btn-hero-cta:active {
    transform: translateY(-1px);
}

.hero-contact {
    font-family: 'Graphik Thai Loop', sans-serif;
    font-size: 1rem;
    color: #f8f9fa;
    margin-top: 2rem;
    margin-bottom: 0;
    font-weight: 400;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.2);
    opacity: 0.9;
    animation: fadeInUp 0.8s ease forwards;
    animation-delay: 0.8s;
}

/* ===== FOOTER SECTION STYLES ===== */

.footer-section {
    background-color: #1b1833;
    color: white;
    padding: 2rem 0;
    margin-top: auto;
    flex-shrink: 0;
}

.footer-section p {
    margin-bottom: 0;
    font-size: 0.95rem;
    opacity: 0.9;
    font-family: 'Graphik Thai Loop', sans-serif;
}

/* ===== ANIMATIONS ===== */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */

/* Tablet และ Mobile */
@media (max-width: 768px) {
    /* Navigation adjustments */
    .institute-name-thai {
        font-size: 16px;
    }
    
    .institute-name-english {
        font-size: 11px;
    }
    
    .nida-logo-img {
        height: 50px;
    }
    
    /* Hero section adjustments */
    .hero-section {
        flex: 1;
        min-height: 80vh;
        padding: 1rem 0;
    }
    
    .hero-title {
        font-size: 2.5rem;
        margin-bottom: 1rem;
    }
    
    .hero-subtitle {
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }
    
    .btn-hero-cta {
        padding: 12px 30px;
        font-size: 1.1rem;
    }
    
    /* Footer adjustments */
    .footer-section {
        padding: 1.5rem 0;
    }
    
    .hero-contact {
        font-size: 0.85rem;
        margin-top: 1.2rem;
        padding: 0 1.5rem;
        line-height: 1.3;
    }
    
    /* Footer adjustments */
    .footer-section {
        padding: 1.5rem 0;
    }
    
    .footer-section p {
        padding: 0 1rem;
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* Mobile ขนาดเล็ก */
@media (max-width: 576px) {
    /* Hide institute text on very small screens */
    .institute-text {
        display: none;
    }
    
    /* Adjust navbar padding */
    .navbar .container-fluid {
        padding: 0.5rem 1rem;
    }
    
    /* Hero section for small mobile */
    .hero-section {
        flex: 1;
        min-height: 75vh;
        padding: 0.5rem 0;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: 1.4rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
        padding: 0 1.5rem;
        line-height: 1.3;
    }
    
    .btn-hero-cta {
        padding: 10px 25px;
        font-size: 1rem;
        border-radius: 25px;
    }
    
    /* Footer for small mobile */
    .footer-section {
        padding: 1.2rem 0;
    }
    
    .footer-section p {
        font-size: 0.8rem;
        line-height: 1.3;
        padding: 0 1.5rem;
        text-align: center;
    }
}

/* Extra small mobile (landscape phones) */
@media (max-width: 480px) {
    .hero-section {
        min-height: 70vh;
    }
    
    .hero-title {
        font-size: 1.6rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        padding: 0 2rem;
    }
    
    .btn-hero-cta {
        padding: 8px 20px;
        font-size: 0.95rem;
    }
    
    .hero-contact {
        font-size: 0.8rem;
        margin-top: 1rem;
        padding: 0 2rem;
    }
}

/* iPhone SE และหน้าจอเล็กมาก */
@media (max-width: 375px) {
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-description {
        font-size: 0.9rem;
        margin-bottom: 1.2rem;
    }
    
    .hero-contact {
        font-size: 0.4rem;
        margin-top: 0.8rem;
        padding: 0 1rem;
    }
    
    .footer-section p {
        font-size: 0.75rem;
        padding: 0 1rem;
    }
}