/**
 * CTNetwork - Shared Base CSS
 * 
 * Estilos base compartidos por todos los módulos del sistema.
 * Proporciona consistencia visual y mejoras de usabilidad.
 * 
 * @package CTNet\Shared
 */

/* ============================================
   CSS VARIABLES - Design Tokens
   ============================================ */
:root {
    /* Brand Colors */
    --ctnet-primary: #1e3c72;
    --ctnet-primary-light: #2a5298;
    --ctnet-secondary: #6c757d;
    --ctnet-success: #198754;
    --ctnet-warning: #ffc107;
    --ctnet-danger: #dc3545;
    --ctnet-info: #0dcaf0;

    /* UI Colors */
    --ctnet-bg-light: #f8f9fa;
    --ctnet-bg-dark: #212529;
    --ctnet-border: #dee2e6;
    --ctnet-shadow: rgba(0, 0, 0, 0.1);

    /* Typography */
    --ctnet-font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --ctnet-font-size-base: 0.9375rem;
    --ctnet-line-height: 1.5;

    /* Spacing */
    --ctnet-spacing-xs: 0.25rem;
    --ctnet-spacing-sm: 0.5rem;
    --ctnet-spacing-md: 1rem;
    --ctnet-spacing-lg: 1.5rem;
    --ctnet-spacing-xl: 2rem;

    /* Borders */
    --ctnet-border-radius: 8px;
    --ctnet-border-radius-lg: 12px;

    /* Transitions */
    --ctnet-transition: all 0.2s ease;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
    font-family: var(--ctnet-font-family);
    font-size: var(--ctnet-font-size-base);
    line-height: var(--ctnet-line-height);
    background-color: var(--ctnet-bg-light);
}

/* ============================================
   CARD IMPROVEMENTS
   ============================================ */
.card {
    border: none;
    border-radius: var(--ctnet-border-radius);
    box-shadow: 0 2px 8px var(--ctnet-shadow);
    transition: var(--ctnet-transition);
}

.card:hover {
    box-shadow: 0 4px 16px var(--ctnet-shadow);
}

.card-header {
    background: linear-gradient(135deg, var(--ctnet-primary), var(--ctnet-primary-light));
    color: white;
    border-radius: var(--ctnet-border-radius) var(--ctnet-border-radius) 0 0 !important;
    padding: var(--ctnet-spacing-md);
    font-weight: 600;
}

/* ============================================
   BUTTON IMPROVEMENTS
   ============================================ */
.btn {
    border-radius: var(--ctnet-border-radius);
    padding: 0.5rem 1rem;
    font-weight: 500;
    transition: var(--ctnet-transition);
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--ctnet-primary), var(--ctnet-primary-light));
    border: none;
}

/* ============================================
   TABLE IMPROVEMENTS
   ============================================ */
.table {
    border-radius: var(--ctnet-border-radius);
    overflow: hidden;
}

.table thead th {
    background: var(--ctnet-bg-light);
    border-bottom: 2px solid var(--ctnet-border);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.5px;
}

.table tbody tr:hover {
    background-color: rgba(30, 60, 114, 0.05);
}

/* ============================================
   FORM IMPROVEMENTS
   ============================================ */
.form-control,
.form-select {
    border-radius: var(--ctnet-border-radius);
    border: 1px solid var(--ctnet-border);
    padding: 0.625rem 0.875rem;
    transition: var(--ctnet-transition);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--ctnet-primary);
    box-shadow: 0 0 0 3px rgba(30, 60, 114, 0.15);
}

/* ============================================
   BADGE IMPROVEMENTS
   ============================================ */
.badge {
    border-radius: 20px;
    padding: 0.35rem 0.65rem;
    font-weight: 500;
}

/* ============================================
   ALERT IMPROVEMENTS
   ============================================ */
.alert {
    border-radius: var(--ctnet-border-radius);
    border: none;
}

/* ============================================
   RESPONSIVE UTILITIES
   ============================================ */
@media (max-width: 767.98px) {

    /* Mobile-specific styles */
    .container-fluid {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

    .card-body {
        padding: 1rem;
    }

    .btn {
        padding: 0.75rem 1.25rem;
    }

    /* Hide desktop-only elements */
    .d-desktop-only {
        display: none !important;
    }
}

@media (min-width: 768px) {
    /* Desktop-specific styles */

    /* Hide mobile-only elements */
    .d-mobile-only {
        display: none !important;
    }
}

/* ============================================
   TOUCH IMPROVEMENTS
   ============================================ */
@media (hover: none) and (pointer: coarse) {

    /* Touch device enhancements */
    .btn {
        min-height: 44px;
        min-width: 44px;
    }

    .nav-link {
        padding: 12px 16px !important;
    }

    .dropdown-item {
        padding: 12px 16px;
    }
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 24px;
    height: 24px;
    margin: -12px 0 0 -12px;
    border: 3px solid var(--ctnet-border);
    border-top-color: var(--ctnet-primary);
    border-radius: 50%;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
:focus-visible {
    outline: 3px solid var(--ctnet-primary);
    outline-offset: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {

    .navbar,
    .ctnet-nav-fab,
    .fab-container {
        display: none !important;
    }

    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}