/* ============================================================
   assets/css/app.css
   Theme "Zen/Organic Matcha" — เพิ่มเติมจาก Tailwind
   ============================================================ */

/* Safe area สำหรับ iPhone notch */
.pb-safe { padding-bottom: env(safe-area-inset-bottom); }

/* ซ่อน scrollbar แต่ยังเลื่อนได้ */
.no-scrollbar::-webkit-scrollbar { display: none; }
.no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* ---- Paper grain texture overlay ---- */
.paper-texture { position: relative; }
.paper-texture::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
    border-radius: inherit;
}

/* ---- Body texture ---- */
body {
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
}

/* ---- Zen card ---- */
.zen-card {
    background-color: #f6f3f2; /* surface-container-low */
    border: 1px solid rgba(155, 155, 122, 0.3);
    border-radius: 0.5rem;
    position: relative;
    overflow: hidden;
}
.zen-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
}
.zen-card > * { position: relative; z-index: 1; }

/* ---- Paper card ---- */
.paper-card {
    border: 1px solid rgba(155, 155, 122, 0.3);
    background-color: #fcf9f8; /* surface */
    position: relative;
}
.paper-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.02'/%3E%3C/svg%3E");
    pointer-events: none;
    border-radius: inherit;
}

/* ---- Shuttlecock divider (คั่น section) ---- */
.shuttlecock-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 2rem 0;
}
.shuttlecock-divider::before,
.shuttlecock-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background-color: #9b9b7a;
    opacity: 0.3;
}
.shuttlecock-divider span {
    padding: 0 1rem;
    font-size: 1.5rem;
    opacity: 0.7;
}

/* ---- Shuttlecock background motif ---- */
.shuttlecock-bg {
    background-image: url("data:image/svg+xml,%3Csvg width='120' height='120' viewBox='0 0 120 120' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M60 20 L50 60 L70 60 Z' stroke='%231b1c1c' stroke-width='1' stroke-opacity='0.08'/%3E%3Cpath d='M60 60 L40 100 M60 60 L60 100 M60 60 L80 100' stroke='%231b1c1c' stroke-width='1' stroke-opacity='0.08'/%3E%3Ccircle cx='60' cy='105' r='5' stroke='%231b1c1c' stroke-width='1' stroke-opacity='0.08'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right top;
}

/* ---- Input แบบ Zen (underline เท่านั้น) ---- */
.input-zen {
    background-color: rgba(246, 243, 242, 0.8);
    border: none;
    border-bottom: 1px solid rgba(119, 120, 104, 0.4);
    border-radius: 0;
    transition: border-bottom-color 0.2s, background-color 0.2s;
}
.input-zen:focus {
    outline: none;
    border-bottom: 2px solid #53620f;
    background-color: #fcf9f8;
}

/* ---- Stepper buttons ---- */
.stepper-btn {
    border: 1px solid rgba(155, 155, 122, 0.3);
    background-color: transparent;
    transition: all 0.2s ease;
    user-select: none;
}
.stepper-btn:active {
    background-color: #eae7e7;
    transform: scale(0.95);
}

/* ---- Floating shuttlecock animation ---- */
@keyframes float {
    0% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(5deg); }
    100% { transform: translateY(0px) rotate(0deg); }
}
.floating-shuttle { animation: float 4s ease-in-out infinite; }

/* ---- Modal transitions ---- */
.modal-overlay { transition: opacity 0.3s ease; }
.modal-sheet   { transition: transform 0.3s cubic-bezier(0.16,1,0.3,1); }
.modal-overlay.is-open { opacity: 1; }
.modal-overlay:not(.is-open) { opacity: 0; pointer-events: none; }
.modal-overlay.is-open .modal-sheet { transform: translateY(0); }
.modal-overlay:not(.is-open) .modal-sheet { transform: translateY(100%); }

/* ---- Toast animation ---- */
@keyframes toastIn {
    from { opacity: 0; transform: translate(-50%, -10px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
#toast.show { display: block; animation: toastIn 0.25s ease-out; }

/* ---- Material Symbols base ---- */
.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 300, 'GRAD' 0, 'opsz' 24;
}

/* ---- fade-in สำหรับ content ---- */
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.fade-in { animation: fadeIn 0.4s ease-out; }

/* ---- ปุ่ม primary ---- */
.btn-primary {
    background-color: #53620f;
    color: #fff;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-primary:hover { background-color: #556512; }
.btn-primary:active { transform: scale(0.98); }

/* ---- ปุ่ม ghost ---- */
.btn-ghost {
    border: 1px solid #1b1c1c;
    color: #1b1c1c;
}
.btn-ghost:hover { background-color: #e4e2e1; }
