/* ===========================================
   TENTALO BLAZOR - ESTILOS GLOBALES
   Migrado de .NET MAUI
   =========================================== */

/* Reset y Variables */
:root {
    /* Colores Corporativos (de Colors.xaml MAUI) */
    --nautilo-corp: #2469CE;
    --nautilo-corp-dark: #1a4f9e;
    --primary: #512BD4;
    --primary-dark: #ac99ea;
    --secondary: #DFD8F7;
    --tertiary: #2B0B98;

    /* Grises (de Colors.xaml) */
    --gray-50: #f5f5f5;
    --gray-100: #E1E1E1;
    --gray-200: #C8C8C8;
    --gray-300: #ACACAC;
    --gray-400: #919191;
    --gray-500: #6E6E6E;
    --gray-600: #404040;
    --gray-700: #4d4d4d;
    --gray-800: #1f1f1f;
    --gray-900: #212121;
    --gray-950: #141414;
    --gris-ultra-claro: #f5f5f5;
    --gris-claro: #D7D7D7;
    --gris-medio: #ABAAAA;
    --gris-oscuro: #4d4d4d;
    --gris-blanco: #ebebeb;

    /* Colores de Estado */
    --success: #7ed321;
    --warning: #fcbc0f;
    --danger: #BD2E2B;
    --info: #4acaff;

    /* Colores Especificos (de Colors.xaml) */
    --facebook-blue: #4267B2;
    --orange: #ff844a;
    --orangey-yellow: #fcbc0f;
    --green: #7ed321;
    --verde-qr: #a5ca08;
    --verde-qr-carro: #e4e8d1;
    --blue: #4acaff;
    --red: #BD2E2B;
    --rojo-mucca: #BD2E2B;
    --marron-mucca: #382D2F;
    --marron-ta: #794f39;
    --hyperlink: #567cd7;
    --midnight-blue: #190649;
    --magenta: #D600AA;
    --submarino: #fcc525;
    --picandgo-oscuro: #1638b0;
    --picandgo-claro: #00d2cd;
    --mabel-azul: #094780;
    --roypas-azul: #2C5F98;
    --roypas-rosa: #CE2EBC;
    --roypas-naranja: #F0B05E;

    /* Tipografia */
    --font-family: 'Segoe UI', 'Proxima Nova', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-family-bold: 'Segoe UI Semibold', 'Proxima Nova Bold', -apple-system, BlinkMacSystemFont, sans-serif;

    /* Sombras */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.15);

    /* Bordes */
    --radius-sm: 4px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 9999px;
}

/* Reset Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    background-color: var(--gray-100);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
}

/* Tipografia */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-bold);
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

p {
    margin-bottom: 1rem;
}

a {
    color: var(--nautilo-corp);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--nautilo-corp-dark);
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font-family-bold);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--nautilo-corp) 0%, var(--nautilo-corp-dark) 100%);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(61, 194, 193, 0.4);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--gray-300);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--nautilo-corp);
    color: var(--nautilo-corp);
}

.btn-outline:hover:not(:disabled) {
    background: var(--nautilo-corp);
    color: white;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

/* Inputs */
.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    font-size: 1rem;
    font-family: var(--font-family);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    color: var(--gray-900);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--nautilo-corp);
    box-shadow: 0 0 0 3px rgba(61, 194, 193, 0.15);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-input:disabled {
    background: var(--gray-100);
    cursor: not-allowed;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.form-group {
    margin-bottom: 1rem;
}

/* Cards */
.card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--gray-900);
    margin: 0;
}

/* Alertas */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #86efac;
    color: #166534;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

.alert-danger {
    background: #fee2e2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

.alert-info {
    background: #dbeafe;
    border: 1px solid #93c5fd;
    color: #1e40af;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: var(--radius-full);
}

.badge-primary {
    background: var(--nautilo-corp);
    color: white;
}

.badge-success {
    background: var(--success);
    color: white;
}

.badge-warning {
    background: var(--warning);
    color: white;
}

.badge-danger {
    background: var(--danger);
    color: white;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th,
.table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.table th {
    font-weight: 600;
    color: var(--gray-700);
    background: var(--gray-50);
}

.table tbody tr:hover {
    background: var(--gray-50);
}

/* Loading Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--nautilo-corp);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-sm {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

.spinner-lg {
    width: 60px;
    height: 60px;
    border-width: 4px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Utilidades */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-primary { color: var(--nautilo-corp); }
.text-success { color: var(--success); }
.text-warning { color: var(--warning); }
.text-danger { color: var(--danger); }
.text-muted { color: var(--gray-500); }

.bg-primary { background-color: var(--nautilo-corp); }
.bg-white { background-color: white; }
.bg-gray { background-color: var(--gray-100); }

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.p-1 { padding: 0.25rem; }
.p-2 { padding: 0.5rem; }
.p-3 { padding: 1rem; }
.p-4 { padding: 1.5rem; }
.p-5 { padding: 2rem; }

.d-flex { display: flex; }
.d-block { display: block; }
.d-none { display: none; }

.flex-column { flex-direction: column; }
.align-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 1rem; }
.gap-4 { gap: 1.5rem; }

.w-100 { width: 100%; }
.h-100 { height: 100%; }

.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: var(--radius-lg); }
.rounded-full { border-radius: var(--radius-full); }

.shadow { box-shadow: var(--shadow); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }

/* Responsive */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }
}

/* Blazor Specific */
#blazor-error-ui {
    color-scheme: light only;
    background: var(--danger);
    color: white;
    bottom: 0;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.2);
    display: none;
    left: 0;
    padding: 1rem;
    position: fixed;
    width: 100%;
    z-index: 9999;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 1rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: var(--danger);
    padding: 1rem;
    color: white;
    border-radius: var(--radius);
}

.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem auto;
}

.loading-progress circle {
    fill: none;
    stroke: var(--gray-200);
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
    stroke: var(--nautilo-corp);
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
    color: var(--gray-600);
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Cargando");
}

/* Validation */
.valid.modified:not([type=checkbox]) {
    outline: 2px solid var(--success);
}

.invalid {
    outline: 2px solid var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Icons */
.btn-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.btn-icon-small {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.header-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.nav-icon {
    width: 28px;
    height: 28px;
    object-fit: contain;
    margin-right: 0.75rem;
}

.cart-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.empty-icon-img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.menu-icon-img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}
