/* ============================================================
   UPI QR Code Generator - Premium Fintech Styles
   ============================================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --accent: #22d3ee;
    --success: #10b981;
    --gradient-start: #4f46e5;
    --gradient-end: #06b6d4;
    --card-bg: #ffffff;
    --body-bg: #f8fafc;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 10px 40px -10px rgba(79, 70, 229, 0.15);
    --radius: 16px;
}

[data-bs-theme="dark"] {
    --card-bg: #1e293b;
    --body-bg: #0f172a;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border: #334155;
    --shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--body-bg);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background 0.3s ease, color 0.3s ease;
}

h1, h2, h3, h4, h5, h6, .navbar-brand {
    font-family: 'Poppins', sans-serif;
}

/* Navbar */
.navbar {
    background: linear-gradient(135deg, var(--gradient-start), #7c3aed) !important;
    padding: 0.9rem 0;
}

.navbar-brand {
    letter-spacing: -0.02em;
}

.nav-link {
    font-weight: 500;
    transition: opacity 0.2s;
}

.nav-link:hover {
    opacity: 0.85;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);
    color: #fff;
    padding: 4.5rem 0 5rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.6;
}

.hero .container {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-weight: 700;
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    letter-spacing: -0.03em;
    line-height: 1.2;
}

.hero p.lead {
    font-size: 1.15rem;
    opacity: 0.92;
    max-width: 560px;
}

/* Generator Card */
.generator-section {
    margin-top: -3.5rem;
    position: relative;
    z-index: 10;
    padding-bottom: 4rem;
}

.generator-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.generator-card:hover {
    box-shadow: 0 20px 50px -12px rgba(79, 70, 229, 0.25);
}

.card-header-custom {
    background: linear-gradient(90deg, rgba(79, 70, 229, 0.08), rgba(6, 182, 212, 0.08));
    border-bottom: 1px solid var(--border);
    padding: 1.25rem 1.5rem;
}

.form-label {
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-main);
    margin-bottom: 0.4rem;
}

.form-control, .form-select {
    border-radius: 10px;
    border: 1.5px solid var(--border);
    padding: 0.7rem 1rem;
    background: var(--card-bg);
    color: var(--text-main);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.input-group-text {
    border-radius: 10px 0 0 10px;
    border: 1.5px solid var(--border);
    background: var(--body-bg);
    color: var(--text-muted);
}

/* Quick amount buttons */
.quick-amounts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.quick-amounts .btn {
    border-radius: 50px;
    font-weight: 500;
    font-size: 0.85rem;
    padding: 0.35rem 0.9rem;
    border: 1.5px solid var(--border);
    color: var(--text-main);
    background: transparent;
    transition: all 0.2s;
}

.quick-amounts .btn:hover,
.quick-amounts .btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Generate Button */
.btn-generate {
    background: linear-gradient(135deg, var(--gradient-start), #7c3aed);
    border: none;
    border-radius: 12px;
    padding: 0.9rem 2rem;
    font-weight: 600;
    font-size: 1.05rem;
    color: #fff;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.5);
    color: #fff;
}

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

/* QR Result Area */
.qr-result {
    display: none;
    animation: fadeInUp 0.4s ease;
}

.qr-result.show {
    display: block;
}

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

.qr-preview {
    background: #fff;
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    display: inline-block;
}

#qrcode canvas,
#qrcode img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

.payment-details {
    background: var(--body-bg);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.payment-details .detail-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    border-bottom: 1px dashed var(--border);
}

.payment-details .detail-row:last-child {
    border-bottom: none;
}

.payment-details .label {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.payment-details .value {
    font-weight: 600;
    word-break: break-all;
}

/* Action buttons */
.action-btns .btn {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.55rem 1rem;
}

/* Features section */
.feature-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem;
    height: 100%;
    transition: transform 0.25s, box-shadow 0.25s;
}

.feature-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(79,70,229,0.15), rgba(6,182,212,0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Footer */
.footer {
    background: var(--card-bg);
    border-top: 1px solid var(--border);
    color: var(--text-muted);
}

.footer a {
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover {
    color: var(--primary);
}

/* Alert / validation */
.invalid-feedback {
    font-size: 0.82rem;
}

.is-invalid {
    border-color: #ef4444 !important;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1.1rem;
    height: 1.1rem;
}

/* Responsive tweaks */
@media (max-width: 767.98px) {
    .hero {
        padding: 3rem 0 4rem;
    }
    .generator-section {
        margin-top: -2.5rem;
    }
    .btn-generate {
        width: 100%;
    }
}

/* Print styles for QR */
@media print {
    body * { visibility: hidden; }
    .qr-print-area, .qr-print-area * { visibility: visible; }
    .qr-print-area {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        text-align: center;
    }
}
