@tailwind base;
@tailwind components;
@tailwind utilities;

@layer base {
    body {
        @apply font-sans bg-edlogica-surface-muted text-edlogica-text-primary antialiased;
    }
    
    /* Accessibility: WCAG 2.2 AA Focus Visible */
    *:focus-visible {
        @apply outline-none ring-2 ring-edlogica-surface-raised ring-offset-2 ring-offset-edlogica-surface-muted;
    }
}

/* Custom Scrollbar for clean UI */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: #f2f4fb;
}
::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

.no-scrollbar::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
}
.no-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Site-wide fade in / fade out effects only */
.fade-in-section {
    opacity: 0;
    transition: opacity 0.8s ease;
    will-change: opacity;
}
.fade-in-section.is-visible {
    opacity: 1;
}

.fade-in {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.fade-in.is-visible,
.fade-in.active {
    opacity: 1;
}

.fade-overlay {
    transition: opacity 0.4s ease;
}

/* Staggered fade for children */
.fade-stagger > * {
    opacity: 0;
    transition: opacity 0.6s ease;
}
.fade-stagger.is-visible > *:nth-child(1) { opacity: 1; transition-delay: 0ms; }
.fade-stagger.is-visible > *:nth-child(2) { opacity: 1; transition-delay: 120ms; }
.fade-stagger.is-visible > *:nth-child(3) { opacity: 1; transition-delay: 240ms; }
.fade-stagger.is-visible > *:nth-child(4) { opacity: 1; transition-delay: 360ms; }

.country-process {
    display: none;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.country-process.active {
    display: block;
    opacity: 1;
}
.country-process .process-item {
    opacity: 0;
    transition: opacity 0.4s ease;
}
.country-process.active .process-item {
    opacity: 1;
}

/* Universities page */
.uni-card {
    transition: opacity 0.4s ease, box-shadow 0.4s ease;
}
.uni-card:hover {
    box-shadow: 0 20px 50px rgba(7, 23, 68, 0.1);
}
.uni-card.is-hidden {
    display: none;
}
.uni-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    border: 2px solid transparent;
    white-space: nowrap;
    transition: opacity 0.3s ease, border-color 0.3s ease, background-color 0.3s ease, color 0.3s ease;
}
.uni-filter-btn[data-filter="all"] {
    background: #071744;
    color: #fff;
}
.uni-filter-btn[data-filter="P1"] {
    background: #ecfdf5;
    color: #065f46;
    border-color: #a7f3d0;
}
.uni-filter-btn[data-filter="P2"] {
    background: #eff6ff;
    color: #1e40af;
    border-color: #bfdbfe;
}
.uni-filter-btn[data-filter="P3"] {
    background: #fffbeb;
    color: #92400e;
    border-color: #fde68a;
}
.uni-filter-btn[data-filter="P4"] {
    background: #fef2f2;
    color: #991b1b;
    border-color: #fecaca;
}
.uni-filter-btn.active[data-filter="all"] {
    background: #071744;
    color: #fff;
    border-color: #071744;
    box-shadow: 0 4px 14px rgba(7, 23, 68, 0.25);
}
.uni-filter-btn.active[data-filter="P1"] {
    background: #059669;
    color: #fff;
    border-color: #059669;
}
.uni-filter-btn.active[data-filter="P2"] {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.uni-filter-btn.active[data-filter="P3"] {
    background: #d97706;
    color: #fff;
    border-color: #d97706;
}
.uni-filter-btn.active[data-filter="P4"] {
    background: #dc2626;
    color: #fff;
    border-color: #dc2626;
}
.uni-filter-dot {
    width: 8px;
    height: 8px;
    border-radius: 9999px;
    flex-shrink: 0;
}

/* University modal */
#uni-modal-panel {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
.uni-modal-stat-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
@media (min-width: 640px) {
    .uni-modal-stat-grid { grid-template-columns: repeat(4, 1fr); }
}
.uni-modal-stat-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 12px;
    text-align: center;
}
.uni-modal-stat-card .label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #94a3b8;
    margin-bottom: 6px;
}
.uni-modal-stat-card .value {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}
.uni-modal-section {
    border-radius: 18px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    background: #fff;
}
.uni-modal-section-head {
    padding: 12px 16px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.uni-modal-section-body {
    padding: 4px 16px 12px;
}
.uni-modal-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid #f1f5f9;
    font-size: 14px;
    line-height: 1.4;
}
.uni-modal-row:last-child { border-bottom: none; }
.uni-modal-row .label { color: #64748b; flex-shrink: 0; }
.uni-modal-row .value { color: #0f172a; font-weight: 600; text-align: right; }