/* ========================================
   PREMIUM DARK PURPLE MINIMALIST DESIGN
   Professional UI/UX - No Coding Vibes
   ======================================== */

/* CSS Variables - Dark Purple Theme */
:root {
    /* Primary Colors */
    --dark-bg: #0a0a0f;
    --darker-bg: #05050a;
    --card-bg: rgba(15, 15, 30, 0.6);
    --card-border: rgba(139, 92, 246, 0.15);
    
    /* Purple Palette */
    --purple-primary: #8b5cf6;
    --purple-light: #a78bfa;
    --purple-lighter: #c4b5fd;
    --purple-glow: rgba(139, 92, 246, 0.25);
    
    /* Text Colors */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* Accents */
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    
    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
    
    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-purple: 0 8px 32px rgba(139, 92, 246, 0.2);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 20% 30%, rgba(139, 92, 246, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(167, 139, 250, 0.12) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(196, 181, 253, 0.08) 0%, transparent 60%);
    animation: backgroundMove 15s ease-in-out infinite;
}

body::after {
    content: '';
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    z-index: 0;
    pointer-events: none;
    background: 
        radial-gradient(circle at 30% 40%, rgba(139, 92, 246, 0.1) 0%, transparent 40%),
        radial-gradient(circle at 70% 60%, rgba(167, 139, 250, 0.08) 0%, transparent 40%);
    animation: rotate 30s linear infinite;
}

@keyframes backgroundMove {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 1; }
    25% { transform: translate(5%, -5%) scale(1.1); opacity: 0.8; }
    50% { transform: translate(-5%, 5%) scale(0.95); opacity: 1; }
    75% { transform: translate(3%, 3%) scale(1.05); opacity: 0.9; }
}

@keyframes rotate {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   TOP HEADER - Premium Design
   ======================================== */
.top-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    background: linear-gradient(180deg, rgba(10, 10, 18, 0.95) 0%, rgba(10, 10, 15, 0.9) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(139, 92, 246, 0.08);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.875rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.header-logo:hover {
    color: var(--purple-light);
}

.header-logo svg {
    width: 26px;
    height: 26px;
    stroke: var(--purple-primary);
    transition: all 0.3s ease;
}

.header-logo:hover svg {
    stroke: var(--purple-light);
    filter: drop-shadow(0 0 8px rgba(139, 92, 246, 0.5));
}

.header-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.nav-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(139, 92, 246, 0.08);
}

.nav-link.active {
    color: var(--purple-light);
    background: rgba(139, 92, 246, 0.12);
}

.nav-link.active::after {
    display: none;
}

/* Main Container - Centered Layout */
.main-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px var(--spacing-lg) var(--spacing-lg);
}

/* Content Card - Glassmorphism */
.content-card {
    width: 100%;
    max-width: 680px;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg), var(--shadow-purple);
    animation: slideUp 0.6s ease-out;
}

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

/* Header Section */
.header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
    padding-bottom: var(--spacing-lg);
    border-bottom: none;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.logo-icon {
    width: 32px;
    height: 32px;
    stroke: var(--purple-primary);
    animation: pulse 3s ease-in-out infinite;
}

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

.header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
    margin: 0;
}

.subtitle {
    font-size: 0.95rem;
    color: var(--text-secondary);
    font-weight: 400;
    margin: 0;
}

/* Search Section */
.search-section {
    margin-bottom: var(--spacing-xl);
}

.search-section form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

/* Input Group */
.input-group {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: var(--spacing-md);
    width: 20px;
    height: 20px;
    stroke: var(--text-muted);
    transition: stroke 0.3s ease;
    pointer-events: none;
}

.input-group input {
    width: 100%;
    height: 60px;
    padding: 0 3.5rem;
    background: rgba(15, 15, 30, 0.5);
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-primary);
    transition: all 0.3s ease;
    outline: none;
}

.input-group input::placeholder {
    color: var(--text-muted);
    font-weight: 300;
}

.input-group input:focus {
    background: rgba(15, 15, 30, 0.7);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15), var(--shadow-md);
}

.input-group input:focus + .input-icon,
.input-group:hover .input-icon {
    stroke: var(--purple-light);
}

/* Clear Button */
.clear-btn {
    position: absolute;
    right: var(--spacing-md);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 92, 246, 0.15);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
}

.clear-btn svg {
    width: 14px;
    height: 14px;
    stroke: var(--text-secondary);
    transition: stroke 0.2s ease;
}

.clear-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    transform: rotate(90deg);
}

.clear-btn:hover svg {
    stroke: var(--text-primary);
}

/* Primary Button */
.btn-primary {
    width: 100%;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    background: var(--purple-primary);
    border: none;
    border-radius: var(--radius-md);
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.3);
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(139, 92, 246, 0.4);
}

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

.btn-primary .btn-arrow {
    width: 20px;
    height: 20px;
    stroke: white;
    transition: transform 0.3s ease;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Quick Try Section */
.quick-try {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
    padding-top: var(--spacing-sm);
}

.quick-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    font-weight: 500;
}

.example-pills {
    display: flex;
    gap: var(--spacing-xs);
    flex-wrap: wrap;
}

.pill {
    padding: 0.4rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: none;
    border-radius: 999px;
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--purple-lighter);
    cursor: pointer;
    transition: all 0.2s ease;
}

.pill:hover {
    background: rgba(139, 92, 246, 0.25);
    color: var(--text-primary);
    transform: translateY(-1px);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    animation: fadeIn 0.5s ease-out;
}

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

.empty-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto var(--spacing-md);
    stroke: var(--purple-primary);
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.empty-state p {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 400;
    max-width: 400px;
    margin: 0 auto;
}

/* Result Container */
#result {
    animation: slideIn 0.4s ease-out;
}

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

/* Result States */
.result-loading,
.result-success,
.result-error {
    background: rgba(15, 15, 30, 0.4);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.result-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xl);
}

/* Result Title/Header */
.result-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.result-card {
    background: rgba(15, 15, 30, 0.4);
    border: none;
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-md);
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: none;
}

.result-header .result-title h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.copy-btn {
    padding: 0.5rem 1rem;
    background: rgba(139, 92, 246, 0.15);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--purple-lighter);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-btn:hover {
    background: rgba(139, 92, 246, 0.25);
    color: var(--text-primary);
}

.copy-btn.copied {
    background: rgba(16, 185, 129, 0.25);
    color: var(--success);
}

/* Result Grid */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-md);
}

.result-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.result-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.result-value {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-value a {
    color: var(--purple-light);
    text-decoration: none;
    transition: color 0.2s ease;
}

.result-value a:hover {
    color: var(--purple-lighter);
    text-decoration: underline;
}

/* Badge Styles for Card Types */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.badge-credit {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: none;
}

.badge-debit {
    background: rgba(139, 92, 246, 0.2);
    color: var(--purple-lighter);
    border: none;
}

.badge-prepaid {
    background: rgba(245, 158, 11, 0.2);
    color: var(--warning);
    border: none;
}

/* Query Time Display */
.query-time {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: none;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* Recent Searches Section */
.recent-section {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: none;
    animation: fadeIn 0.5s ease-out;
}

.section-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.recent-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.recent-item {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: rgba(15, 15, 30, 0.3);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
}

.recent-item:hover {
    background: rgba(139, 92, 246, 0.15);
    transform: translateX(4px);
}

.recent-bin {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    min-width: 100px;
}

.recent-info {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.recent-brand,
.recent-type {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.recent-type::before {
    content: '•';
    margin-right: 0.5rem;
    color: var(--text-muted);
}

.recent-country {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.recent-time {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Stats Footer */
.stats-footer {
    display: flex;
    justify-content: space-around;
    align-items: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: none;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    text-align: center;
}

.stat svg {
    width: 24px;
    height: 24px;
    stroke: var(--purple-light);
    opacity: 0.7;
}

.stat span {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Loading Spinner */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(139, 92, 246, 0.2);
    border-top-color: var(--purple-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: var(--spacing-lg);
    right: var(--spacing-lg);
    background: rgba(15, 15, 30, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: none;
    border-radius: var(--radius-md);
    padding: var(--spacing-md) var(--spacing-lg);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    z-index: 1000;
    animation: toastSlideIn 0.3s ease-out;
    max-width: 400px;
}

@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.toast-success {
    box-shadow: inset 3px 0 0 var(--success), var(--shadow-lg);
}

.toast.toast-error {
    box-shadow: inset 3px 0 0 var(--error), var(--shadow-lg);
}

.toast.toast-info {
    box-shadow: inset 3px 0 0 var(--purple-primary), var(--shadow-lg);
}

.toast-message {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

.toast-show {
    animation: toastSlideIn 0.3s ease-out forwards;
}

/* ========================================
   ADS LAYOUT SYSTEM
   ======================================== */

/* Page wrapper - spacing from fixed header */
.page-wrapper {
    padding-top: 100px;
    min-height: 100vh;
}

/* Top Ads Container - centered above main content */
.ads-top-container {
    max-width: 600px;
    margin: 0 auto 20px;
    padding: 0 16px;
}

/* Main Layout with Sidebars - flex for symmetric alignment */
.main-layout {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 24px;
    padding: 0 16px 60px;
    max-width: 1100px;
    margin: 0 auto;
}

/* Sidebar Styles - fixed width for symmetry */
.sidebar-left,
.sidebar-right {
    width: 180px;
    flex-shrink: 0;
}

/* Hide sidebars by default on smaller screens */
.sidebar-left {
    display: none;
}

.sidebar-right {
    display: none;
}

.sidebar-sticky {
    position: relative;
}

/* Main container - override default styles inside main-layout */
.main-layout .main-container {
    width: 100%;
    max-width: 550px;
    flex-shrink: 0;
    min-height: auto;
    padding: 0;
    display: block;
}

/* Show BOTH sidebars together on large screens for symmetry */
@media (min-width: 1100px) {
    .sidebar-left,
    .sidebar-right {
        display: block;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    :root {
        --spacing-lg: 1.5rem;
        --spacing-xl: 2rem;
    }
    
    .header-container {
        padding: 0.625rem 1rem;
    }
    
    .header-logo {
        font-size: 1rem;
    }
    
    .header-logo svg {
        width: 22px;
        height: 22px;
    }
    
    .header-nav {
        gap: 0.25rem;
    }
    
    .nav-link {
        font-size: 0.8rem;
        padding: 0.4rem 0.6rem;
    }
    
    .main-container {
        padding: 100px var(--spacing-md) var(--spacing-md);
    }
    
    .content-card {
        padding: var(--spacing-lg);
    }
    
    .header h1 {
        font-size: 1.75rem;
    }
    
    .input-group input {
        height: 56px;
        font-size: 0.95rem;
    }
    
    .btn-primary {
        height: 52px;
    }
    
    .result-grid {
        grid-template-columns: 1fr;
    }
    
    .recent-item {
        grid-template-columns: 1fr;
        gap: var(--spacing-xs);
    }
    
    .recent-info {
        order: 2;
    }
    
    .recent-country {
        order: 3;
    }
    
    .recent-time {
        order: 4;
    }
    
    .stats-footer {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .stat {
        flex-direction: row;
        gap: var(--spacing-sm);
    }
    
    .toast {
        right: var(--spacing-sm);
        left: var(--spacing-sm);
        bottom: var(--spacing-sm);
    }
}

@media (max-width: 480px) {
    .header-container {
        padding: 0.5rem 0.75rem;
    }
    
    .header-logo span {
        display: none;
    }
    
    .header-nav {
        gap: 0.125rem;
    }
    
    .nav-link {
        font-size: 0.75rem;
        padding: 0.375rem 0.5rem;
    }
    
    .nav-link.active::after {
        display: none;
    }
    
    .header h1 {
        font-size: 1.5rem;
    }
    
    .subtitle {
        font-size: 0.85rem;
    }
    
    .logo-icon {
        width: 28px;
        height: 28px;
    }
    
    .quick-try {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    body::before,
    body::after {
        display: none;
    }
    
    .content-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .btn-primary,
    .search-section,
    .stats-footer {
        display: none;
    }
}
