/* ===== CSS Variables & Theme ===== */
:root {
    /* Dark Theme (Default) */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: rgba(18, 18, 26, 0.8);
    --bg-input: rgba(255, 255, 255, 0.05);
    --bg-input-hover: rgba(255, 255, 255, 0.08);
    
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    --accent-primary: #00d4ff;
    --accent-secondary: #7c3aed;
    --accent-gradient: linear-gradient(135deg, #00d4ff 0%, #7c3aed 100%);
    
    --border-color: rgba(255, 255, 255, 0.1);
    --border-glow: rgba(0, 212, 255, 0.3);
    
    --success: #10b981;
    --error: #ef4444;
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.5);
    --shadow-glow: 0 0 40px rgba(0, 212, 255, 0.15);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition-fast: 0.15s ease;
    --transition-base: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Space Grotesk', var(--font-sans);
}

/* Light Theme */
[data-theme="light"] {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(0, 0, 0, 0.03);
    --bg-input-hover: rgba(0, 0, 0, 0.06);
    
    --text-primary: #0f172a;
    --text-secondary: rgba(15, 23, 42, 0.7);
    --text-muted: rgba(15, 23, 42, 0.4);
    
    --accent-primary: #0ea5e9;
    --accent-secondary: #7c3aed;
    
    --border-color: rgba(0, 0, 0, 0.1);
    --border-glow: rgba(14, 165, 233, 0.3);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 16px 64px rgba(0, 0, 0, 0.15);
    --shadow-glow: 0 0 40px rgba(14, 165, 233, 0.1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

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

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

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s infinite ease-in-out;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--accent-primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -14s;
}

[data-theme="light"] .glow-orb {
    opacity: 0.2;
}

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

/* ===== Theme Toggle ===== */
.theme-toggle {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 100;
    width: 48px;
    height: 48px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-glow);
    transform: scale(1.05);
}

.theme-toggle .sun-icon {
    display: none;
}

.theme-toggle .moon-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
    display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
    display: none;
}

/* ===== Main Container ===== */
.container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    min-height: 100vh;
}

/* ===== Header ===== */
.header {
    text-align: center;
    margin-bottom: 2rem;
    padding-top: 2rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.logo-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-family: var(--font-display);
    font-size: 1.75rem;
    font-weight: 700;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* ===== Content Grid ===== */
.content-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
}

/* ===== Card Component ===== */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-base);
}

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

.card-header {
    margin-bottom: 1.5rem;
}

.card-header h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.card-subtitle {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Form Styles ===== */
.form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-wrapper svg {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    pointer-events: none;
    transition: color var(--transition-fast);
}

.input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    font-family: inherit;
    transition: all var(--transition-fast);
    outline: none;
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.input-wrapper input:hover {
    background: var(--bg-input-hover);
}

.input-wrapper input:focus {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 212, 255, 0.15);
}

.input-wrapper input:focus + svg,
.input-wrapper:focus-within svg {
    color: var(--accent-primary);
}

.social-input svg {
    color: var(--text-secondary);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 480px) {
    .form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== Section Divider ===== */
.section-divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 0.5rem 0;
}

.section-divider::before,
.section-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

.section-divider span {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

/* ===== Buttons ===== */
.form-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 0.5rem;
}

@media (min-width: 480px) {
    .form-actions {
        flex-direction: row;
    }
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border-radius: var(--radius-md);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    border: none;
    outline: none;
    flex: 1;
}

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

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

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md), var(--shadow-glow);
}

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

.btn-secondary {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-input-hover);
    border-color: var(--accent-primary);
}

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    width: 100%;
    margin-top: 1rem;
}

.btn-outline:hover:not(:disabled) {
    background: var(--bg-input);
    border-color: var(--accent-primary);
}

/* ===== Preview Section ===== */
.preview-section {
    display: flex;
    flex-direction: column;
}

/* ===== Business Card Preview ===== */
.business-card {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 1.5rem;
    aspect-ratio: 1.6;
    perspective: 1000px;
}

.business-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    background: linear-gradient(145deg, var(--bg-secondary) 0%, var(--bg-primary) 100%);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all var(--transition-base);
}

.business-card:hover .business-card-inner {
    transform: rotateY(-5deg) rotateX(5deg);
    border-color: var(--border-glow);
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.card-glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-gradient);
}

.card-content {
    padding: 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.card-avatar {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--accent-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.75rem;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.25rem;
    color: white;
    box-shadow: var(--shadow-sm);
}

.card-name {
    font-family: var(--font-display);
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 0.125rem;
}

.card-title {
    font-size: 0.8125rem;
    color: var(--accent-primary);
    font-weight: 500;
    margin-bottom: 0.125rem;
}

.card-company {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.card-contact {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    width: 100%;
    margin-bottom: auto;
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.6875rem;
    color: var(--text-secondary);
}

.contact-item svg {
    color: var(--text-muted);
    flex-shrink: 0;
}

.card-socials {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    margin-top: auto;
    padding-top: 0.5rem;
}

.social-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-icon:hover {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

/* ===== QR Code Section ===== */
.qr-section {
    text-align: center;
}

.qr-header {
    margin-bottom: 1rem;
}

.qr-header h3 {
    font-family: var(--font-display);
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.qr-header p {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.qr-container {
    width: 160px;
    height: 160px;
    margin: 0 auto;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.qr-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
}

.qr-placeholder span {
    font-size: 0.75rem;
    max-width: 120px;
}

.qr-code {
    display: none;
}

.qr-code.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-code canvas {
    border-radius: 4px;
}

/* ===== Footer ===== */
.footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* ===== Toast Notification ===== */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    visibility: visible;
}

.toast-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-lg);
}

.toast-icon {
    flex-shrink: 0;
}

.toast-icon.success {
    color: var(--success);
}

.toast-icon.error {
    color: var(--error);
    display: none;
}

.toast.error .toast-icon.success {
    display: none;
}

.toast.error .toast-icon.error {
    display: block;
}

.toast-message {
    font-size: 0.9375rem;
    font-weight: 500;
}

/* ===== Responsive Adjustments ===== */
@media (min-width: 768px) {
    .container {
        padding: 3rem 2rem;
    }
    
    .header {
        margin-bottom: 3rem;
    }
    
    .logo-icon {
        width: 56px;
        height: 56px;
    }
    
    .logo-text {
        font-size: 2rem;
    }
    
    .tagline {
        font-size: 1.125rem;
    }
    
    .card {
        padding: 2rem;
    }
    
    .card-header h2 {
        font-size: 1.5rem;
    }
    
    .business-card {
        max-width: 400px;
    }
    
    .card-content {
        padding: 1.5rem;
    }
    
    .card-avatar {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }
    
    .card-name {
        font-size: 1.25rem;
    }
    
    .qr-container {
        width: 180px;
        height: 180px;
    }
}

@media (min-width: 1024px) {
    .container {
        padding: 4rem 2rem;
    }
}

/* ===== Utility Classes ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== Loading Animation ===== */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 2s ease-in-out infinite;
}
