/* ===== ESTILOS GENERALES ===== */
:root {
    --space-cadet: #2E294E;
    --neon-blue: #51CBEE;
    --cyber-purple: #7E57C2;
    --matrix-green: #06D6A0;
    --blood-red: #FF6F61;
    --dark-bg: rgba(20, 37, 68, 0.85);
    --darker-bg: rgba(10, 20, 40, 0.95);
    --border-color: rgba(81, 203, 238, 0.3);
    --text-light: #e0e7ff;
    --text-lighter: #b3c7ff;
}

body {
    background: #0f1116;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-light);
    min-height: 100vh;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* ===== ESTRUCTURA PRINCIPAL ===== */
.container.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===== HEADER Y NAVEGACIÓN ===== */
.navbar {
    background: var(--darker-bg) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
}

.navbar-brand {
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    color: var(--neon-blue) !important;
    text-shadow: 0 0 10px rgba(81, 203, 238, 0.5);
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 250px;
    position: fixed;
    top: 56px;
    left: -250px;
    bottom: 0;
    background: var(--darker-bg);
    border-right: 1px solid var(--border-color);
    transition: all 0.3s;
    z-index: 1000;
    overflow-y: auto;
}

.sidebar.show {
    left: 0;
}

.sidebar-header {
    padding: 15px;
    background: rgba(0,0,0,0.2);
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header h5 {
    color: var(--neon-blue);
    font-family: 'Orbitron', sans-serif;
    margin-bottom: 0;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li a {
    display: block;
    padding: 12px 15px;
    color: var(--text-light);
    text-decoration: none;
    transition: all 0.3s;
    border-left: 3px solid transparent;
}

.sidebar-menu li a:hover {
    background: rgba(81, 203, 238, 0.1);
    color: var(--neon-blue);
    border-left: 3px solid var(--neon-blue);
}

.sidebar-menu li.active a {
    background: rgba(81, 203, 238, 0.2);
    color: var(--neon-blue);
    border-left: 3px solid var(--neon-blue);
}

.sidebar-menu li a i {
    width: 20px;
    margin-right: 10px;
    text-align: center;
}

.sidebar-divider {
    padding: 10px 15px;
    color: var(--text-lighter);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-footer {
    padding: 15px;
    border-top: 1px solid var(--border-color);
}

/* ===== CONTENIDO PRINCIPAL ===== */
.main-content {
    margin-left: 0;
    padding-top: 56px;
    transition: all 0.3s;
}

.sidebar.show + .main-content {
    margin-left: 250px;
}

/* ===== TARJETAS ===== */
.card {
    background: var(--dark-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(81, 203, 238, 0.2);
}

.card-header {
    background: rgba(0,0,0,0.2) !important;
    border-bottom: 1px solid var(--border-color) !important;
    color: var(--neon-blue);
    font-family: 'Orbitron', sans-serif;
}

.stat-card {
    background: var(--dark-bg);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(81, 203, 238, 0.2);
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    font-family: 'Orbitron', sans-serif;
    color: var(--neon-blue);
    text-shadow: 0 0 10px rgba(81, 203, 238, 0.5);
}

.stat-label {
    font-size: 1rem;
    color: var(--text-lighter);
}

.recent-card {
    background: rgba(20, 37, 68, 0.5);
    border-radius: 8px;
    border-left: 3px solid var(--matrix-green);
    padding: 15px;
    margin-bottom: 15px;
    word-break: break-all;
}

.gate-badge {
    background: rgba(126, 87, 194, 0.2);
    color: var(--cyber-purple);
    border-radius: 20px;
    padding: 3px 10px;
    font-size: 0.8rem;
}

/* ===== FORMULARIOS Y ENTRADAS ===== */
input, textarea, select, .cookie-input, .cookie-input2 {
    background: rgba(20, 37, 68, 0.5) !important;
    color: #e0e7ff !important;
    border: 1px solid rgba(81, 203, 238, 0.3) !important;
    border-radius: 10px;
    padding: 12px auto;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

input:focus, textarea:focus, select:focus, .cookie-input:focus, .cookie-input2:focus {
    outline: none;
    border-color: #51cbee !important;
    background: rgba(20, 37, 68, 0.7) !important;
    box-shadow: 0 0 12px rgba(81, 203, 238, 0.4) !important;
}

input::placeholder, textarea::placeholder, .cookie-input::placeholder, .cookie-input2::placeholder {
    color: rgba(224, 231, 255, 0.6) !important;
}

.form-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(81, 203, 238, 0.6);
}

.form-group input {
    padding-left: 40px;
}

/* ===== BOTONES ===== */
.btn {
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.btn-dark {
    background: var(--cyber-purple) !important;
    border: none !important;
    transition: all 0.3s ease !important;
}

.btn-dark:hover {
    background: var(--neon-blue) !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 5px 15px rgba(81, 203, 238, 0.4) !important;
}

.btn-danger {
    background: #8b1e3f;
    border: none;
    border-radius: 10px;
    color: #e0e7ff;
}

.btn-danger:hover {
    background: #a3244d;
    box-shadow: 0 6px 15px rgba(163, 36, 77, 0.3);
}

.btn-success {
    background-color: #28a745;
    border: none;
    border-radius: 5px;
    padding: 10px 20px;
    color: #fff;
    transition: background-color 0.3s ease;
}

.btn-success:hover {
    background-color: #218838;
}

.btn-primary {
    background-color: #FF6F61;
    border: none;
    color: #FFFFFF;
}

.btn-primary:hover {
    background-color: #E65A50;
}

.btn-tutorial {
    background: #673AB7;
    color: white;
    transition: all 0.3s ease;
}

.btn-tutorial:hover {
    background: #5E35B1;
    color: white;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.btn-tutorials {
    background-color: #7E57C2;
    border: none;
    color: white;
}

.btn-tutorials:hover {
    background-color: #673AB7;
    color: white;
}

.btn-profile {
    background: #6c757d;
    color: white;
}

.btn-profile:hover {
    background: #5a6268;
    color: white;
}

.btn-api {
    background: rgba(20, 37, 68, 0.7);
    border: 1px solid rgba(81, 203, 238, 0.3);
    color: #b3c7ff;
    border-radius: 20px;
    padding: 5px 15px;
    transition: all 0.3s ease;
    font-size: 12px;
}

.btn-api:hover {
    background: rgba(81, 203, 238, 0.2);
    color: #e0e7ff;
}

.btn-api.active {
    background: rgba(81, 203, 238, 0.4);
    border-color: #51cbee;
    color: #e0e7ff;
    box-shadow: 0 0 10px rgba(81, 203, 238, 0.4);
}

/* ===== PÁGINA DE LOGIN ===== */
body.login-page {
    background: linear-gradient(135deg, #0f0c29, #302b63, #24243e) !important;
    font-family: 'Orbitron', sans-serif !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-height: 100vh !important;
    overflow: hidden !important;
}

body.login-page footer {
    display: none !important;
}

.login-container {
    width: 90%;
    max-width: 420px;
    margin: 100px auto !important;
    padding: 2rem !important;
    background: rgba(15, 20, 40, 0.95) !important;
    border: 1px solid #7E57C2 !important;
    border-radius: 16px !important;
    box-shadow: 0 8px 32px rgba(126, 87, 194, 0.3) !important;
    position: relative;
    z-index: 1;
}

.login-container h2 {
    color: #073ceb !important;
    text-align: center;
    font-size: 2rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 0 10px rgba(81, 203, 238, 0.7);
}

.input-container {
    position: relative;
    margin-bottom: 1.8rem;
}

.input-container .icon {
    color: #7e57c2 !important;
    left: 15px !important;
    filter: drop-shadow(0 0 5px rgba(126, 87, 194, 0.7));
}

.login-container input[type="text"],
.login-container input[type="password"] {
    background: rgba(10, 15, 30, 0.7) !important;
    border: 1px solid #7E57C2 !important;
    color: white !important;
    padding: 12px 15px 12px 45px !important;
    border-radius: 8px !important;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.login-container input[type="submit"] {
    background: linear-gradient(90deg, #7e57c2, #51cbee) !important;
    border: none !important;
    color: white !important;
    font-weight: bold;
    letter-spacing: 1px;
    padding: 12px !important;
    margin-top: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    box-shadow: 0 0 20px rgba(81, 203, 238, 0.3);
    width: 100%;
}

.login-container input[type="submit"]:hover {
    background: linear-gradient(90deg, #51cbee, #7e57c2) !important;
    transform: translateY(-3px);
    box-shadow: 0 0 30px rgba(126, 87, 194, 0.6);
}

.btn-register {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #7E57C2;
    text-decoration: none;
    transition: color 0.3s ease;
}

.btn-register:hover {
    color: #D1C4E9;
}

/* ===== PESTAÑAS ===== */
.nav-tabs {
    background: linear-gradient(90deg, rgba(46,41,78,0.9) 0%, rgba(81,203,238,0.3) 100%) !important;
    border: none !important;
}

.nav-tabs .nav-link.active {
    background: rgba(81, 203, 238, 0.4) !important;
    color: white !important;
    border-bottom: 2px solid var(--matrix-green) !important;
}

.nav-tabs .nav-link {
    color: #b3c7ff;
    border: none;
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.nav-tabs .nav-link:hover {
    color: #e0e7ff;
}

.tab-content {
    background: rgba(20, 37, 68, 0.85);
    border-radius: 0 0 16px 16px;
    padding: 20px;
    border: 1px solid rgba(81, 203, 238, 0.2);
    border-top: none;
}

/* ===== MODALES Y POPUPS ===== */
.modal-content {
    background: rgba(46, 41, 78, 0.95);
    border: 1px solid #FF6F61;
    border-radius: 15px;
}

.modal-header {
    border-bottom: 1px solid #FF6F61;
}

.modal-footer {
    border-top: 1px solid #FF6F61;
}

.modal-title {
    font-weight: 600;
}

.modal-body {
    padding: 25px 30px;
}

.close {
    color: #e0e7ff;
    opacity: 0.7;
    text-shadow: none;
}

.close:hover {
    opacity: 1;
}

#generator-popup, #bin-info-popup, #email-extrapolator-popup {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 2, 5, 0.98);
    border: 1px solid rgba(81, 203, 238, 0.2);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    width: 300px;
    color: white;
}

#close-generator, #close-bin-info {
    color: #e0e7ff;
    font-size: 18px;
    cursor: pointer;
}

#close-generator:hover, #close-bin-info:hover {
    color: #51cbee;
}

.action-buttons {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
}

.action-btn {
    background: rgba(20, 37, 68, 0.9) !important;
    border: 1px solid rgba(81, 203, 238, 0.5) !important;
    color: #e0e7ff !important;
    padding: 6px 15px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
    margin-left: 8px;
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(81, 203, 238, 0.3);
}

#clear-results {
    background: rgba(255, 111, 97, 0.15) !important;
    border-color: rgba(255, 111, 97, 0.4) !important;
    color: #ff6f61 !important;
}

#copy-extrapolated {
    background: rgba(6, 214, 160, 0.15) !important;
    border-color: rgba(6, 214, 160, 0.4) !important;
    color: #06d6a0 !important;
}

/* ===== TABLAS ===== */
.table-dark {
    background: rgba(46, 41, 78, 0.8);
    color: #FFFFFF;
    border-radius: 10px;
    overflow: hidden;
}

.table-dark th, .table-dark td {
    border-color: rgba(255, 111, 97, 0.2);
}

.table-dark th {
    background: rgba(255, 111, 97, 0.3);
}

/* ===== BADGES ===== */
.badge-warning { background: #FFD166; }
.badge-success { background: #06D6A0; }
.badge-danger { background: #FF6F61; }
.badge-info { background: #2E294E; }
.badge-secondary { background: #4A4453; }

/* ===== TOASTR NOTIFICACIONES ===== */
#toast-container > .toast-success {
    background-color: rgba(30, 133, 84, 0.9);
    border: 1px solid rgba(81, 203, 238, 0.3);
    color: #e0e7ff;
    backdrop-filter: blur(5px);
}

#toast-container > .toast-error {
    background-color: rgba(139, 30, 63, 0.9);
    border: 1px solid rgba(81, 203, 238, 0.3);
    color: #e0e7ff;
    backdrop-filter: blur(5px);
}

#toast-container > .toast-info {
    background-color: rgba(42, 84, 133, 0.9);
    border: 1px solid rgba(81, 203, 238, 0.3);
    color: #e0e7ff;
    backdrop-filter: blur(5px);
}

#toast-container > .toast-warning {
    background-color: rgba(217, 119, 6, 0.9);
    border: 1px solid rgba(81, 203, 238, 0.3);
    color: #e0e7ff;
    backdrop-filter: blur(5px);
}

/* ===== TÍTULOS ===== */
h1, h2, h3, h4, h5, h6 {
    color: #FFD166;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.875rem; }

h3::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--neon-blue), transparent);
}

/* ===== ENLACES ===== */
a {
    color: #FF6F61;
    text-decoration: none;
}

a:hover {
    color: #FFD166;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--darker-bg) !important;
    border-top: 1px solid var(--border-color);
    padding: 15px 0;
    color: var(--text-lighter);
    font-size: 0.9rem;
    position: fixed;
    bottom: 0;
    width: 100%;
}

/* ===== TUTORIALES ===== */
.tutorial-item {
    background: rgba(20, 37, 68, 0.7);
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(81, 203, 238, 0.2);
}

.tutorial-item h5 {
    color: #FFD166;
    margin-bottom: 15px;
}

.tutorial-description {
    background: rgba(46, 41, 78, 0.5);
    padding: 15px;
    border-radius: 8px;
    margin-top: 15px;
}

.tutorial-description ul, .tutorial-description ol {
    padding-left: 20px;
}

.tutorial-description li {
    margin-bottom: 8px;
}

.embed-responsive {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

/* ===== PERFIL DE USUARIO ===== */
.profile-card {
    max-width: 600px;
    margin: 0 auto;
}

.profile-card input[readonly] {
    background-color: #f8f9fa;
    cursor: not-allowed;
}

.user-info-box {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    border-left: 4px solid #6c757d;
}

.user-info-item {
    margin-bottom: 10px;
}

.user-info-label {
    font-weight: bold;
    color: #495057;
}

.user-info-value {
    color: #212529;
    padding: 8px;
    background-color: white;
    border-radius: 4px;
    border: 1px solid #dee2e6;
}

/* ===== MENÚ DE USUARIO ===== */
.user-menu-container {
    position: relative;
    display: inline-block;
}

.user-menu {
    display: none;
    position: absolute;
    right: 0;
    background: rgba(20, 37, 68, 0.95);
    border: 1px solid rgba(81, 203, 238, 0.3);
    border-radius: 8px;
    min-width: 180px;
    z-index: 1000;
    box-shadow: 0 8px 16px rgba(0,0,0,0.2);
    backdrop-filter: blur(10px);
}

.user-menu.show {
    display: block;
}

.menu-item {
    display: block;
    padding: 10px 15px;
    color: #e0e7ff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.menu-item:hover {
    background: rgba(81, 203, 238, 0.2);
    color: #51cbee;
}

.menu-divider {
    height: 1px;
    background: rgba(81, 203, 238, 0.2);
    margin: 5px 0;
}

#userDropdownBtn i.fa-caret-down {
    margin-left: 8px;
    transition: transform 0.3s ease;
}

#userDropdownBtn i.fa-caret-down.rotate {
    transform: rotate(180deg);
}

/* ===== CHECKER ===== */
.checker-container .card {
    padding: 20px !important;
}

#card_list {
    background: rgba(10, 20, 40, 0.7) !important;
    border: 1px solid var(--cyber-purple) !important;
    color: white !important;
}

#card_list:focus {
    box-shadow: 0 0 15px var(--cyber-purple) !important;
}

#estatus {
    letter-spacing: 1px;
    font-family: 'Orbitron', sans-serif;
    text-shadow: 0 0 10px var(--neon-blue);
}

/* ===== MEDIA QUERIES ===== */
@media (max-width: 767px) {
    .sidebar.show {
        width: 80%;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .card {
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
    }
    
    .tab-content, .card-body {
        padding: 15px !important;
    }
    
    .api-buttons .d-flex {
        display: none !important;
    }
    
    #mobile-api-select {
        background: rgba(20, 37, 68, 0.7) !important;
        color: #e0e7ff !important;
        border: 1px solid rgba(81, 203, 238, 0.3) !important;
        border-radius: 10px !important;
        padding: 8px 15px !important;
        width: 100% !important;
        margin-bottom: 10px;
    }
}

@media (min-width: 768px) {
    .sidebar {
        left: 0;
    }
    
    .main-content {
        margin-left: 250px;
    }
    
    #sidebarToggle {
        display: none;
    }
    
    #mobile-api-select {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .login-container {
        width: 95%;
        margin: 50px auto !important;
        padding: 1.5rem !important;
    }
}

/* ===== ANIMACIONES ===== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-40px) rotate(10deg); }
}

@keyframes connect {
    0%, 100% { opacity: 0.3; height: 50px; }
    50% { opacity: 0.8; height: 70px; }
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-screen.active {
    display: flex;
}

.loading-icon {
    font-size: 3rem;
    color: #673AB7;
    animation: spin 1s linear infinite;
}

/* ===== VARIOS ===== */
.error-message {
    color: #dc3545;
    font-size: 0.875em;
    margin-top: 0.25rem;
}

#selected-api-display {
    font-size: 12px;
    color: #51cbee;
}

.d-flex.flex-wrap.gap-2 {
    gap: 8px;
}

video {
    background: #000;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

video:focus {
    outline: none;
}
/* Contenedores con scroll */
.scrollable-container {
    max-height: 400px;
    overflow-y: auto;
    margin-bottom: 20px;
    border: 1px solid rgba(81, 203, 238, 0.3);
    border-radius: 8px;
}

.scrollable-container table {
    margin-bottom: 0;
}

.scrollable-container::-webkit-scrollbar {
    width: 8px;
}

.scrollable-container::-webkit-scrollbar-track {
    background: rgba(20, 37, 68, 0.5);
    border-radius: 4px;
}

.scrollable-container::-webkit-scrollbar-thumb {
    background: rgba(81, 203, 238, 0.5);
    border-radius: 4px;
}

.scrollable-container::-webkit-scrollbar-thumb:hover {
    background: rgba(81, 203, 238, 0.7);
}