/**
 * Theme Dark - Overrides globales para modo oscuro
 *
 * Estrategia: en lugar de anotar cada componente con decenas de prefijos dark:,
 * redefinimos las utilidades Tailwind mas comunes bajo el selector `.dark`.
 * Esto funciona porque `.dark .text-gray-800` tiene mayor especificidad que
 * `.text-gray-800`, y solo aplica cuando el <html> tiene la clase `dark`
 * (que es el comportamiento de Tailwind con `darkMode: 'class'`).
 *
 * Paleta: derivada de la paleta UNAP oficial + neutros adaptados al fondo Mesh.
 *
 * Convencion de niveles:
 *   Superficie 0 (body/mesh) -> colores definidos en mesh.css
 *   Superficie 1 (tarjetas / glass) -> rgba(8, 51, 81, 0.55)  (unap-dark translucido)
 *   Superficie 2 (chips / bg-gray-50) -> rgba(255,255,255,0.04)
 *   Superficie 3 (bg-gray-100) -> rgba(255,255,255,0.08)
 *   Bordes suaves -> rgba(255,255,255,0.08 - 0.15)
 */

/* ============================================================
   SUPERFICIES (bg-white y variantes translucidas)
   ============================================================ */
.dark .bg-white            { background-color: rgba(8, 51, 81, 0.85) !important; }
.dark .bg-white\/80        { background-color: rgba(8, 51, 81, 0.60) !important; }
.dark .bg-white\/75        { background-color: rgba(8, 51, 81, 0.55) !important; }
.dark .bg-white\/60        { background-color: rgba(8, 51, 81, 0.50) !important; }
.dark .bg-white\/50        { background-color: rgba(8, 51, 81, 0.45) !important; }
.dark .bg-white\/25        { background-color: rgba(8, 51, 81, 0.30) !important; }
.dark .bg-white\/10        { background-color: rgba(255, 255, 255, 0.06) !important; }
.dark .bg-white\/95        { background-color: rgba(8, 51, 81, 0.95) !important; }

/* ============================================================
   GRISES DE FONDO
   ============================================================ */
.dark .bg-gray-50          { background-color: rgba(255, 255, 255, 0.04) !important; }
.dark .bg-gray-100         { background-color: rgba(255, 255, 255, 0.08) !important; }
.dark .bg-gray-200         { background-color: rgba(255, 255, 255, 0.12) !important; }

/* Hover de filas translucidas tipicas */
.dark .hover\:bg-gray-50\/50:hover { background-color: rgba(255, 255, 255, 0.04) !important; }
.dark .hover\:bg-gray-50:hover     { background-color: rgba(255, 255, 255, 0.06) !important; }
.dark .hover\:bg-gray-100:hover    { background-color: rgba(255, 255, 255, 0.10) !important; }
.dark .active\:bg-gray-100:active  { background-color: rgba(255, 255, 255, 0.08) !important; }

/* ============================================================
   TEXTOS
   ============================================================ */
.dark .text-gray-900       { color: #f9fafb !important; }
.dark .text-gray-800       { color: #f3f4f6 !important; }
.dark .text-gray-700       { color: #e5e7eb !important; }
.dark .text-gray-600       { color: #d1d5db !important; }
.dark .text-gray-500       { color: #cbd5e1 !important; }
.dark .text-gray-400       { color: #94a3b8 !important; }
.dark .text-gray-300       { color: #64748b !important; }

/* Hover en textos */
.dark .hover\:text-gray-700:hover { color: #f3f4f6 !important; }
.dark .hover\:text-gray-800:hover { color: #ffffff !important; }

/* ============================================================
   BORDES
   ============================================================ */
.dark .border-gray-100     { border-color: rgba(255, 255, 255, 0.08) !important; }
.dark .border-gray-200     { border-color: rgba(255, 255, 255, 0.12) !important; }
.dark .border-gray-300     { border-color: rgba(255, 255, 255, 0.18) !important; }
.dark .border-gray-200\/50  { border-color: rgba(255, 255, 255, 0.12) !important; }
.dark .border-white\/30    { border-color: rgba(255, 255, 255, 0.15) !important; }
.dark .border-white        { border-color: rgba(255, 255, 255, 0.30) !important; }

.dark .divide-gray-100 > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(255, 255, 255, 0.08) !important;
}
.dark .divide-gray-200 > :not([hidden]) ~ :not([hidden]) {
    border-color: rgba(255, 255, 255, 0.12) !important;
}

/* ============================================================
   BORDES COLOREADOS (usados en ProfileModal para carreras)
   ============================================================ */
.dark .border-green-500     { border-color: #22c55e !important; }
.dark .border-blue-500      { border-color: #3b82f6 !important; }
.dark .border-yellow-500    { border-color: #eab308 !important; }
.dark .border-gray-300     { border-color: rgba(255, 255, 255, 0.18) !important; }

/* ============================================================
   FONDOS CON OPACIDAD UNAP (usados en ProfileModal)
   ============================================================ */
.dark .bg-unap-primary\/10 { background-color: rgba(4, 108, 174, 0.20) !important; }

/* ============================================================
   BADGES / CHIPS DE COLOR (100 -> translucido) usados para estados
   Mantiene el tono pero adaptado a fondo oscuro
   ============================================================ */
.dark .bg-emerald-100      { background-color: rgba(16, 185, 129, 0.18) !important; }
.dark .text-emerald-700    { color: #6ee7b7 !important; }
.dark .text-emerald-600    { color: #34d399 !important; }

.dark .bg-red-100          { background-color: rgba(239, 68, 68, 0.18) !important; }
.dark .text-red-700        { color: #fca5a5 !important; }
.dark .text-red-500        { color: #f87171 !important; }

.dark .bg-blue-100         { background-color: rgba(59, 130, 246, 0.18) !important; }
.dark .text-blue-700       { color: #93c5fd !important; }
.dark .text-blue-600       { color: #60a5fa !important; }

.dark .bg-amber-100        { background-color: rgba(245, 158, 11, 0.18) !important; }
.dark .text-amber-700      { color: #fcd34d !important; }
.dark .text-amber-600      { color: #fbbf24 !important; }

.dark .bg-violet-100       { background-color: rgba(139, 92, 246, 0.18) !important; }
.dark .text-violet-700     { color: #c4b5fd !important; }
.dark .text-violet-600     { color: #a78bfa !important; }

/* ============================================================
   INPUTS / SELECTS
   ============================================================ */
.dark input,
.dark select,
.dark textarea {
    color: #f3f4f6;
    background-color: rgba(8, 51, 81, 0.50);
    border-color: rgba(255, 255, 255, 0.12);
}
.dark input::placeholder,
.dark textarea::placeholder {
    color: #9ca3af;
}
.dark select option {
    background-color: #1f3a52;
    color: #f3f4f6;
}
.dark select option:checked {
    background-color: #1f3a52;
    color: #f3f4f6;
    box-shadow: 0 0 10px 100px #1f3a52 inset;
}
.dark select option:hover,
.dark select option:focus,
.dark select option:active {
    background-color: #041c2d !important;
    color: #ffffff !important;
    box-shadow: 0 0 10px 100px #041c2d inset;
}

/* ============================================================
   SCROLLBAR
   ============================================================ */
.dark ::-webkit-scrollbar-track {
    background: #041c2d;
}
.dark ::-webkit-scrollbar-thumb {
    background: #2f3a4a;
}
.dark ::-webkit-scrollbar-thumb:hover {
    background: #445267;
}

/* ============================================================
   UTILIDADES PROPIAS DEL PROYECTO
   ============================================================ */
.dark .glass {
    background: rgba(8, 51, 81, 0.45);
    border-color: rgba(255, 255, 255, 0.08);
}
.dark .glass-light {
    background: rgba(8, 51, 81, 0.75);
}
.dark .glass-dark {
    background: rgba(2, 27, 44, 0.85);
}
