/* ========================================
   RANDOMTECH - TEMA PERSONALIZADO
   Paleta de colores basada en logo RandomTech
   ======================================== */

:root {
    /* Colores principales del tema RandomTech */
    --rt-primary: #003B73;          /* Azul navy del logo */
    --rt-primary-dark: #002347;     /* Azul más oscuro */
    --rt-primary-light: #0055A5;    /* Azul intermedio */
    --rt-secondary: #0066CC;        /* Azul brillante */
    --rt-accent: #00B4D8;           /* Azul claro para highlights */

    /* Colores de estado */
    --rt-success: #06D6A0;          /* Verde moderno */
    --rt-info: #00B4D8;             /* Azul info */
    --rt-warning: #FFD166;          /* Amarillo/naranja suave */
    --rt-danger: #EF476F;           /* Rojo moderno */

    /* Colores neutros */
    --rt-white: #FFFFFF;
    --rt-light: #F8F9FA;
    --rt-light-gray: #E9ECEF;
    --rt-gray: #6C757D;
    --rt-dark-gray: #495057;
    --rt-dark: #001F3F;             /* Azul oscuro casi negro */

    /* Gradientes */
    --rt-gradient-primary: linear-gradient(135deg, #003B73 0%, #0066CC 100%);
    --rt-gradient-light: linear-gradient(135deg, #0066CC 0%, #00B4D8 100%);
    --rt-gradient-dark: linear-gradient(135deg, #001F3F 0%, #003B73 100%);

    /* Sombras */
    --rt-shadow-sm: 0 2px 4px rgba(0, 59, 115, 0.1);
    --rt-shadow-md: 0 4px 6px rgba(0, 59, 115, 0.15);
    --rt-shadow-lg: 0 10px 15px rgba(0, 59, 115, 0.2);
    --rt-shadow-xl: 0 20px 25px rgba(0, 59, 115, 0.25);

    /* Transiciones */
    --rt-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);

    /* Dimensiones */
    --rt-sidebar-width: 260px;
    --rt-navbar-height: 60px;
    --rt-border-radius: 8px;
    --rt-border-radius-lg: 12px;
}

/* ========================================
   LOGIN PAGE - Diseño moderno
   ======================================== */

.rt-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--rt-gradient-dark);
    position: relative;
    overflow: hidden;
}

/* Patrón de fondo animado */
.rt-login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background:
        radial-gradient(circle at 20% 50%, rgba(0, 102, 204, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(0, 180, 216, 0.1) 0%, transparent 50%);
    animation: float 15s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    33% { transform: translate(30px, -30px) rotate(120deg); }
    66% { transform: translate(-20px, 20px) rotate(240deg); }
}

.rt-login-box {
    width: 100%;
    max-width: 450px;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.rt-login-card {
    background: var(--rt-white);
    border-radius: var(--rt-border-radius-lg);
    box-shadow: var(--rt-shadow-xl);
    overflow: hidden;
    backdrop-filter: blur(10px);
    animation: slideUp 0.5s ease-out;
}

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

.rt-login-header {
    padding: 40px 40px 30px;
    text-align: center;
    background: var(--rt-gradient-primary);
    color: var(--rt-white);
}

.rt-login-logo {
    max-width: 180px;
    height: auto;
    margin-bottom: 15px;
    filter: brightness(0) invert(1);
}

.rt-login-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px;
    color: var(--rt-white);
}

.rt-login-subtitle {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.rt-login-body {
    padding: 40px;
}

.rt-form-group {
    margin-bottom: 24px;
}

.rt-form-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--rt-dark-gray);
    margin-bottom: 8px;
}

.rt-input-group {
    position: relative;
}

.rt-input-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--rt-gray);
    font-size: 18px;
    transition: var(--rt-transition);
}

.rt-form-control {
    width: 100%;
    padding: 14px 16px 14px 48px;
    border: 2px solid var(--rt-light-gray);
    border-radius: var(--rt-border-radius);
    font-size: 15px;
    transition: var(--rt-transition);
    background: var(--rt-white);
}

.rt-form-control:focus {
    outline: none;
    border-color: var(--rt-primary);
    box-shadow: 0 0 0 3px rgba(0, 59, 115, 0.1);
}

.rt-form-control:focus + .rt-input-icon {
    color: var(--rt-primary);
}

.rt-btn-login {
    width: 100%;
    padding: 14px 24px;
    background: var(--rt-gradient-primary);
    color: var(--rt-white);
    border: none;
    border-radius: var(--rt-border-radius);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--rt-transition);
    box-shadow: var(--rt-shadow-md);
}

.rt-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: var(--rt-shadow-lg);
}

.rt-btn-login:active {
    transform: translateY(0);
}

.rt-alert {
    padding: 12px 16px;
    border-radius: var(--rt-border-radius);
    margin-top: 20px;
    font-size: 14px;
}

.rt-alert-danger {
    background-color: rgba(239, 71, 111, 0.1);
    color: var(--rt-danger);
    border: 1px solid rgba(239, 71, 111, 0.3);
}

/* ========================================
   NAVBAR - Diseño moderno
   ======================================== */

.rt-navbar {
    background: var(--rt-white);
    box-shadow: var(--rt-shadow-sm);
    border-bottom: 1px solid var(--rt-light-gray);
}

.rt-navbar .navbar-brand {
    font-size: 22px;
    font-weight: 700;
    color: var(--rt-primary);
    padding: 0 20px;
}

.rt-navbar .nav-link {
    color: var(--rt-dark-gray);
    padding: 10px 15px;
    border-radius: var(--rt-border-radius);
    transition: var(--rt-transition);
}

.rt-navbar .nav-link:hover {
    background-color: var(--rt-light);
    color: var(--rt-primary);
}

/* ========================================
   SIDEBAR - Diseño moderno
   ======================================== */

.rt-sidebar {
    background: var(--rt-gradient-dark);
    box-shadow: var(--rt-shadow-md);
}

.rt-sidebar .brand-link {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.rt-sidebar .brand-image {
    max-width: 35px;
    margin-right: 10px;
    filter: brightness(0) invert(1);
}

.rt-sidebar .brand-text {
    color: var(--rt-white);
    font-size: 20px;
    font-weight: 700;
}

.rt-sidebar .nav-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 12px 20px;
    border-radius: 0;
    transition: var(--rt-transition);
    border-left: 3px solid transparent;
}

.rt-sidebar .nav-sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--rt-white);
    border-left-color: var(--rt-accent);
}

.rt-sidebar .nav-sidebar .nav-link.active {
    background-color: rgba(0, 180, 216, 0.2);
    color: var(--rt-white);
    border-left-color: var(--rt-accent);
    font-weight: 600;
}

.rt-sidebar .nav-sidebar .nav-icon {
    font-size: 18px;
    margin-right: 12px;
    width: 24px;
    text-align: center;
}

.rt-sidebar .nav-header {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 20px 20px 8px;
}

/* Submenús */
.rt-sidebar .nav-treeview {
    background: rgba(0, 0, 0, 0.2);
}

.rt-sidebar .nav-treeview .nav-link {
    padding-left: 55px;
    font-size: 14px;
}

/* ========================================
   DASHBOARD - Cards modernas
   ======================================== */

.rt-stat-card {
    background: var(--rt-white);
    border-radius: var(--rt-border-radius-lg);
    padding: 24px;
    box-shadow: var(--rt-shadow-sm);
    transition: var(--rt-transition);
    border: 1px solid var(--rt-light-gray);
    position: relative;
    overflow: hidden;
}

.rt-stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--rt-gradient-primary);
}

.rt-stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--rt-shadow-lg);
}

.rt-stat-card.primary::before {
    background: var(--rt-gradient-primary);
}

.rt-stat-card.success::before {
    background: linear-gradient(135deg, #06D6A0 0%, #26DE81 100%);
}

.rt-stat-card.warning::before {
    background: linear-gradient(135deg, #FFD166 0%, #FFA726 100%);
}

.rt-stat-card.danger::before {
    background: linear-gradient(135deg, #EF476F 0%, #F06292 100%);
}

.rt-stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 16px;
}

.rt-stat-icon.primary {
    background: linear-gradient(135deg, rgba(0, 59, 115, 0.1) 0%, rgba(0, 102, 204, 0.1) 100%);
    color: var(--rt-primary);
}

.rt-stat-icon.success {
    background: linear-gradient(135deg, rgba(6, 214, 160, 0.1) 0%, rgba(38, 222, 129, 0.1) 100%);
    color: var(--rt-success);
}

.rt-stat-icon.warning {
    background: linear-gradient(135deg, rgba(255, 209, 102, 0.1) 0%, rgba(255, 167, 38, 0.1) 100%);
    color: var(--rt-warning);
}

.rt-stat-icon.danger {
    background: linear-gradient(135deg, rgba(239, 71, 111, 0.1) 0%, rgba(240, 98, 146, 0.1) 100%);
    color: var(--rt-danger);
}

.rt-stat-label {
    font-size: 14px;
    color: var(--rt-gray);
    font-weight: 500;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rt-stat-value {
    font-size: 32px;
    font-weight: 700;
    color: var(--rt-dark);
    line-height: 1;
    margin-bottom: 8px;
}

.rt-stat-change {
    font-size: 13px;
    color: var(--rt-gray);
}

.rt-stat-change.positive {
    color: var(--rt-success);
}

.rt-stat-change.negative {
    color: var(--rt-danger);
}

/* ========================================
   BOTONES - Estilos modernos
   ======================================== */

.rt-btn {
    padding: 10px 24px;
    border-radius: var(--rt-border-radius);
    font-weight: 600;
    font-size: 14px;
    transition: var(--rt-transition);
    border: none;
    cursor: pointer;
}

.rt-btn-primary {
    background: var(--rt-gradient-primary);
    color: var(--rt-white);
    box-shadow: var(--rt-shadow-sm);
}

.rt-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--rt-shadow-md);
}

.rt-btn-outline-primary {
    background: transparent;
    color: var(--rt-primary);
    border: 2px solid var(--rt-primary);
}

.rt-btn-outline-primary:hover {
    background: var(--rt-primary);
    color: var(--rt-white);
}

/* ========================================
   TABLAS - Diseño moderno
   ======================================== */

.rt-table {
    width: 100%;
    background: var(--rt-white);
    border-radius: var(--rt-border-radius);
    overflow: hidden;
    box-shadow: var(--rt-shadow-sm);
}

.rt-table thead {
    background: var(--rt-gradient-primary);
}

.rt-table thead th {
    color: var(--rt-white);
    font-weight: 600;
    padding: 16px;
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rt-table tbody tr {
    border-bottom: 1px solid var(--rt-light-gray);
    transition: var(--rt-transition);
}

.rt-table tbody tr:hover {
    background-color: rgba(0, 59, 115, 0.05);
}

.rt-table tbody td {
    padding: 14px 16px;
    font-size: 14px;
    color: var(--rt-dark-gray);
}

/* ========================================
   FORMULARIOS - Diseño moderno
   ======================================== */

.rt-form-container {
    background: var(--rt-white);
    padding: 30px;
    border-radius: var(--rt-border-radius-lg);
    box-shadow: var(--rt-shadow-md);
}

.rt-form-section {
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 2px solid var(--rt-light-gray);
}

.rt-form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.rt-form-section-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--rt-primary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
}

.rt-form-section-title i {
    margin-right: 10px;
    font-size: 20px;
}

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

@media (max-width: 768px) {
    .rt-login-body {
        padding: 30px 25px;
    }

    .rt-login-header {
        padding: 30px 25px 20px;
    }

    .rt-login-title {
        font-size: 24px;
    }

    .rt-stat-card {
        margin-bottom: 20px;
    }

    .rt-stat-value {
        font-size: 28px;
    }
}

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.rt-fade-in {
    animation: fadeIn 0.5s ease-out;
}

.rt-slide-in-left {
    animation: slideInLeft 0.5s ease-out;
}

.rt-slide-in-right {
    animation: slideInRight 0.5s ease-out;
}

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

.rt-text-primary { color: var(--rt-primary); }
.rt-text-secondary { color: var(--rt-secondary); }
.rt-text-success { color: var(--rt-success); }
.rt-text-warning { color: var(--rt-warning); }
.rt-text-danger { color: var(--rt-danger); }

.rt-bg-primary { background-color: var(--rt-primary); }
.rt-bg-secondary { background-color: var(--rt-secondary); }
.rt-bg-light { background-color: var(--rt-light); }

.rt-shadow-sm { box-shadow: var(--rt-shadow-sm); }
.rt-shadow-md { box-shadow: var(--rt-shadow-md); }
.rt-shadow-lg { box-shadow: var(--rt-shadow-lg); }

/* ========================================
   SELECT DROPDOWN FIX - Mostrar texto completo
   ======================================== */

/* Fix para select elements - asegurar que el texto se vea completo */
select.form-control,
select.rt-input,
.form-control select,
select {
    /* Remover cualquier limitación de ancho */
    max-width: none !important;
    width: 100% !important;

    /* Asegurar padding adecuado */
    padding: 0.6rem 2.5rem 0.6rem 1rem !important;

    /* Permitir que el texto se muestre completo */
    text-overflow: clip !important;
    overflow: visible !important;
    white-space: normal !important;

    /* Altura mínima para el select */
    min-height: 38px !important;
    height: auto !important;

    /* Asegurar que el texto sea legible */
    font-size: 14px !important;
    line-height: 1.5 !important;
}

/* Fix para las opciones del dropdown */
select.form-control option,
select.rt-input option,
select option {
    /* Padding para las opciones */
    padding: 8px 12px !important;

    /* Permitir que el texto se muestre completo */
    text-overflow: clip !important;
    overflow: visible !important;
    white-space: normal !important;

    /* Asegurar que el texto sea legible */
    font-size: 14px !important;
    line-height: 1.6 !important;

    /* Color de texto */
    color: var(--rt-dark-gray) !important;
}

/* Mejorar la apariencia cuando está seleccionado */
select.form-control option:checked,
select.rt-input option:checked,
select option:checked {
    background-color: var(--rt-primary) !important;
    color: var(--rt-white) !important;
    font-weight: 500 !important;
}

/* Fix para select en focus */
select.form-control:focus,
select.rt-input:focus {
    border-color: var(--rt-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 59, 115, 0.15) !important;
}

/* ========================================
   SELECT2 CUSTOM STYLING
   ======================================== */

/* Contenedor principal de Select2 */
.select2-container--bootstrap4 .select2-selection {
    border: 2px solid var(--rt-light-gray) !important;
    border-radius: var(--rt-border-radius) !important;
    padding: 0.4rem 0.8rem !important;
    min-height: 38px !important;
    transition: var(--rt-transition) !important;
}

/* Select2 en estado focus */
.select2-container--bootstrap4.select2-container--focus .select2-selection,
.select2-container--bootstrap4.select2-container--open .select2-selection {
    border-color: var(--rt-primary) !important;
    box-shadow: 0 0 0 0.2rem rgba(0, 59, 115, 0.15) !important;
}

/* Dropdown de Select2 */
.select2-container--bootstrap4 .select2-dropdown {
    border: 2px solid var(--rt-primary) !important;
    border-radius: var(--rt-border-radius) !important;
    box-shadow: var(--rt-shadow-lg) !important;
    z-index: 9999 !important;
}

/* Asegurar que el dropdown tenga ancho automático para mostrar texto completo */
.select2-container--bootstrap4 .select2-results__options {
    max-height: 300px !important;
    overflow-y: auto !important;
}

/* Opciones del dropdown - asegurar que el texto se muestre completo */
.select2-container--bootstrap4 .select2-results__option {
    padding: 10px 15px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Opción seleccionada en el dropdown */
.select2-container--bootstrap4 .select2-results__option--highlighted {
    background-color: var(--rt-primary) !important;
    color: var(--rt-white) !important;
}

/* Opción actualmente seleccionada */
.select2-container--bootstrap4 .select2-results__option[aria-selected="true"] {
    background-color: var(--rt-light) !important;
    color: var(--rt-primary) !important;
    font-weight: 500 !important;
}

/* Texto de búsqueda en Select2 */
.select2-container--bootstrap4 .select2-search__field {
    border: 1px solid var(--rt-light-gray) !important;
    border-radius: var(--rt-border-radius) !important;
    padding: 0.5rem !important;
    font-size: 14px !important;
}

.select2-container--bootstrap4 .select2-search__field:focus {
    border-color: var(--rt-primary) !important;
    outline: none !important;
}

/* Texto seleccionado mostrado en el campo */
.select2-container--bootstrap4 .select2-selection__rendered {
    padding: 0 !important;
    line-height: 1.5 !important;
    color: var(--rt-dark-gray) !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}

/* Asegurar que el placeholder se vea correctamente */
.select2-container--bootstrap4 .select2-selection__placeholder {
    color: #6c757d !important;
    opacity: 0.7 !important;
}

/* Botón de limpiar selección */
.select2-container--bootstrap4 .select2-selection__clear {
    margin-right: 10px !important;
    font-size: 1.2em !important;
    color: var(--rt-danger) !important;
}

/* Flecha del dropdown */
.select2-container--bootstrap4 .select2-selection__arrow {
    height: 100% !important;
    right: 3px !important;
}

.select2-container--bootstrap4 .select2-selection__arrow b {
    border-color: var(--rt-primary) transparent transparent transparent !important;
    border-width: 6px 5px 0 5px !important;
}

/* Cuando está abierto */
.select2-container--bootstrap4.select2-container--open .select2-selection__arrow b {
    border-color: transparent transparent var(--rt-primary) transparent !important;
    border-width: 0 5px 6px 5px !important;
}

/* Asegurar z-index adecuado */
.select2-container {
    z-index: 999 !important;
}

.select2-dropdown {
    z-index: 9999 !important;
}

/* Responsive - en móviles, hacer el dropdown más grande */
@media (max-width: 767.98px) {
    .select2-container--bootstrap4 .select2-results__option {
        padding: 12px 15px !important;
        font-size: 16px !important;
    }

    .select2-container--bootstrap4 .select2-selection {
        min-height: 44px !important;
    }
}
