/* ============================
   AI Book Concert - Custom Styles
   ============================ */

/* Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
}

/* Tab Styles */
.tab-btn {
    color: #94a3b8; /* slate-400 */
    border-bottom: 2px solid transparent;
}

.tab-btn:hover {
    color: #475569; /* slate-600 */
    background-color: #f8fafc; /* slate-50 */
}

.tab-btn.active {
    color: #4f46e5; /* indigo-600 */
    border-bottom-color: #4f46e5;
    background-color: #eef2ff; /* indigo-50 */
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(15, 23, 42, 0.6); /* slate-900/60 */
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.modal-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay.hidden {
    display: none;
}

.modal-content {
    transform: translateY(10px) scale(0.98);
    transition: transform 0.2s ease;
}

.modal-overlay.show .modal-content {
    transform: translateY(0) scale(1);
}

/* Admin Table Row Hover */
#adminTableBody tr {
    transition: background-color 0.15s ease;
}

#adminTableBody tr:hover {
    background-color: #f8fafc; /* slate-50 */
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1; /* slate-300 */
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8; /* slate-400 */
}

/* Input Autofill Override */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px white inset;
    -webkit-text-fill-color: #1e293b; /* slate-800 */
    transition: background-color 5000s ease-in-out 0s;
}

/* Button Loading State */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Responsive table adjustments */
@media (max-width: 640px) {
    #adminTableBody td {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    #adminTableBody th {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}

/* Focus ring for accessibility */
input:focus-visible,
select:focus-visible,
button:focus-visible {
    outline: 2px solid #6366f1; /* indigo-500 */
    outline-offset: 2px;
}

/* Animation for result card */
@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeSlideIn 0.3s ease forwards;
}

/* ============================
   Hero Entry Animations
   ============================ */
@keyframes heroFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

.hero-animate {
    opacity: 0;
}

.hero-fade-in {
    animation: heroFadeIn 0.8s ease-out forwards;
}

.hero-slide-up {
    animation: heroSlideUp 0.8s ease-out forwards;
}

.hero-slide-up-delay {
    animation: heroSlideUp 0.8s ease-out 0.2s forwards;
}

/* ============================
   Floating Particles
   ============================ */
@keyframes particleFloat {
    0%, 100% {
        transform: translateY(0) scale(1);
        opacity: 0.7;
    }
    50% {
        transform: translateY(-20px) scale(1.2);
        opacity: 1;
    }
}

.floating-particles {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    left: var(--x);
    top: var(--y);
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, rgba(192, 132, 252, 0.8) 0%, rgba(168, 85, 247, 0.4) 100%);
    border-radius: 50%;
    animation: particleFloat 4s ease-in-out infinite;
    animation-delay: var(--delay);
    box-shadow: 0 0 12px rgba(192, 132, 252, 0.5), 0 0 24px rgba(168, 85, 247, 0.2);
}

/* ============================
   Gradient Text
   ============================ */
.text-gradient {
    background: linear-gradient(135deg, #22d3ee, #c084fc); /* cyan-400 → purple-400 */
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================
   Pill Buttons (FLOW~ style)
   ============================ */
.btn-pill-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #4f46e5, #6366f1); /* indigo-600 → indigo-500 */
    color: white;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

.btn-pill-primary:hover {
    background: linear-gradient(135deg, #4338ca, #4f46e5);
    box-shadow: 0 4px 16px rgba(79, 70, 229, 0.35);
    transform: translateY(-1px);
}

.btn-pill-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: #475569; /* slate-600 */
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    border: 1.5px solid #cbd5e1; /* slate-300 */
    transition: all 0.2s ease;
}

.btn-pill-outline:hover {
    border-color: #94a3b8; /* slate-400 */
    background: #f8fafc; /* slate-50 */
    transform: translateY(-1px);
}

.btn-pill-outline-dark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    border: 1.5px solid rgba(255, 255, 255, 0.2);
    transition: all 0.2s ease;
}

.btn-pill-outline-dark:hover {
    border-color: rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.05);
    color: white;
    transform: translateY(-1px);
}

/* ============================
   Scroll Indicator
   ============================ */
@keyframes scrollBounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateX(-50%) translateY(0);
    }
    40% {
        transform: translateX(-50%) translateY(-8px);
    }
    60% {
        transform: translateX(-50%) translateY(-4px);
    }
}

.scroll-indicator {
    position: absolute;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    animation: scrollBounce 2s infinite;
    color: #94a3b8; /* slate-400 */
}

/* ============================
   Section Scroll Reveal
   ============================ */
.section-reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.section-reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ============================
   Active Nav Link
   ============================ */
.nav-link.active {
    color: #4f46e5; /* indigo-600 */
    background-color: #eef2ff; /* indigo-50 */
}

/* ============================
   Reduced Motion
   ============================ */
@media (prefers-reduced-motion: reduce) {
    .hero-animate,
    .particle,
    .scroll-indicator {
        animation: none !important;
        opacity: 1 !important;
    }

    .section-reveal {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}
