/* DigitalForge - Estilos CSS */

/* ===== RESET Y BASE ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/* ===== VARIABLES CSS PERSONALIZADAS ===== */
:root {
    /* Colores principales */
    --primary-50: #f0f9ff;
    --primary-100: #e0f2fe;
    --primary-500: #0ea5e9;
    --primary-600: #0284c7;
    --primary-700: #0369a1;
    --primary-900: #0c4a6e;
    
    /* Colores secundarios */
    --secondary-500: #d946ef;
    --secondary-600: #c026d3;
    
    /* Escala de grises */
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;
    --gray-950: #020617;
    
    /* Colores de estado */
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #3b82f6;
    
    /* Espaciado */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    
    /* Bordes */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --shadow-2xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
    --shadow-glass: 0 8px 32px 0 rgba(31, 38, 135, 0.37);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.5);
    --shadow-glow-lg: 0 0 40px rgba(59, 130, 246, 0.3);
    
    /* Transiciones */
    --transition-fast: 0.15s ease-out;
    --transition-normal: 0.3s ease-out;
    --transition-slow: 0.5s ease-out;
    
    /* Z-index */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --z-toast: 1080;
}

/* ===== ANIMACIONES KEYFRAMES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-8px);
    }
}

@keyframes glow {
    from {
        box-shadow: var(--shadow-glow);
    }
    to {
        box-shadow: var(--shadow-glow-lg), 0 0 60px rgba(59, 130, 246, 0.2);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(59, 130, 246, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 30px rgba(59, 130, 246, 0.6);
    }
}

@keyframes bounce-subtle {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
}

/* ===== CLASES DE UTILIDAD PARA ANIMACIONES ===== */
.animate-fade-in {
    animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
    animation: slideUp 0.4s ease-out;
}

.animate-scale-in {
    animation: scaleIn 0.3s ease-out;
}

.animate-float {
    animation: float 6s ease-in-out infinite;
}

.animate-glow {
    animation: glow 2s ease-in-out infinite alternate;
}

.animate-pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

.animate-bounce-subtle {
    animation: bounce-subtle 1s ease-in-out infinite;
}

/* ===== GLASS MORPHISM ===== */
.glass {
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: var(--shadow-glass);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-glass);
}

.glass-subtle {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== GRADIENTES ===== */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-500) 0%, var(--primary-600) 50%, var(--secondary-500) 100%);
}

.bg-gradient-dark {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 25%, #334155 75%, #475569 100%);
}

.bg-gradient-mesh {
    background-color: #0f172a;
    background-image: 
        radial-gradient(at 40% 20%, hsla(228,100%,74%,0.15) 0px, transparent 50%),
        radial-gradient(at 80% 0%, hsla(189,100%,56%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 50%, hsla(355,100%,93%,0.1) 0px, transparent 50%),
        radial-gradient(at 80% 50%, hsla(340,100%,76%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 100%, hsla(22,100%,77%,0.1) 0px, transparent 50%),
        radial-gradient(at 80% 100%, hsla(242,100%,70%,0.15) 0px, transparent 50%),
        radial-gradient(at 0% 0%, hsla(343,100%,76%,0.1) 0px, transparent 50%);
}

.text-gradient {
    background: linear-gradient(135deg, #3b82f6, #2563eb, #d946ef);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #3b82f6; /* Fallback */
}

.text-gradient-secondary {
    background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    color: #f59e0b; /* Fallback */
}

/* ===== COMPONENTES DE BOTONES ===== */
.btn-base,
.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    border-radius: var(--radius-xl);
    font-size: 0.875rem;
    line-height: 1.25rem;
    position: relative;
    overflow: hidden;
}

.btn-base:focus,
.btn-primary:focus,
.btn-secondary:focus,
.btn-ghost:focus,
.btn-icon:focus {
    outline: 2px solid transparent;
    outline-offset: 2px;
}

.btn-base:disabled,
.btn-primary:disabled,
.btn-secondary:disabled,
.btn-ghost:disabled,
.btn-icon:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-500), var(--primary-600));
    color: white;
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-600), var(--primary-700));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 0.75rem 1.5rem;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: transparent;
    color: rgba(255, 255, 255, 0.8);
    padding: 0.5rem 1rem;
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.btn-icon {
    padding: 0.75rem;
    width: 3rem;
    height: 3rem;
}

/* Efectos de carga en botones */
.btn-loading {
    position: relative;
    color: transparent;
}

.btn-loading::after {
    content: '';
    position: absolute;
    width: 1rem;
    height: 1rem;
    top: 50%;
    left: 50%;
    margin-left: -0.5rem;
    margin-top: -0.5rem;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===== COMPONENTES DE ENTRADA ===== */
.input-base,
.input-field {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    color: white;
    font-size: 0.875rem;
    transition: all var(--transition-normal);
    font-family: inherit;
}

.input-base::placeholder,
.input-field::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.input-base:focus,
.input-field:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: rgba(255, 255, 255, 0.12);
}

.input-base:hover:not(:focus),
.input-field:hover:not(:focus) {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
}

.input-base:disabled,
.input-field:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.05);
}

.input-base:invalid,
.input-field:invalid {
    border-color: var(--error);
}

.input-base:valid,
.input-field:valid {
    border-color: var(--success);
}

/* Estados de validación */
.input-error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.input-success {
    border-color: var(--success);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* ===== COMPONENTES DE TARJETAS ===== */
.card-base,
.card,
.card-interactive {
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.card,
.card-interactive {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.card:hover,
.card-interactive:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(59, 130, 246, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px 0 rgba(0, 0, 0, 0.5), 0 0 20px rgba(59, 130, 246, 0.3);
}

.card-interactive {
    cursor: pointer;
}

.card-interactive:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: var(--shadow-2xl), var(--shadow-glow-lg);
}

.card-interactive:active {
    transform: translateY(-2px) scale(1.01);
}

/* Efecto de brillo en hover */
.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s ease;
    z-index: 1;
}

.card:hover::before {
    left: 100%;
}

.card > * {
    position: relative;
    z-index: 2;
}

/* ===== SISTEMA DE PESTAÑAS ===== */
.tab-container {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-2xl);
    padding: 0.5rem;
}

.tab-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border-radius: var(--radius-xl);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 500;
    transition: all var(--transition-normal);
    cursor: pointer;
    border: none;
    background: transparent;
    position: relative;
    overflow: hidden;
}

.tab-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: linear-gradient(135deg, var(--primary-500), var(--secondary-500));
    color: white;
    box-shadow: var(--shadow-glow);
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 2rem;
    height: 2px;
    background: white;
    border-radius: 1px;
}

/* ===== EDITOR DE CÓDIGO ===== */
.code-editor {
    font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    background: var(--gray-950);
    color: #e6edf3;
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    max-height: 24rem;
    overflow: auto;
    position: relative;
}

.code-editor pre {
    margin: 0;
    padding: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Resaltado de sintaxis */
.syntax-keyword { color: #ff7b72; }
.syntax-string { color: #a5d6ff; }
.syntax-comment { color: #8b949e; font-style: italic; }
.syntax-number { color: #79c0ff; }
.syntax-operator { color: #ff7b72; }
.syntax-function { color: #d2a8ff; }
.syntax-variable { color: #ffa657; }

/* ===== SCROLLBARS PERSONALIZADAS ===== */
.scrollbar-thin::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    transition: background var(--transition-normal);
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Aplicar scrollbar personalizada por defecto */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) rgba(255, 255, 255, 0.05);
}

/* ===== SISTEMA DE NOTIFICACIONES (TOAST) ===== */
.toast {
    background: rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    box-shadow: var(--shadow-glass);
    border-radius: var(--radius-xl);
    padding: 1rem 1.5rem;
    max-width: 24rem;
    box-shadow: var(--shadow-2xl);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

/* ===== ESTADOS DE CARGA ===== */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    animation: shimmer 2s infinite;
}

.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
    border-radius: var(--radius-md);
}

/* ===== TOOLTIPS ===== */
.tooltip {
    position: relative;
}

.tooltip::before {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: var(--radius-md);
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: var(--z-tooltip);
}

.tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
    z-index: var(--z-tooltip);
}

.tooltip:hover::before,
.tooltip:hover::after {
    opacity: 1;
}

/* ===== INDICADORES DE ESTADO ===== */
.status-indicator {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    display: inline-block;
}

.status-online {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    display: inline-block;
    background: var(--success);
    animation: pulse 2s infinite;
}

.status-offline {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    display: inline-block;
    background: var(--error);
}

.status-processing {
    width: 0.75rem;
    height: 0.75rem;
    border-radius: 50%;
    display: inline-block;
    background: var(--warning);
    animation: bounce-subtle 1s infinite;
}

/* ===== BARRAS DE PROGRESO ===== */
.progress-bar {
    width: 100%;
    height: 0.5rem;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-500), var(--secondary-500));
    border-radius: var(--radius-sm);
    transition: width var(--transition-slow);
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: shimmer 2s infinite;
}

/* ===== BADGES Y ETIQUETAS ===== */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-primary {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--primary-500);
    color: white;
}

.badge-secondary {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.badge-success {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--success);
    color: white;
}

.badge-warning {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--warning);
    color: var(--gray-900);
}

.badge-error {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-lg);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    background: var(--error);
    color: white;
}

/* ===== DISEÑO RESPONSIVE ===== */
@media (max-width: 768px) {
    :root {
        --spacing-md: 0.75rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
    }
    
    .card:hover,
    .card-interactive:hover {
        transform: none;
    }
    
    .btn-primary:hover,
    .btn-secondary:hover {
        transform: none;
    }
    
    .tab-btn:hover {
        transform: none;
    }
    
    .card-base {
        padding: 1rem;
    }
    
    .code-editor {
        padding: 1rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 640px) {
    .tab-btn {
        padding: 0.75rem 0.5rem;
        font-size: 0.875rem;
    }
    
    .btn-primary,
    .btn-secondary {
        padding: 0.625rem 1.25rem;
        font-size: 0.8rem;
    }
    
    .toast {
        max-width: calc(100vw - 2rem);
        margin: 0 1rem;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

.focus-visible:focus-visible {
    outline: 2px solid var(--primary-500);
    outline-offset: 2px;
}

/* ===== MODO DE ALTO CONTRASTE ===== */
@media (prefers-contrast: high) {
    .glass,
    .glass-strong,
    .glass-subtle {
        background: rgba(0, 0, 0, 0.8);
        border-color: white;
    }
    
    .card {
        border: 2px solid white;
    }
    
    .btn-primary {
        background: var(--primary-700);
        border: 2px solid white;
    }
    
    .btn-secondary {
        background: transparent;
        border: 2px solid white;
    }
}

/* ===== MODO IMPRESIÓN ===== */
@media print {
    .no-print {
        display: none !important;
    }
    
    .card {
        background: white;
        color: black;
        border: 1px solid #ccc;
        box-shadow: none;
        break-inside: avoid;
    }
    
    .bg-gradient-dark,
    .bg-gradient-mesh {
        background: white;
    }
    
    .text-gradient {
        color: black;
        background: none;
        -webkit-text-fill-color: initial;
    }
    
    .btn-primary,
    .btn-secondary {
        background: white;
        color: black;
        border: 1px solid black;
    }
}

/* ===== UTILIDADES ADICIONALES ===== */
.text-shadow {
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.backdrop-blur-strong {
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
}

.border-gradient {
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.3), rgba(139, 92, 246, 0.3)) border-box;
    background-clip: padding-box, border-box;
}

.interactive-scale:hover {
    transform: scale(1.05);
}

.interactive-rotate:hover {
    transform: rotate(3deg);
}

.interactive-glow:hover {
    box-shadow: var(--shadow-glow);
}

/* ===== COMPONENTES ESPECÍFICOS ===== */
.hero-section {
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 30% 20%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 70% 80%, rgba(139, 92, 246, 0.1) 0%, transparent 50%);
    pointer-events: none;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

@media (max-width: 640px) {
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ===== ESTADOS DE HOVER AVANZADOS ===== */
.hover-lift {
    transition: all var(--transition-normal);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.hover-glow {
    transition: all var(--transition-normal);
}

.hover-glow:hover {
    box-shadow: var(--shadow-glow);
}

.hover-scale {
    transition: all var(--transition-normal);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* ===== EFECTOS DE PARTÍCULAS (OPCIONAL) ===== */
.particles-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(odd) {
    animation-delay: -2s;
}

.particle:nth-child(even) {
    animation-delay: -4s;
}

/* ===== OPTIMIZACIONES DE RENDIMIENTO ===== */
.gpu-accelerated {
    transform: translateZ(0);
    will-change: transform;
    backface-visibility: hidden;
    perspective: 1000px;
}

.contain-layout {
    contain: layout;
}

.contain-paint {
    contain: paint;
}

.contain-strict {
    contain: strict;
}

/* Lazy loading optimization */
.lazy-load {
    content-visibility: auto;
    contain-intrinsic-size: 0 500px;
}

/* Reduce repaints */
.no-repaint {
    will-change: transform, opacity;
    transform: translateZ(0);
}

/* ===== DEBUG (SOLO DESARROLLO) ===== */
.debug * {
    outline: 1px solid red;
}

.debug-grid {
    background-image: 
        linear-gradient(rgba(255, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Ocultar elementos de debug en producción */
.debug,
.debug-grid {
    display: none;
}

/* =
==== MEJORAS DE CONTRASTE ===== */
body {
    color: #f8fafc;
}

h1, h2, h3, h4, h5, h6 {
    color: #ffffff;
}

.text-white {
    color: #ffffff !important;
}

.text-white\/80 {
    color: rgba(255, 255, 255, 0.8) !important;
}

.text-white\/70 {
    color: rgba(255, 255, 255, 0.7) !important;
}

.text-white\/60 {
    color: rgba(255, 255, 255, 0.6) !important;
}

.text-white\/50 {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* Asegurar que los gradientes de texto sean visibles */
.text-gradient {
    background: linear-gradient(135deg, #60a5fa, #3b82f6, #d946ef) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

.text-gradient-secondary {
    background: linear-gradient(135deg, #fbbf24, #f59e0b, #ec4899) !important;
    -webkit-background-clip: text !important;
    -webkit-text-fill-color: transparent !important;
    background-clip: text !important;
}

/* Mejorar visibilidad de las tarjetas */
.card-interactive {
    background: rgba(30, 41, 59, 0.6) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
}

.card-interactive:hover {
    background: rgba(51, 65, 85, 0.8) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
}

/* Mejorar el glass effect */
.glass-strong {
    background: rgba(30, 41, 59, 0.8) !important;
    backdrop-filter: blur(40px) !important;
    -webkit-backdrop-filter: blur(40px) !important;
    border: 1px solid rgba(148, 163, 184, 0.2) !important;
}


/* ===== ESTÉTICA MINIMALISTA NEGRA (PIXELCORDER STYLE) ===== */
body {
    background: #000000 !important;
    color: #ffffff;
}

/* Fondo negro puro */
.bg-black {
    background-color: #000000 !important;
}

/* Navegación minimalista */
nav {
    background: rgba(0, 0, 0, 0.8) !important;
    backdrop-filter: blur(20px);
}

/* Gradiente morado/rosa para texto */
.bg-gradient-to-r {
    background-image: linear-gradient(to right, var(--tw-gradient-stops));
}

.from-purple-400 {
    --tw-gradient-from: #c084fc;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(192, 132, 252, 0));
}

.via-pink-400 {
    --tw-gradient-via: #f472b6;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to, rgba(244, 114, 182, 0));
}

.to-purple-600 {
    --tw-gradient-to: #9333ea;
}

.to-pink-500 {
    --tw-gradient-to: #ec4899;
}

/* Botón principal con gradiente */
.from-purple-500 {
    --tw-gradient-from: #a855f7;
    --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to, rgba(168, 85, 247, 0));
}

/* Tarjetas con fondo oscuro sutil */
.card {
    background: rgba(255, 255, 255, 0.03) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    backdrop-filter: blur(10px);
}

.card:hover {
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.15);
}

/* Glass effect sutil */
.glass {
    background: rgba(255, 255, 255, 0.03) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.glass-strong {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Inputs con fondo oscuro */
.input-field {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff;
}

.input-field:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: rgba(168, 85, 247, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* Botones con gradiente morado/rosa */
.btn-primary {
    background: linear-gradient(135deg, #a855f7, #ec4899) !important;
    border: none !important;
    color: #ffffff;
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 15px 40px rgba(168, 85, 247, 0.5);
    transform: translateY(-2px);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: rgba(168, 85, 247, 0.3) !important;
}

/* Tabs con estilo minimalista */
.tab-btn {
    background: transparent !important;
    color: rgba(255, 255, 255, 0.5);
    border: none;
}

.tab-btn:hover {
    color: rgba(255, 255, 255, 0.8);
    background: rgba(255, 255, 255, 0.03) !important;
}

.tab-btn.active {
    background: linear-gradient(135deg, #a855f7, #ec4899) !important;
    color: #ffffff;
    box-shadow: 0 5px 20px rgba(168, 85, 247, 0.3);
}

/* Efectos de glow morado */
.hover\:shadow-purple-500\/50:hover {
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.5);
}

/* Animación de pulso para badges */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Código con fondo oscuro */
.code-editor {
    background: rgba(0, 0, 0, 0.5) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Toast con fondo oscuro */
.toast {
    background: rgba(0, 0, 0, 0.9) !important;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
}

/* Scrollbar oscura */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
}

::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}


/* ===== FIX PARA SELECT Y INPUTS ===== */
select.input-field {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.input-field option {
    background: #000000;
    color: #ffffff;
    padding: 0.75rem;
}

/* Fix para inputs number */
input[type="number"].input-field {
    -moz-appearance: textfield;
}

input[type="number"].input-field::-webkit-inner-spin-button,
input[type="number"].input-field::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Canvas styling */
canvas {
    cursor: crosshair;
}

canvas:active {
    cursor: grabbing;
}


/* ===== CANVAS FIXES ===== */
#logicCanvas {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    background: #0a0a0a !important;
    cursor: crosshair !important;
}

#circuit-canvas {
    background: #0a0a0a !important;
    min-height: 400px !important;
}

canvas {
    image-rendering: crisp-edges;
    image-rendering: pixelated;
}


/* ===== AI CHAT ASSISTANT STYLES ===== */

/* Chat messages container */
#aiChatMessages {
    background: linear-gradient(180deg, rgba(0,0,0,0.3) 0%, rgba(0,0,0,0.5) 100%);
}

/* Loading dots animation */
.loading-dots::after {
    content: '';
    animation: loadingDots 1.5s infinite;
}

@keyframes loadingDots {
    0%, 20% {
        content: '';
    }
    40% {
        content: '.';
    }
    60% {
        content: '..';
    }
    80%, 100% {
        content: '...';
    }
}

/* Message content */
.message-content {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.message-content p {
    margin-bottom: 0.5rem;
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Code blocks */
.code-block {
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
}

.code-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-language {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.copy-btn {
    background: rgba(168, 85, 247, 0.2);
    border: 1px solid rgba(168, 85, 247, 0.3);
    color: #a855f7;
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background: rgba(168, 85, 247, 0.3);
    border-color: rgba(168, 85, 247, 0.5);
}

.code-content {
    padding: 1rem;
    margin: 0;
    overflow-x: auto;
    font-size: 0.875rem;
    line-height: 1.5;
    color: #e6edf3;
}

.code-content code {
    font-family: inherit;
    background: none;
    padding: 0;
    border-radius: 0;
}

/* Inline code */
.inline-code {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    padding: 0.125rem 0.375rem;
    border-radius: 0.25rem;
    font-family: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;
    font-size: 0.875em;
    border: 1px solid rgba(168, 85, 247, 0.2);
}

/* Syntax highlighting for code */
.language-vhdl .keyword,
.language-verilog .keyword {
    color: #ff7b72;
}

.language-vhdl .string,
.language-verilog .string {
    color: #a5d6ff;
}

.language-vhdl .comment,
.language-verilog .comment {
    color: #8b949e;
    font-style: italic;
}

.language-vhdl .number,
.language-verilog .number {
    color: #79c0ff;
}

.language-vhdl .operator,
.language-verilog .operator {
    color: #ff7b72;
}

.language-vhdl .function,
.language-verilog .function {
    color: #d2a8ff;
}

/* Chat input textarea */
#aiChatInput {
    min-height: 60px;
    max-height: 150px;
    resize: vertical;
}

#aiChatInput:focus {
    background: rgba(255, 255, 255, 0.08);
}

/* Documentation buttons */
.doc-btn {
    transition: all 0.2s;
}

.doc-btn:hover {
    transform: translateX(4px);
}

/* Message animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.3s ease-out;
}

/* Scrollbar for chat */
#aiChatMessages::-webkit-scrollbar {
    width: 8px;
}

#aiChatMessages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

#aiChatMessages::-webkit-scrollbar-thumb {
    background: rgba(168, 85, 247, 0.3);
    border-radius: 4px;
}

#aiChatMessages::-webkit-scrollbar-thumb:hover {
    background: rgba(168, 85, 247, 0.5);
}

/* Code block scrollbar */
.code-content::-webkit-scrollbar {
    height: 8px;
}

.code-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.code-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 4px;
}

.code-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Lists in messages */
.message-content li {
    margin-bottom: 0.25rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Headers in messages */
.message-content h2,
.message-content h3,
.message-content h4 {
    font-weight: 700;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.message-content h2 {
    font-size: 1.25rem;
    color: #a855f7;
}

.message-content h3 {
    font-size: 1.125rem;
    color: #c084fc;
}

.message-content h4 {
    font-size: 1rem;
    color: #d8b4fe;
}

/* Tables in messages */
.message-content table,
.markdown-table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    font-size: 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.5rem;
    overflow: hidden;
}

.message-content th,
.message-content td,
.markdown-table th,
.markdown-table td {
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem;
    text-align: left;
}

.message-content th,
.markdown-table th {
    background: rgba(168, 85, 247, 0.2);
    font-weight: 600;
    color: #c084fc;
}

.message-content tr:nth-child(even),
.markdown-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.02);
}

.markdown-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

/* Blockquotes in messages */
.message-content blockquote {
    border-left: 3px solid #a855f7;
    padding-left: 1rem;
    margin: 1rem 0;
    color: rgba(255, 255, 255, 0.7);
    font-style: italic;
}

/* Links in messages */
.message-content a {
    color: #60a5fa;
    text-decoration: underline;
    transition: color 0.2s;
}

.message-content a:hover {
    color: #93c5fd;
}

/* Status indicators */
.status-online {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    #ai-chat-content .lg\\:col-span-1,
    #ai-chat-content .lg\\:col-span-2 {
        grid-column: span 1;
    }
    
    .code-content {
        font-size: 0.75rem;
    }
}

@media (max-width: 640px) {
    .message-content {
        font-size: 0.875rem;
    }
    
    .code-header {
        padding: 0.375rem 0.75rem;
    }
    
    .code-content {
        padding: 0.75rem;
        font-size: 0.7rem;
    }
    
    .copy-btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.7rem;
    }
}

/* Fix select visibility */
select.input-field {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1em;
    padding-right: 2.5rem;
    cursor: pointer;
}

select.input-field:focus {
    outline: none;
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

select.input-field option {
    background: #1e293b;
    color: white;
    padding: 0.5rem;
}

/* Improve select dropdown visibility */
select.input-field {
    color: white !important;
    background-color: rgba(255, 255, 255, 0.08) !important;
}

select.input-field option {
    background-color: #1e293b !important;
    color: white !important;
}

select.input-field option:checked {
    background-color: rgba(168, 85, 247, 0.3) !important;
}


/* ===== TAB SLIDER STYLES ===== */

#tabsContainer {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#tabsContainer::-webkit-scrollbar {
    display: none;
}

#scrollLeftBtn,
#scrollRightBtn {
    transition: opacity 0.3s, transform 0.2s;
}

#scrollLeftBtn:hover,
#scrollRightBtn:hover {
    transform: scale(1.1);
}

/* Tab button improvements */
.tab-btn {
    min-width: 120px;
    transition: all 0.3s ease;
}

.tab-btn:hover {
    transform: translateY(-2px);
}

/* ===== FORMULA CARDS ===== */

.formula-card {
    transition: all 0.3s ease;
}

.formula-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 40px rgba(168, 85, 247, 0.2);
}

.formula-filter.active {
    background: rgba(168, 85, 247, 0.2) !important;
    color: #a855f7 !important;
    border-left: 3px solid #a855f7;
}

/* MathJax formula styling */
.MathJax {
    color: #e6edf3 !important;
}

mjx-container {
    color: #e6edf3 !important;
}

/* Formula search input */
#formulaSearch {
    transition: all 0.3s;
}

#formulaSearch:focus {
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.2);
}

/* ===== HARDWARE SECTION STYLES ===== */

/* Hardware card icons */
.fab.fa-arduino {
    color: #00979D;
}

.fab.fa-raspberry-pi {
    color: #C51A4A;
}

/* Result boxes */
.card .glass {
    backdrop-filter: blur(10px);
}

/* Input focus states */
.input-field:focus {
    border-color: rgba(168, 85, 247, 0.5);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

/* Button hover effects */
.btn-primary:hover {
    box-shadow: 0 10px 30px rgba(168, 85, 247, 0.4);
}

/* ===== RESPONSIVE IMPROVEMENTS ===== */

@media (max-width: 1024px) {
    .tab-btn {
        min-width: 100px;
        padding: 0.75rem 0.5rem;
    }
    
    .tab-btn i {
        font-size: 1.25rem;
    }
    
    .tab-btn span {
        font-size: 0.7rem;
    }
}

@media (max-width: 768px) {
    #scrollLeftBtn,
    #scrollRightBtn {
        width: 8px;
        height: 8px;
        font-size: 0.75rem;
    }
    
    .formula-card {
        padding: 1rem !important;
    }
    
    .formula-card h3 {
        font-size: 1rem;
    }
}

/* ===== ANIMATION IMPROVEMENTS ===== */

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.formula-card,
.card {
    animation: slideInRight 0.3s ease-out;
}

/* Stagger animation for grid items */
.formula-card:nth-child(1) { animation-delay: 0.05s; }
.formula-card:nth-child(2) { animation-delay: 0.1s; }
.formula-card:nth-child(3) { animation-delay: 0.15s; }
.formula-card:nth-child(4) { animation-delay: 0.2s; }
.formula-card:nth-child(5) { animation-delay: 0.25s; }
.formula-card:nth-child(6) { animation-delay: 0.3s; }

/* ===== TOOLTIP IMPROVEMENTS ===== */

[data-tooltip] {
    position: relative;
}

[data-tooltip]:hover::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: 0.75rem;
    border-radius: 0.375rem;
    white-space: nowrap;
    z-index: 1000;
    margin-bottom: 0.5rem;
}

/* ===== LOADING STATES ===== */

.loading-skeleton {
    background: linear-gradient(90deg, rgba(255,255,255,0.05) 25%, rgba(255,255,255,0.1) 50%, rgba(255,255,255,0.05) 75%);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* ===== ACCESSIBILITY IMPROVEMENTS ===== */

.btn-primary:focus-visible,
.btn-secondary:focus-visible,
.input-field:focus-visible {
    outline: 2px solid #a855f7;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid white;
    }
    
    .formula-card {
        border: 2px solid #a855f7;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .formula-card,
    .tab-btn,
    #scrollLeftBtn,
    #scrollRightBtn {
        animation: none;
        transition: none;
    }
}
