@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-gradient: radial-gradient(circle at 50% 50%, #0c0d21 0%, #03040b 100%);
    --grid-color: rgba(0, 242, 254, 0.03);
    --panel-bg: rgba(6, 9, 26, 0.65);
    --panel-border: rgba(0, 242, 254, 0.15);
    --accent-primary: #00f2fe; /* Cyber Neon Cyan */
    --accent-secondary: #9d4edd; /* Cyber Purple */
    --accent-gradient: linear-gradient(135deg, #00f2fe 0%, #4facfe 50%, #9d4edd 100%);
    --text-main: #e2e8f0;
    --text-muted: #707e94;
    --text-neon: #00f2fe;
    
    /* Status Colors */
    --success: #390066; /* Base */
    --success-neon: #10b981; /* Neon green */
    --success-bg: rgba(16, 185, 129, 0.08);
    --danger: #4a041c; 
    --danger-neon: #f43f5e; /* Neon red */
    --danger-bg: rgba(244, 63, 94, 0.08);
    
    /* Box Shadows */
    --glow-shadow: 0 0 20px rgba(0, 242, 254, 0.15);
    --glow-shadow-hover: 0 0 30px rgba(0, 242, 254, 0.35);
}

.light-theme {
    --bg-gradient: radial-gradient(circle at 50% 50%, #f4f6fb 0%, #dbe2ef 100%);
    --grid-color: rgba(79, 70, 229, 0.04);
    --panel-bg: rgba(255, 255, 255, 0.8);
    --panel-border: rgba(79, 70, 229, 0.18);
    --accent-primary: #3b82f6; /* Modern Blue */
    --accent-secondary: #8b5cf6; /* Modern Purple */
    --accent-gradient: linear-gradient(135deg, #3b82f6 0%, #6366f1 50%, #8b5cf6 100%);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-neon: #2563eb;
    
    --success-neon: #059669;
    --success-bg: rgba(5, 150, 105, 0.08);
    --danger-neon: #dc2626;
    --danger-bg: rgba(220, 38, 38, 0.08);
    
    --glow-shadow: 0 8px 32px rgba(99, 102, 241, 0.08);
    --glow-shadow-hover: 0 12px 40px rgba(99, 102, 241, 0.18);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.1);
}
::-webkit-scrollbar-thumb {
    background: var(--panel-border);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 1rem;
    overflow-x: hidden;
    position: relative;
}

/* Animated Grid Background */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        linear-gradient(to right, var(--grid-color) 1px, transparent 1px),
        linear-gradient(to bottom, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -2;
    pointer-events: none;
    animation: gridScroll 120s linear infinite;
}

@keyframes gridScroll {
    0% { background-position: 0 0; }
    100% { background-position: 1000px 1000px; }
}

/* Glow Orbs */
.glow-orb {
    position: absolute;
    width: 450px;
    height: 450px;
    border-radius: 50%;
    filter: blur(150px);
    z-index: -1;
    opacity: 0.25;
    pointer-events: none;
    animation: pulse 12s infinite alternate;
}

.glow-orb-1 {
    background: var(--accent-primary);
    top: -50px;
    left: -50px;
}

.glow-orb-2 {
    background: var(--accent-secondary);
    bottom: -100px;
    right: -100px;
    animation-delay: 6s;
}

@keyframes pulse {
    0% { transform: scale(1) translate(0, 0); opacity: 0.2; }
    100% { transform: scale(1.15) translate(30px, 30px); opacity: 0.35; }
}

/* Tech borders and container */
.container {
    width: 100%;
    max-width: 900px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 1.75rem;
    box-shadow: var(--glow-shadow);
    position: relative;
    overflow: hidden;
}

/* Corner brackets (cyber-hud design decoration) */
.container::after, .login-card::after {
    content: '[SYS_ACTIVE]';
    position: absolute;
    bottom: 8px;
    right: 12px;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.65rem;
    color: var(--accent-primary);
    opacity: 0.4;
    letter-spacing: 0.1em;
}

.container::before, .login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gradient);
    opacity: 0.8;
}

/* Title & Header */
h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 40px rgba(0, 242, 254, 0.2);
}

.subtitle {
    color: var(--text-muted);
    font-size: 0.85rem;
    font-family: 'Share Tech Mono', monospace;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

/* Cyber Dashboard Tab Buttons */
.tabs-nav {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 2px;
}

.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.6rem 1.2rem;
    position: relative;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--accent-gradient);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.tab-btn:hover {
    color: var(--text-main);
    text-shadow: 0 0 8px rgba(0, 242, 254, 0.4);
}

.tab-btn.active {
    color: var(--accent-primary);
    font-weight: 600;
}

.tab-btn.active::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Tab Panels Visibility */
.tab-panel {
    display: none;
    animation: panelSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-panel.active {
    display: block;
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr;
    gap: 2.5rem;
    margin-top: 1rem;
}

@media (max-width: 800px) {
    .layout-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

/* Custom Cyberpunk Inputs & Textareas */
label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

label::before {
    content: '>';
    color: var(--accent-primary);
    font-weight: bold;
}

input, textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.45) !important;
    border: 1px solid rgba(0, 242, 254, 0.15) !important;
    border-radius: 8px;
    padding: 0.6rem 0.85rem;
    color: var(--text-main) !important;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    transition: all 0.3s ease;
}

.light-theme input, .light-theme textarea {
    background: rgba(255, 255, 255, 0.9) !important;
    border-color: rgba(79, 70, 229, 0.2) !important;
    color: var(--text-main) !important;
}

input:focus, textarea:focus {
    outline: none;
    border-color: var(--accent-primary) !important;
    box-shadow: 0 0 15px rgba(0, 242, 254, 0.15);
}

/* Result Card Box (HUD styling) */
.result-card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--panel-border);
    border-radius: 12px;
    padding: 1.5rem;
    position: relative;
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.4);
}

.light-theme .result-card {
    background: rgba(255, 255, 255, 0.5);
    box-shadow: none;
}

.result-label {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    color: var(--accent-primary);
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Premium Tables */
table {
    width: 100%;
    border-collapse: collapse;
}

th {
    font-family: 'Share Tech Mono', monospace;
    color: var(--text-muted);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(0, 242, 254, 0.1) !important;
    padding: 0.6rem 0.25rem !important;
}

td {
    padding: 0.45rem 0.25rem !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
}

.light-theme td {
    border-bottom-color: rgba(0, 0, 0, 0.03) !important;
}

/* Monospace font specifically for card data rows */
#results-table td, #bulk-bin-results-table td {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
}

tr:hover td {
    background: rgba(0, 242, 254, 0.02);
}

/* Cyber Buttons styling */
.primary-btn {
    background: var(--accent-gradient);
    border: none;
    border-radius: 8px;
    padding: 0.75rem;
    color: #03040b;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(0, 242, 254, 0.25);
    position: relative;
    overflow: hidden;
}

.primary-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 25px rgba(0, 242, 254, 0.45);
    filter: brightness(1.08);
}

.primary-btn:active {
    transform: translateY(1px);
}

.secondary-btn {
    background: rgba(0, 242, 254, 0.05);
    border: 1px solid rgba(0, 242, 254, 0.25);
    border-radius: 6px;
    color: var(--text-main);
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    letter-spacing: 0.05em;
    font-weight: 600;
    text-transform: uppercase;
    cursor: pointer;
    padding: 0.6rem 0.8rem;
}

.secondary-btn:hover {
    background: rgba(0, 242, 254, 0.15);
    border-color: var(--accent-primary);
    box-shadow: 0 0 10px rgba(0, 242, 254, 0.2);
}

/* Luhn steps table design */
.luhn-steps-table {
    border: 1px solid rgba(0, 242, 254, 0.1);
    margin-top: 1rem;
}

.luhn-steps-table th, .luhn-steps-table td {
    border: 1px solid rgba(0, 242, 254, 0.1) !important;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.75rem;
}

.luhn-doubled {
    color: var(--accent-secondary) !important;
    text-shadow: 0 0 8px rgba(157, 78, 221, 0.3);
    font-weight: bold;
}

.luhn-sum-formula {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(0, 242, 254, 0.1);
    border-radius: 6px;
    padding: 0.75rem;
    margin-top: 0.85rem;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.78rem;
}

.light-theme .luhn-sum-formula {
    background: rgba(0, 0, 0, 0.02);
}

/* Badges styling */
.badge-info {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.7rem;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 600;
}

.badge-info.credit {
    background: rgba(157, 78, 221, 0.1) !important;
    color: #b582eb !important;
    border: 1px solid rgba(157, 78, 221, 0.3) !important;
}

.badge-info.debit {
    background: rgba(0, 242, 254, 0.08) !important;
    color: var(--accent-primary) !important;
    border: 1px solid rgba(0, 242, 254, 0.25) !important;
}

/* Login panel screen */
.login-card {
    width: 100%;
    max-width: 410px;
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);
    background: var(--panel-bg);
    border: 1px solid var(--panel-border);
    border-radius: 20px;
    padding: 3rem 2.5rem;
    box-shadow: var(--glow-shadow);
    position: relative;
    animation: panelSlideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.login-card h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    text-align: center;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Specific detail alignments */
.bin-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 0.6rem 0;
}

.bin-detail-key {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.78rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.bin-detail-val {
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.9rem;
    font-weight: bold;
}

/* Card Brand Logo styling */
.brand-logo-container {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-weight: 500;
    font-family: 'Share Tech Mono', monospace;
    font-size: 0.8rem;
    vertical-align: middle;
}

.brand-logo-container svg {
    width: 26px;
    height: 16px;
    border-radius: 2px;
    display: block;
}

/* Mobile Screen overrides */
@media (max-width: 580px) {
    body {
        display: block !important;
        padding: 0 !important;
        margin: 0 !important;
        width: 100% !important;
        overflow-x: hidden !important;
    }

    .container {
        border-radius: 0 !important;
        border: none !important;
        min-height: 100vh !important;
        padding: 1rem 0.5rem !important;
        margin: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        box-shadow: none !important;
        background: rgba(6, 9, 26, 0.99) !important;
        overflow-x: hidden !important;
    }
    
    .login-card {
        border-radius: 12px !important;
        width: calc(100% - 20px) !important;
        margin: 10px auto !important;
        padding: 1.5rem 1rem !important;
    }
    
    .light-theme .container {
        background: #f4f6fb !important;
    }
    
    .light-theme .login-card {
        background: #ffffff !important;
    }

    /* Prevent header text and icon from overflowing right */
    .app-header h1 {
        font-size: 1.3rem !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: calc(100vw - 80px);
    }
    
    /* Make tab navigation horizontally scrollable without breaking page width */
    .tabs-nav {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        width: 100% !important;
        gap: 0.35rem !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-bottom: 1px solid rgba(255,255,255,0.05);
    }
    
    .tabs-nav::-webkit-scrollbar {
        display: none;
    }
    
    .tab-btn {
        flex: 0 0 auto !important;
        padding: 0.4rem 0.6rem !important;
        font-size: 0.72rem !important;
    }
    
    /* Make result card scrollable horizontally for tables */
    .result-card {
        padding: 0.6rem 0.3rem !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    
    /* Calculator Table: Fit 100% width on screen without horizontal scroll */
    #results-table {
        font-size: 0.68rem !important;
        min-width: 100% !important;
        width: 100% !important;
        table-layout: fixed;
    }
    
    #results-table th:nth-child(1), #results-table td:nth-child(1) { width: 44%; } /* PAN */
    #results-table th:nth-child(2), #results-table td:nth-child(2) { width: 18%; } /* Fecha */
    #results-table th:nth-child(3), #results-table td:nth-child(3) { width: 16%; } /* Luhn */
    #results-table th:nth-child(4), #results-table td:nth-child(4) { width: 10%; } /* Marca logo */
    #results-table th:nth-child(5), #results-table td:nth-child(5) { width: 12%; text-align: right; } /* CVV */
    
    /* Bulk BIN Table: Needs minor scroll since it has 6 columns */
    #bulk-bin-results-table {
        font-size: 0.68rem !important;
        min-width: 440px !important;
    }
    
    #results-table th, #results-table td,
    #bulk-bin-results-table th, #bulk-bin-results-table td {
        padding: 0.35rem 0.1rem !important;
    }
    
    /* Hide card brand text label on mobile, showing ONLY the brand SVG logo icon */
    .brand-logo-container span {
        display: none !important;
    }
    
    .brand-logo-container {
        justify-content: center;
        width: 100%;
    }
    
    /* Optimize PAN column font size and spacing on mobile */
    #results-table td:first-child {
        font-size: 0.65rem !important;
        letter-spacing: -0.04em;
        word-break: break-all;
    }
    
    /* Truncate Bank name on mobile to save space */
    #bulk-bin-results-table td:nth-child(3) {
        max-width: 80px !important;
        text-overflow: ellipsis;
        overflow: hidden;
        white-space: nowrap;
    }
    
    .secondary-btn {
        font-size: 0.68rem !important;
        padding: 0.4rem 0.25rem !important;
        min-width: 50px !important;
    }
}
