/* ============================================
   SAMSUNG LIVE CONTROL - STYLE.CSS v2.0
   ============================================ */

:root {
    /* Colores tema claro */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --text-tertiary: #94a3b8;
    --border-primary: #e2e8f0;
    --border-secondary: #cbd5e1;
    --accent-blue: #2563eb;
    --accent-blue-hover: #1d4ed8;
    --accent-green: #16a34a;
    --accent-red: #dc2626;
    
    /* Espacios */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    
    /* Border radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    
    /* Transiciones */
    --transition-fast: 150ms ease-out;
    --transition-normal: 250ms ease-out;
    --transition-slow: 350ms ease-out;
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Dark mode */
:root.dark {
    --bg-primary: #1e293b;
    --bg-secondary: #0f172a;
    --bg-tertiary: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-tertiary: #94a3b8;
    --border-primary: #334155;
    --border-secondary: #475569;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
        sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================
   SCROLLBARS
   ============================================ */

.custom-scroll::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scroll::-webkit-scrollbar-thumb {
    background: var(--border-primary);
    border-radius: 3px;
    transition: background var(--transition-fast);
}

.custom-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--border-secondary);
}

/* ============================================
   ANIMACIONES
   ============================================ */

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.95);
        opacity: 0;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* ============================================
   COMPONENTES PRINCIPALES
   ============================================ */

/* HEADER */
header {
    background: var(--bg-primary);
    border-bottom-color: var(--border-primary);
}

header h1 {
    color: var(--text-primary);
    font-weight: 900;
    letter-spacing: 0.15em;
}

header button {
    transition: all var(--transition-fast);
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
}

header button:hover {
    background: var(--bg-tertiary);
    border-color: var(--border-secondary);
}

/* INPUTS */
input[type="text"],
input[type="password"],
input[type="date"],
textarea,
select {
    background: var(--bg-secondary);
    border-color: var(--border-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    border: 1px solid var(--border-primary);
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="date"]:focus,
textarea:focus,
select:focus {
    background: var(--bg-primary);
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="file"]::file-selector-button {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    font-weight: bold;
    transition: background var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
    background: var(--accent-blue-hover);
}

/* BOTONES */
button {
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all var(--transition-fast);
    border-radius: var(--radius-md);
}

button:active {
    transform: scale(0.98);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* MODALES */
.fixed.inset-0 {
    animation: fadeIn var(--transition-normal);
}

.fixed.inset-0 > div {
    animation: popIn var(--transition-normal);
}

/* CARDS */
.msg-card {
    animation: slideIn var(--transition-fast);
    background: var(--bg-primary);
    border-color: var(--border-primary);
    transition: all var(--transition-fast);
}

.msg-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--border-secondary);
}

/* TABS */
.tab-btn {
    border-bottom-width: 2px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: all var(--transition-fast);
    cursor: pointer;
}

.tab-btn.active {
    border-color: var(--accent-blue);
    color: var(--accent-blue);
}

.tab-btn:not(.active) {
    border-color: transparent;
    color: var(--text-secondary);
}

.tab-btn:not(.active):hover {
    color: var(--text-primary);
}

/* ============================================
   TEMAS DE COLORES
   ============================================ */

/* BACKGROUNDS SEMÁNTICOS */
.bg-blue-50 {
    background-color: #eff6ff;
}

.dark .bg-blue-50 {
    background-color: rgba(59, 130, 246, 0.1);
}

.bg-green-50 {
    background-color: #f0fdf4;
}

.dark .bg-green-50 {
    background-color: rgba(34, 197, 94, 0.1);
}

.bg-red-50 {
    background-color: #fef2f2;
}

.dark .bg-red-50 {
    background-color: rgba(239, 68, 68, 0.1);
}

.bg-purple-50 {
    background-color: #faf5ff;
}

.dark .bg-purple-50 {
    background-color: rgba(139, 92, 246, 0.1);
}

/* BORDERS SEMÁNTICOS */
.border-blue-200 {
    border-color: #bfdbfe;
}

.dark .border-blue-200 {
    border-color: rgba(59, 130, 246, 0.3);
}

.border-green-200 {
    border-color: #bbf7d0;
}

.dark .border-green-200 {
    border-color: rgba(34, 197, 94, 0.3);
}

.border-red-200 {
    border-color: #fecaca;
}

.dark .border-red-200 {
    border-color: rgba(239, 68, 68, 0.3);
}

/* ============================================
   TEMA CLARO PROFESIONAL
   ============================================ */

/* LOGIN SCREEN */
#login-screen {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

.dark #login-screen {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
}

/* MAIN BACKGROUND */
#main-app {
    background: var(--bg-secondary);
}

/* ASIDEBARS Y SECCIONES */
aside,
section {
    background: transparent;
}

aside > div:first-child {
    background: var(--bg-primary);
    border-color: var(--border-primary);
}

section > div:nth-child(1) {
    background: var(--bg-primary);
    border-color: var(--border-primary);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    main {
        grid-template-columns: 1fr !important;
    }
    
    aside, section {
        col-span: 12 !important;
    }
    
    header h1 {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    header {
        padding: 0.75rem 1rem;
        height: auto;
    }
    
    main {
        padding: 1rem;
        gap: 1rem;
    }
    
    input[type="text"],
    textarea {
        font-size: 16px; /* Prevenir zoom en iOS */
    }
    
    button {
        min-height: 44px; /* Touch-friendly */
    }
    
    .text-[11px] {
        font-size: 10px;
    }
    
    .text-[12px] {
        font-size: 11px;
    }
    
    .text-[13px] {
        font-size: 12px;
    }
    
    .text-[14px] {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    main {
        padding: 0.75rem;
        gap: 0.75rem;
        height: auto;
    }
    
    header .flex:last-child {
        gap: 0.5rem;
    }
    
    header button {
        padding: 0.5rem 0.75rem;
        font-size: 8px;
    }
}

/* ============================================
   ACCESIBILIDAD
   ============================================ */

:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

button:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

input:focus-visible {
    outline: none;
}

/* Contraste mejorado en modo claro */
.light {
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-tertiary: #94a3b8;
}

/* ============================================
   UTILIDADES ADICIONALES
   ============================================ */

.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.dark .glass {
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Badge styles */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-blue {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
    border: 1px solid var(--accent-blue);
}

.badge-green {
    background: rgba(22, 163, 74, 0.1);
    color: var(--accent-green);
    border: 1px solid var(--accent-green);
}

.badge-red {
    background: rgba(220, 38, 38, 0.1);
    color: var(--accent-red);
    border: 1px solid var(--accent-red);
}

/* Loading states */
.loading {
    pointer-events: none;
    opacity: 0.6;
}

.loading::after {
    content: '';
    display: inline-block;
    width: 1em;
    height: 1em;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 0.5em;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    header,
    button,
    input[type="button"],
    input[type="submit"] {
        display: none;
    }
    
    body {
        background: white;
    }
    
    .tab-content {
        display: block !important;
        page-break-after: always;
    }
}
