/* ===== HumanEdu Custom Styles ===== */

/* Hide x-cloak elements until Alpine.js initializes */
[x-cloak] { display: none !important; }

/* Prevent horizontal scroll globally */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

/* Ensure images and media never overflow */
img, video, canvas, iframe {
    max-width: 100%;
}

/* Inline SVGs should not overflow their container */
svg:not([class*="w-"]) {
    max-width: 100%;
}

/* Nav links */
.nav-link {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: #64748b;
    white-space: nowrap;
    transition: color 0.15s, background-color 0.15s;
    text-decoration: none;
}
.dark .nav-link {
    color: #94a3b8;
}
.nav-link:hover {
    color: #2563eb;
    background-color: #eff6ff;
}
.dark .nav-link:hover {
    color: #60a5fa;
    background-color: rgba(37, 99, 235, 0.1);
}
.nav-link.active {
    color: #1d4ed8;
    font-weight: 600;
    background-color: #dbeafe;
}
.dark .nav-link.active {
    color: #60a5fa;
    background-color: rgba(37, 99, 235, 0.15);
}
.mobile-nav-link {
    @apply flex items-center px-4 py-2.5 rounded-xl text-sm font-medium text-gray-600 dark:text-gray-300 hover:text-blue-600 dark:hover:text-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-all;
}
.mobile-nav-link.active {
    @apply bg-gradient-to-r from-blue-600 to-violet-600 text-white font-semibold;
}
.dropdown-item {
    @apply flex items-center gap-2 px-4 py-2 text-sm text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-slate-700 transition-colors;
}
.footer-link {
    @apply text-gray-400 hover:text-blue-400 transition-colors;
}

/* Form inputs */
.form-input {
    @apply w-full px-4 py-3 rounded-xl border border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-800 text-gray-900 dark:text-gray-100 placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent transition-all text-sm;
}

/* Cards */
.card {
    @apply bg-white dark:bg-slate-800 rounded-2xl border border-gray-100 dark:border-slate-700 shadow-sm hover:shadow-md transition-shadow;
}
.card-glass {
    @apply bg-white/70 dark:bg-slate-800/70 backdrop-blur-sm rounded-2xl border border-white/50 dark:border-slate-700/50 shadow-lg;
}

/* Buttons */
.btn-primary {
    @apply inline-flex items-center justify-center gap-2 px-6 py-3 bg-gradient-to-r from-blue-600 to-violet-600 hover:from-blue-700 hover:to-violet-700 text-white font-semibold rounded-xl transition-all shadow-md hover:shadow-lg hover:-translate-y-0.5 text-sm;
}
.btn-secondary {
    @apply inline-flex items-center justify-center gap-2 px-6 py-3 bg-white dark:bg-slate-800 text-gray-700 dark:text-gray-300 font-semibold rounded-xl border border-gray-200 dark:border-slate-700 hover:bg-gray-50 dark:hover:bg-slate-700 transition-all text-sm;
}
.btn-outline {
    @apply inline-flex items-center justify-center gap-2 px-6 py-3 border-2 border-blue-600 dark:border-blue-400 text-blue-600 dark:text-blue-400 font-semibold rounded-xl hover:bg-blue-600 hover:text-white dark:hover:bg-blue-600 dark:hover:text-white transition-all text-sm;
}

/* Badges */
.badge {
    @apply inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium;
}
.badge-blue { @apply badge bg-blue-100 dark:bg-blue-900/30 text-blue-700 dark:text-blue-400; }
.badge-violet { @apply badge bg-violet-100 dark:bg-violet-900/30 text-violet-700 dark:text-violet-400; }
.badge-green { @apply badge bg-green-100 dark:bg-green-900/30 text-green-700 dark:text-green-400; }
.badge-amber { @apply badge bg-amber-100 dark:bg-amber-900/30 text-amber-700 dark:text-amber-400; }
.badge-red { @apply badge bg-red-100 dark:bg-red-900/30 text-red-700 dark:text-red-400; }

/* Section headings */
.section-title {
    @apply text-3xl md:text-4xl font-bold text-gray-900 dark:text-white;
}
.section-subtitle {
    @apply text-lg text-gray-600 dark:text-gray-400 mt-3 max-w-2xl;
}
.section-tag {
    @apply inline-flex items-center gap-2 px-4 py-1.5 bg-blue-50 dark:bg-blue-900/30 text-blue-600 dark:text-blue-400 text-sm font-semibold rounded-full mb-4;
}

/* Stat cards */
.stat-card {
    @apply card p-6 flex items-start gap-4;
}
.stat-icon {
    @apply w-12 h-12 rounded-xl flex items-center justify-center text-white text-xl shrink-0;
}

/* Progress bar */
.progress-bar {
    @apply w-full bg-gray-100 dark:bg-slate-700 rounded-full overflow-hidden;
}
.progress-fill {
    @apply h-full bg-gradient-to-r from-blue-500 to-violet-500 rounded-full transition-all duration-1000;
}

/* Dashboard sidebar */
.sidebar-link {
    @apply flex items-center gap-3 px-4 py-2.5 rounded-xl text-sm font-medium transition-all;
}
.sidebar-link-active {
    @apply sidebar-link bg-gradient-to-r from-blue-600 to-violet-600 text-white shadow-md;
}
.sidebar-link-inactive {
    @apply sidebar-link text-gray-600 dark:text-gray-300 hover:bg-gray-100 dark:hover:bg-slate-700;
}

/* Table styles */
.data-table { @apply w-full text-sm; }
.data-table th { @apply px-4 py-3 text-left text-xs font-semibold text-gray-500 dark:text-gray-400 uppercase tracking-wider bg-gray-50 dark:bg-slate-700/50; }
.data-table td { @apply px-4 py-3 border-t border-gray-100 dark:border-slate-700 text-gray-700 dark:text-gray-300; }
.data-table tr:hover td { @apply bg-gray-50 dark:bg-slate-700/30; }

/* Hero gradient */
.hero-gradient {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 40%, #7c3aed 70%, #8b5cf6 100%);
}

/* Glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Animated gradient text */
.gradient-text {
    background: linear-gradient(to right, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: transparent;
}

/* Accordion */
.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-out, opacity 0.3s ease;
    opacity: 0;
}
.accordion-content.open {
    max-height: 2000px;
    opacity: 1;
}

/* Custom scrollbar */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { @apply bg-gray-100 dark:bg-slate-800; }
::-webkit-scrollbar-thumb { @apply bg-gray-300 dark:bg-slate-600 rounded-full; }
::-webkit-scrollbar-thumb:hover { @apply bg-blue-400; }

/* Survey question styles */
.question-card { @apply card p-6 mb-4; }
.choice-label { @apply flex items-center gap-3 p-4 rounded-xl border-2 border-gray-100 dark:border-slate-700 cursor-pointer hover:border-blue-300 dark:hover:border-blue-500 hover:bg-blue-50/50 dark:hover:bg-blue-900/20 transition-all; }
.choice-label:has(input:checked) { @apply border-blue-500 bg-blue-50 dark:bg-blue-900/20; }

/* Scale widget */
.scale-btn { @apply w-10 h-10 rounded-xl border-2 border-gray-200 dark:border-slate-700 flex items-center justify-center font-semibold text-sm cursor-pointer hover:border-blue-400 hover:bg-blue-50 dark:hover:bg-blue-900/20 transition-all; }
.scale-btn.selected { @apply border-blue-500 bg-blue-500 text-white; }

/* Animations */
@keyframes pulse-ring {
    0% { transform: scale(0.9); opacity: 1; }
    100% { transform: scale(1.4); opacity: 0; }
}
.pulse-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid currentColor;
    animation: pulse-ring 2s ease-out infinite;
}

/* Page transitions */
.page-enter { animation: fadeIn 0.4s ease-out; }
