@import url('https://fonts.googleapis.com/css2?family=Sarabun:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap');

:root {
    --psu-navy-dark: #001f3f;
    --psu-navy: #002D62;
    --psu-blue: #0A4D92;
    --psu-blue-light: #1A6AB7;
    --psu-gold: #D4AF37;
    --psu-gold-light: #F5C042;
    --psu-gold-dark: #B8860B;
    --bg-page: #eeeecf;
}

html {
    font-size: 15px;
    -webkit-text-size-adjust: 100%;
}

@media (min-width: 640px) {
    html {
        font-size: 15px;
    }
}

@media (min-width: 1024px) {
    html {
        font-size: 15px;
    }
}

body,
input,
button,
select,
textarea {
    font-family: 'Sarabun', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

body,
body.bg-slate-50 {
    background-color: var(--bg-page);
    background-image: none;
    color: #1E293B;
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1,
h2,
h3,
h4,
h5,
h6,
.font-heading {
    font-family: 'Sarabun', sans-serif;
    font-weight: 700;
}

/* Glass & Card Styles */
.psu-card {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(226, 232, 240, 0.9);
    box-shadow: 0 8px 24px -6px rgba(0, 45, 98, 0.14), 0 2px 8px -2px rgba(0, 45, 98, 0.06);
}

.psu-card-gold {
    background: rgba(255, 255, 255, 0.98);
    border: 1px solid rgba(212, 175, 55, 0.35);
    box-shadow: 0 10px 28px -6px rgba(0, 45, 98, 0.16), 0 3px 10px -2px rgba(212, 175, 55, 0.12);
}

/* Gold Gradient Accents */
.gold-gradient-bar {
    background: linear-gradient(90deg, #B8860B 0%, #F5C042 30%, #FFF3B0 50%, #F5C042 70%, #B8860B 100%);
}

.gold-gradient-bg {
    background: linear-gradient(135deg, #D4AF37 0%, #F5C042 50%, #B8860B 100%);
}

.gold-text-gradient {
    background: linear-gradient(135deg, #B8860B 0%, #D4AF37 50%, #F5C042 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.psu-navy-gradient {
    background: linear-gradient(135deg, #001f3f 0%, #002D62 50%, #0A4D92 100%);
}

/* Custom Scrollbar */
.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: #F1F5F9;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #0A4D92;
    border-radius: 4px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #002D62;
}

/* Shared slip-details modal footer buttons (public + admin theme) */
.slip-modal-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 0.875rem;
    font-size: 0.75rem;
    line-height: 1.25;
    font-weight: 700;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    white-space: nowrap;
}

/* Header close (X) — match admin slip modal */
.slip-modal-close {
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    padding: 0.375rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
    line-height: 1;
}

.slip-modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.2);
}

.slip-modal-close i {
    font-size: 1rem;
}

/* Modal Overlay Styles */
.modal-overlay {
    position: fixed !important;
    inset: 0 !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    z-index: 1050 !important;
    background-color: rgba(0, 31, 63, 0.65);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.modal-overlay .modal-box {
    transform: scale(0.95);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.open .modal-box {
    transform: scale(1);
}

/* Micro-interaction & Pulse */
@keyframes goldPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.4);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(212, 175, 55, 0);
    }
}

.pulse-gold {
    animation: goldPulse 2.5s infinite;
}

/* Toast Notification Styles */
#toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    max-width: calc(100vw - 32px);
}

.toast-msg {
    pointer-events: auto;
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 45, 98, 0.95);
    color: #FFFFFF;
    backdrop-filter: blur(8px);
    padding: 12px 20px;
    border-radius: 16px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.25);
    font-size: 0.95rem;
    font-weight: 600;
    animation: toastSlideDown 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes toastSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}
/* E-Card preview — ภาพที่วาดจาก ecard-renderer.js (ตรงกับไฟล์ดาวน์โหลด) */
.anumodana-ecard {
    border-radius: 0.75rem;
    overflow: hidden;
    background: #fffdf8;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.12);
    aspect-ratio: 3 / 2;
}
.anumodana-ecard__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Open E-Card button — PSU gold theme */
.btn-open-ecard {
    background: linear-gradient(135deg, #D4AF37 0%, #F5C042 50%, #B8860B 100%) !important;
    border: 1px solid #fcd34d !important;
    color: #001f3f !important;
}
.btn-open-ecard:hover {
    filter: brightness(1.03);
    opacity: 0.95;
}
.btn-open-ecard i {
    color: #001f3f !important;
    opacity: 1;
}

/* Download E-Card button — color follows card border */
.btn-download-ecard {
    --card-border: #d4af37;
    background: var(--card-border) !important;
    border: 1.5px solid color-mix(in srgb, var(--card-border) 70%, #000) !important;
    color: #fff !important;
}
.btn-download-ecard:hover {
    filter: brightness(0.94);
}
.btn-download-ecard i {
    color: inherit !important;
    opacity: 0.95;
}
