@import "https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css";

/* Fonts Setup */
.font-heading {
    font-family: 'IBM Plex Sans Thai', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.font-body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

body {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1e293b;
    background-color: #f8fafc;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'IBM Plex Sans Thai', sans-serif;
    font-weight: 600;
}

/* Modal Popup Styles */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background-color: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease-in-out;
    padding: 1rem;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background: #ffffff;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    width: 100%;
    max-width: 32rem;
    transform: scale(0.95);
    transition: transform 0.2s ease-in-out;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.modal-backdrop.active .modal-card {
    transform: scale(1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Tailwind 3 Slate Palette & Extensions for full fidelity */
.bg-slate-950 { background-color: #020617; }
.bg-slate-900 { background-color: #0f172a; }
.bg-slate-800 { background-color: #1e293b; }
.bg-slate-700 { background-color: #334155; }
.bg-slate-600 { background-color: #475569; }
.bg-slate-500 { background-color: #64748b; }
.bg-slate-400 { background-color: #94a3b8; }
.bg-slate-300 { background-color: #cbd5e1; }
.bg-slate-200 { background-color: #e2e8f0; }
.bg-slate-100 { background-color: #f1f5f9; }
.bg-slate-50  { background-color: #f8fafc; }

.text-slate-950 { color: #020617; }
.text-slate-900 { color: #0f172a; }
.text-slate-800 { color: #1e293b; }
.text-slate-700 { color: #334155; }
.text-slate-600 { color: #475569; }
.text-slate-500 { color: #64748b; }
.text-slate-400 { color: #94a3b8; }
.text-slate-300 { color: #cbd5e1; }
.text-slate-200 { color: #e2e8f0; }
.text-slate-100 { color: #f1f5f9; }
.text-slate-50  { color: #f8fafc; }

.border-slate-950 { border-color: #020617; }
.border-slate-900 { border-color: #0f172a; }
.border-slate-800 { border-color: #1e293b; }
.border-slate-700 { border-color: #334155; }
.border-slate-600 { border-color: #475569; }
.border-slate-500 { border-color: #64748b; }
.border-slate-400 { border-color: #94a3b8; }
.border-slate-300 { border-color: #cbd5e1; }
.border-slate-200 { border-color: #e2e8f0; }
.border-slate-100 { border-color: #f1f5f9; }
.border-slate-50  { border-color: #f8fafc; }

/* Interactive Hover & Group States */
.hover\:bg-slate-950:hover { background-color: #020617; }
.hover\:bg-slate-900:hover { background-color: #0f172a; }
.hover\:bg-slate-800:hover { background-color: #1e293b; }
.hover\:bg-slate-700:hover { background-color: #334155; }
.hover\:bg-slate-200:hover { background-color: #e2e8f0; }
.hover\:bg-slate-100:hover { background-color: #f1f5f9; }
.hover\:bg-slate-50:hover  { background-color: #f8fafc; }

.hover\:text-white:hover { color: #ffffff; }
.hover\:text-slate-200:hover { color: #e2e8f0; }
.hover\:text-slate-300:hover { color: #cbd5e1; }
.hover\:text-slate-400:hover { color: #94a3b8; }
.hover\:text-blue-400:hover { color: #60a5fa; }
.hover\:text-blue-600:hover { color: #2563eb; }
.hover\:text-red-400:hover { color: #f87171; }
.hover\:text-red-600:hover { color: #dc2626; }

.group:hover .group-hover\:text-white { color: #ffffff; }
.group:hover .group-hover\:text-blue-400 { color: #60a5fa; }
.group:hover .group-hover\:text-blue-600 { color: #2563eb; }
.group:hover .group-hover\:bg-slate-50 { background-color: #f8fafc; }

.rounded-2xl { border-radius: 1rem; }
.rounded-3xl { border-radius: 1.5rem; }
.rounded-xl  { border-radius: 0.75rem; }

/* Line clamp */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Nav Dropdown Animations & Styles */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    padding-top: 0.375rem;
    z-index: 50;
}

/* Hover & Focus on Desktop */
@media (min-width: 1024px) {
    .nav-dropdown:hover .nav-dropdown-menu,
    .nav-dropdown:focus-within .nav-dropdown-menu {
        display: block;
    }

    .nav-dropdown:hover .nav-dropdown-icon,
    .nav-dropdown:focus-within .nav-dropdown-icon {
        transform: rotate(180deg);
    }
}

/* Click/Touch open state */
.nav-dropdown.is-open .nav-dropdown-menu {
    display: block;
}

.nav-dropdown.is-open .nav-dropdown-icon {
    transform: rotate(180deg);
}

.nav-dropdown-icon {
    transition: transform 0.2s ease-in-out;
}

/* Admin header user menu — align dropdown to the right */
.admin-user-menu .nav-dropdown-menu {
    left: auto;
    right: 0;
    min-width: 0;
}

@keyframes dropdownFadeIn {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeIn {
    animation: dropdownFadeIn 0.15s ease-out forwards;
}

details summary::-webkit-details-marker {
    display: none;
}
details summary {
    list-style: none;
}

/* FAQ visibility option cards */
.faq-visibility-card {
    position: relative !important;
    display: flex !important;
    cursor: pointer;
    border-radius: 1rem !important;
    border: 2px solid #e2e8f0 !important;
    padding: 1rem !important;
    background-color: #ffffff !important;
    transition: border-color 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}
.faq-visibility-card:hover {
    border-color: #cbd5e1 !important;
}
.faq-visibility-card.is-active-public {
    border-color: #059669 !important;
    background-color: #ecfdf5 !important;
    box-shadow: 0 0 0 1px #059669 !important;
}
.faq-visibility-card.is-active-members {
    border-color: #4f46e5 !important;
    background-color: #eef2ff !important;
    box-shadow: 0 0 0 1px #4f46e5 !important;
}
.faq-visibility-card input[type="radio"] {
    position: absolute !important;
    opacity: 0 !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* Article / knowledge content */
.prose h2 {
    font-size: 1.25rem;
    margin-top: 1.75rem;
    margin-bottom: 0.75rem;
    color: #0f172a;
}
.prose h3 {
    font-size: 1.05rem;
    margin-top: 1.35rem;
    margin-bottom: 0.5rem;
    color: #1e293b;
}
.prose p {
    margin-bottom: 0.9rem;
}
.prose ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin-bottom: 0.9rem;
}
.prose ol {
    list-style: decimal;
    padding-left: 1.25rem;
    margin-bottom: 0.9rem;
}
.prose li {
    margin-bottom: 0.35rem;
}
.prose a {
    color: #2563eb;
    text-decoration: underline;
}
.prose a:hover {
    color: #1d4ed8;
}
.article-figure {
    margin: 1.5rem 0;
}
.article-figure img {
    width: 100%;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
}
.article-figure figcaption {
    font-size: 0.75rem;
    color: #64748b;
    text-align: center;
    margin-top: 0.5rem;
    line-height: 1.5;
}
.article-sources {
    margin-top: 2rem;
    padding: 1.25rem 1.35rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
}
.article-sources h2 {
    margin-top: 0;
    font-size: 1.05rem;
}
.article-sources ol {
    margin-bottom: 0;
    font-size: 0.875rem;
    color: #334155;
}

/* ThaiD login button — brand yellow + navy from official logo */
.btn-thaid {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    min-height: 3.25rem;
    padding: 0.5rem 1rem;
    background-color: #FFC20E;
    color: #1E2C88;
    font-weight: 600;
    font-size: 0.875rem;
    line-height: 1.25;
    border-radius: 0.75rem;
    border: 2px solid #1E2C88;
    box-shadow: 0 4px 10px -2px rgba(30, 44, 136, 0.22);
    text-decoration: none;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}
.btn-thaid:hover {
    background-color: #F0B400;
    box-shadow: 0 6px 14px -2px rgba(30, 44, 136, 0.28);
    color: #161F6B;
}
.btn-thaid:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 194, 14, 0.55), 0 0 0 5px #1E2C88;
}
.btn-thaid:active {
    transform: translateY(1px);
    background-color: #E5AB00;
}
.btn-thaid-logo {
    display: block;
    height: 2rem;
    width: auto;
    max-width: 7rem;
    object-fit: contain;
    border-radius: 0.4rem;
    flex-shrink: 0;
}
@media (max-width: 380px) {
    .btn-thaid {
        gap: 0.5rem;
        padding: 0.5rem 0.75rem;
    }
    .btn-thaid-logo {
        height: 1.65rem;
    }
}

