/* ====================================
   CVV Calculator Pro - Styles
   Premium dark UI with glassmorphism
   ==================================== */

/* --- CSS Variables --- */
:root {
    --bg-primary: #0a0e1a;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.7);
    --bg-card-hover: rgba(30, 41, 59, 0.8);

    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;

    --accent-blue: #3b82f6;
    --accent-cyan: #06b6d4;
    --accent-purple: #8b5cf6;
    --accent-green: #10b981;
    --accent-red: #ef4444;
    --accent-yellow: #f59e0b;
    --accent-orange: #f97316;

    --gradient-main: linear-gradient(135deg, #3b82f6, #8b5cf6);
    --gradient-card: linear-gradient(135deg, rgba(59,130,246,0.08), rgba(139,92,246,0.05));
    --gradient-success: linear-gradient(135deg, #10b981, #06b6d4);
    --gradient-danger: linear-gradient(135deg, #ef4444, #f97316);

    --border-color: rgba(148, 163, 184, 0.1);
    --border-glow: rgba(59, 130, 246, 0.3);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3), 0 0 0 1px var(--border-color);
    --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.15);

    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* --- Animated Background --- */
.bg-particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0.06;
    animation: float 20s infinite ease-in-out;
}

.particle:nth-child(1) {
    width: 400px; height: 400px;
    background: var(--accent-blue);
    top: -100px; left: -100px;
    animation-duration: 25s;
}
.particle:nth-child(2) {
    width: 300px; height: 300px;
    background: var(--accent-purple);
    top: 50%; right: -80px;
    animation-duration: 20s;
    animation-delay: -5s;
}
.particle:nth-child(3) {
    width: 250px; height: 250px;
    background: var(--accent-cyan);
    bottom: -50px; left: 30%;
    animation-duration: 22s;
    animation-delay: -10s;
}
.particle:nth-child(4) {
    width: 200px; height: 200px;
    background: var(--accent-green);
    top: 30%; left: 60%;
    animation-duration: 18s;
    animation-delay: -3s;
}
.particle:nth-child(5) {
    width: 350px; height: 350px;
    background: var(--accent-purple);
    bottom: 20%; right: 20%;
    animation-duration: 28s;
    animation-delay: -8s;
}
.particle:nth-child(6) {
    width: 180px; height: 180px;
    background: var(--accent-blue);
    top: 60%; left: 10%;
    animation-duration: 15s;
    animation-delay: -12s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(30px, -40px) scale(1.1); }
    50% { transform: translate(-20px, 20px) scale(0.95); }
    75% { transform: translate(40px, 30px) scale(1.05); }
}

/* --- Glass Card --- */
.glass-card {
    background: var(--gradient-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    transition: var(--transition);
}

.glass-card:hover {
    border-color: var(--border-glow);
    box-shadow: var(--shadow-card), var(--shadow-glow);
}

/* --- Header --- */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(10, 14, 26, 0.85);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    padding: 14px 0;
}

.header-content {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-main);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.logo h1 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: var(--gradient-main);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.1em;
    background: var(--gradient-main);
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: 8px;
    vertical-align: middle;
}

.header-stats {
    display: flex;
    gap: 8px;
}

.stat-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.stat-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse-dot 2s infinite;
}

.dot-blue { background: var(--accent-blue); }
.dot-green { background: var(--accent-green); }
.dot-red { background: var(--accent-red); }

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

/* --- Main Container --- */
.main-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 24px;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* --- Config Panel --- */
.config-panel {
    padding: 20px 24px;
}

.config-grid {
    display: flex;
    gap: 16px;
    align-items: end;
}

.config-item {
    flex: 1;
}

.config-item.config-small {
    flex: 0 0 160px;
}

.config-item label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.config-item input {
    width: 100%;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.88rem;
    transition: var(--transition);
    outline: none;
}

.config-item input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* --- Input Section --- */
.input-section {
    padding: 24px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}

.section-header h2 {
    font-size: 1.15rem;
    font-weight: 700;
}

.format-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.format-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    background: rgba(255,255,255,0.04);
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

/* --- Textarea --- */
.textarea-wrapper {
    position: relative;
    margin-bottom: 16px;
}

#cardInput {
    width: 100%;
    min-height: 200px;
    max-height: 400px;
    padding: 16px;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    line-height: 1.7;
    resize: vertical;
    outline: none;
    transition: var(--transition);
}

#cardInput::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

#cardInput:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.textarea-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.line-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.textarea-actions {
    display: flex;
    gap: 4px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background: rgba(255,255,255,0.08);
    color: var(--text-primary);
    border-color: var(--border-glow);
}

/* --- Buttons --- */
.action-buttons {
    display: flex;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-main);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: var(--gradient-main);
    color: white;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.4);
}

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

.btn-large {
    padding: 14px 32px;
    font-size: 0.95rem;
}

.btn-secondary {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

.btn-secondary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary:disabled:hover {
    background: rgba(255,255,255,0.06);
    color: var(--text-secondary);
}

.btn-secondary:disabled::before {
    display: none;
}

/* --- Loading State --- */
.btn.loading {
    pointer-events: none;
}

.btn.loading span {
    opacity: 0;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* --- Progress Bar --- */
.progress-container {
    padding: 0;
    position: relative;
    z-index: 1;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.06);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--gradient-main);
    border-radius: 10px;
    transition: width 0.4s ease;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.progress-text {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

/* --- Results Section --- */
.results-section {
    padding: 24px;
    animation: slideUp 0.4s ease;
}

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

.result-stats {
    display: flex;
    gap: 12px;
}

.result-stat {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 20px;
}

.result-stat.stat-success {
    background: rgba(16, 185, 129, 0.12);
    color: var(--accent-green);
}

.result-stat.stat-fail {
    background: rgba(239, 68, 68, 0.12);
    color: var(--accent-red);
}

.result-stat.stat-total {
    background: rgba(59, 130, 246, 0.12);
    color: var(--accent-blue);
}

/* --- Filter Bar --- */
.filter-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 16px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-md);
    width: fit-content;
}

.filter-btn {
    padding: 7px 16px;
    background: transparent;
    border: none;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-family: var(--font-main);
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.filter-btn:hover {
    color: var(--text-secondary);
    background: rgba(255,255,255,0.04);
}

.filter-btn.active {
    color: white;
    background: var(--gradient-main);
    box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

/* --- Results Table --- */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.results-table thead {
    background: rgba(0, 0, 0, 0.3);
}

.results-table th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.results-table td {
    padding: 11px 16px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.05);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    white-space: nowrap;
}

.results-table tbody tr {
    transition: var(--transition);
}

.results-table tbody tr:hover {
    background: rgba(59, 130, 246, 0.04);
}

.results-table tbody tr:last-child td {
    border-bottom: none;
}

/* Row status colors */
.results-table tbody tr.row-match {
    background: rgba(16, 185, 129, 0.04);
}

.results-table tbody tr.row-nomatch {
    background: rgba(239, 68, 68, 0.03);
}

.results-table tbody tr.row-error {
    background: rgba(245, 158, 11, 0.04);
    opacity: 0.7;
}

/* Cell styling */
.cell-brand {
    font-family: var(--font-main) !important;
    font-weight: 700;
    font-size: 0.75rem !important;
    letter-spacing: 0.03em;
}

.brand-visa { color: #1a73e8; }
.brand-mastercard { color: #f79e1b; }
.brand-amex { color: #2e77bb; }
.brand-discover { color: #ff6000; }
.brand-unknown { color: var(--text-muted); }

.cell-pan {
    color: var(--text-secondary);
}

.cell-cvv {
    font-weight: 600;
}

.cell-status {
    font-family: var(--font-main) !important;
}

.status-match {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-green);
    font-weight: 700;
    font-size: 0.78rem;
}

.status-nomatch {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--accent-red);
    font-weight: 700;
    font-size: 0.78rem;
}

.status-error {
    color: var(--accent-yellow);
    font-weight: 600;
    font-size: 0.78rem;
}

/* Hide filtered rows */
.results-table tbody tr.filtered-out {
    display: none;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 10px;
    }

    .config-grid {
        flex-direction: column;
    }

    .config-item.config-small {
        flex: 1;
    }

    .section-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .action-buttons {
        flex-direction: column;
    }

    .btn-large {
        width: 100%;
        justify-content: center;
    }

    .filter-bar {
        width: 100%;
        overflow-x: auto;
    }

    .result-stats {
        flex-wrap: wrap;
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.2);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.3);
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    font-weight: 500;
    color: white;
    animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    max-width: 340px;
}

.toast-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.toast-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

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

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

/* --- Generator Section --- */
.generator-section {
    padding: 20px 24px;
}

.gen-grid {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.gen-item {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 100px;
}

.gen-item.gen-bin {
    flex: 1;
    min-width: 160px;
}

.gen-item.gen-action {
    min-width: auto;
}

.gen-item label {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gen-item input,
.gen-item select {
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    outline: none;
    transition: var(--transition);
    height: 40px;
}

.gen-item input:focus,
.gen-item select:focus {
    border-color: var(--accent-yellow);
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.gen-item select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 28px;
}

.gen-item select option {
    background: #111827;
    color: var(--text-primary);
}

.btn-generate {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    height: 40px;
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    border: none;
    border-radius: var(--radius-sm);
    color: white;
    font-family: var(--font-main);
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(245, 158, 11, 0.3);
    white-space: nowrap;
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(245, 158, 11, 0.4);
}

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

.btn-generate.loading {
    pointer-events: none;
    opacity: 0.7;
}

@media (max-width: 768px) {
    .gen-grid {
        flex-direction: column;
    }

    .gen-item {
        width: 100%;
    }

    .btn-generate {
        width: 100%;
        justify-content: center;
    }
}
