/* ─────────────────────────────────────────────────────────
   INTARA SOFT — Custom CSS (Glassmorphism + Animations)
───────────────────────────────────────────────────────── */

/* Google Font: Noto Sans Thai */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Thai:wght@300;400;500;600;700;800&display=swap');

*, *::before, *::after { box-sizing: border-box; }

body {
    font-family: 'Noto Sans Thai', sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* ── Glassmorphism ─────────────────────────────────────── */
.glass {
    background: rgba(255, 255, 255, 0.65);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.glass-dark {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid rgba(255, 255, 255, 0.35);
}

.glass-card {
    background: rgba(255, 255, 255, 0.60);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 32px rgba(99, 102, 241, 0.06), 0 2px 8px rgba(0,0,0,0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.glass-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 48px rgba(99, 102, 241, 0.12), 0 4px 16px rgba(0,0,0,0.06);
}

.glass-nav {
    background: rgba(255, 255, 255, 0.80);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 2px 20px rgba(99, 102, 241, 0.06);
}

/* ── Gradient Background ───────────────────────────────── */
.bg-page {
    background: linear-gradient(135deg,
        #f0f9ff 0%,
        #e0f2fe 20%,
        #ede9fe 50%,
        #faf5ff 75%,
        #fdf4ff 100%);
    min-height: 100vh;
}

/* ── Blobs (decorative background shapes) ─────────────── */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    pointer-events: none;
    z-index: 0;
}

.blob-blue  { background: rgba(99, 102, 241, 0.12); }
.blob-violet{ background: rgba(139, 92, 246, 0.10); }
.blob-pink  { background: rgba(236, 72, 153, 0.08); }
.blob-sky   { background: rgba(14, 165, 233, 0.10); }

/* ── Animations ────────────────────────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33%       { transform: translateY(-12px) rotate(1deg); }
    66%       { transform: translateY(-6px) rotate(-1deg); }
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.94); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes blobPulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.08); }
}

.animate-float       { animation: float 4s ease-in-out infinite; }
.animate-float-slow  { animation: float 6s ease-in-out infinite; }
.animate-fade-in-up  { animation: fadeInUp 0.6s ease-out forwards; }
.animate-fade-in     { animation: fadeIn 0.5s ease-out forwards; }
.animate-scale-in    { animation: scaleIn 0.4s ease-out forwards; }
.animate-blob        { animation: blobPulse 8s ease-in-out infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }
.delay-600 { animation-delay: 0.6s; }

/* ── App Icon ──────────────────────────────────────────── */
.app-icon {
    width: 88px;
    height: 88px;
    border-radius: 20px;
    background-size: cover;
    background-position: center;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    flex-shrink: 0;
}

.app-icon:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}

.app-icon-lg {
    width: 120px;
    height: 120px;
    border-radius: 28px;
}

/* ── Gradient Text ─────────────────────────────────────── */
.gradient-text {
    background: linear-gradient(135deg, #6366f1, #7c3aed, #a855f7);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Store Badges ──────────────────────────────────────── */
.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    text-decoration: none;
    border: 2px solid transparent;
}

.store-badge-play {
    background: #1a1a2e;
    color: #fff;
}
.store-badge-play:hover {
    background: #16213e;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.store-badge-apple {
    background: #000;
    color: #fff;
}
.store-badge-apple:hover {
    background: #1a1a1a;
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

/* ── Admin Sidebar ─────────────────────────────────────── */
.admin-sidebar {
    background: linear-gradient(180deg, #4f46e5 0%, #6d28d9 60%, #7c3aed 100%);
    box-shadow: 4px 0 24px rgba(99, 102, 241, 0.15);
}

.admin-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    border-radius: 10px;
    color: rgba(255,255,255,0.75);
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
}

.admin-nav-item:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

.admin-nav-item.active {
    background: rgba(255,255,255,0.20);
    color: #fff;
    font-weight: 600;
}

/* ── Form Inputs ───────────────────────────────────────── */
.form-input {
    width: 100%;
    padding: 10px 14px;
    border-radius: 10px;
    border: 1.5px solid #e2e8f0;
    background: rgba(255,255,255,0.8);
    color: #1e293b;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: #6366f1;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

/* ── Buttons ───────────────────────────────────────────── */
.btn-primary {
    background: linear-gradient(135deg, #6366f1, #7c3aed);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary:hover {
    opacity: 0.92;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.btn-secondary {
    background: rgba(255,255,255,0.8);
    color: #475569;
    border: 1.5px solid #e2e8f0;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-secondary:hover {
    border-color: #cbd5e1;
    background: white;
}

.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 1.5px solid #fecaca;
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.btn-danger:hover {
    background: #fecaca;
}

/* ── Alerts ────────────────────────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.alert-success { background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; }
.alert-error   { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; }
.alert-warning { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }
.alert-info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* ── Scrollbar ─────────────────────────────────────────── */
::-webkit-scrollbar        { width: 6px; height: 6px; }
::-webkit-scrollbar-track  { background: transparent; }
::-webkit-scrollbar-thumb  { background: #c7d2fe; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #a5b4fc; }

/* ── Table ─────────────────────────────────────────────── */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.data-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: #64748b;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #f1f5f9;
}
.data-table td {
    padding: 14px 16px;
    color: #334155;
    border-bottom: 1px solid #f8fafc;
    vertical-align: middle;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(99, 102, 241, 0.02); }

/* ── Toggle Switch ─────────────────────────────────────── */
.toggle-switch {
    position: relative;
    width: 44px;
    height: 24px;
    display: inline-block;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: #cbd5e1;
    border-radius: 24px;
    transition: 0.3s;
}
.toggle-slider::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.toggle-switch input:checked + .toggle-slider { background: #6366f1; }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── Loader ────────────────────────────────────────────── */
.loader {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: none;
}

/* ── Category Badge ────────────────────────────────────── */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

/* ── Responsive sidebar overlay ───────────────────────── */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.3);
    backdrop-filter: blur(2px);
    z-index: 39;
    display: none;
}

.sidebar-overlay.active { display: block; }
