/* ============================================
   MedQR+ Custom Styles
   Premium QR Code Theme with Animations
   ============================================ */

/* CSS Variables */
:root {
    /* MedQR+ Color Palette */
    --qr-primary: #7C3AED;
    --qr-primary-dark: #6366F1;
    --qr-accent: #00A8A8;
    --qr-accent-light: #10B981;
    --qr-neutral-white: #FFFFFF;
    --qr-neutral-light: #F5F7FA;
    --qr-neutral-dark: #1A2332;
    --qr-text: #2C3E50;
    --qr-text-light: #5A6C7D;

    /* Spacing & Layout */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;
    --spacing-3xl: 4rem;
    --spacing-4xl: 6rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15);

    /* Transitions */
    --transition: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background-color: var(--qr-neutral-light);
    color: var(--qr-text);
    overflow-x: hidden;
    line-height: 1.6;
}

body.drawer-open {
    overflow: hidden;
}

/* Navbar Enhancements */
.medqr-nav {
    position: sticky;
    top: 0;
    z-index: 999;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all var(--transition);
}

.medqr-nav.scrolled {
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow-lg);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 1.5rem;
    align-items: center;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--qr-text);
    text-decoration: none;
}

.nav-brand span {
    color: var(--qr-accent-light);
}

.nav-container nav {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.nav-container nav a {
    font-weight: 500;
    color: var(--qr-text-light);
    text-decoration: none;
    position: relative;
    padding-bottom: 0.2rem;
}

.nav-container nav a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 2px;
    background: var(--qr-primary);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--transition);
}

.nav-container nav a:hover::after {
    transform: scaleX(1);
}

.nav-cta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.ghost-link,
.solid-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.4rem;
    border-radius: 999px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid transparent;
}

.ghost-link {
    color: var(--qr-primary);
    border-color: rgba(124, 58, 237, 0.25);
    background: rgba(124, 58, 237, 0.08);
}

.ghost-link:hover {
    background: rgba(124, 58, 237, 0.15);
}

.solid-link {
    background: var(--qr-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.solid-link:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    border: none;
    background: transparent;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--qr-text);
    display: block;
}

.nav-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: var(--shadow-xl);
    padding: 5rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: right var(--transition);
    z-index: 998;
}

.nav-drawer.open {
    right: 0;
}

.nav-drawer a {
    color: var(--qr-text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.nav-drawer a:last-child {
    border-bottom: none;
    margin-top: 1rem;
}

/* Hero Section with QR Animation */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--qr-primary) 0%, var(--qr-primary-dark) 100%);
    color: white;
    overflow: hidden;
    padding: 140px 1.5rem 90px;
}

/* Animated QR Grid Background */
.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    opacity: 0.5;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Floating QR Code Pattern */
.hero::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: 5%;
    width: 300px;
    height: 300px;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><rect x="10" y="10" width="15" height="15" fill="rgba(255,255,255,0.1)"/><rect x="30" y="10" width="10" height="10" fill="rgba(255,255,255,0.1)"/><rect x="50" y="10" width="20" height="20" fill="rgba(255,255,255,0.1)"/><rect x="10" y="30" width="10" height="10" fill="rgba(255,255,255,0.1)"/><rect x="30" y="30" width="15" height="15" fill="rgba(255,255,255,0.1)"/><rect x="70" y="30" width="10" height="10" fill="rgba(255,255,255,0.1)"/><rect x="10" y="50" width="20" height="20" fill="rgba(255,255,255,0.1)"/><rect x="40" y="50" width="10" height="10" fill="rgba(255,255,255,0.1)"/><rect x="60" y="50" width="15" height="15" fill="rgba(255,255,255,0.1)"/></svg>') no-repeat center;
    background-size: contain;
    animation: float 6s ease-in-out infinite;
    opacity: 0.3;
    pointer-events: none;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* Scanning Line Effect */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg,
            transparent,
            rgba(16, 185, 129, 0.8),
            transparent);
    animation: scan 3s linear infinite;
    opacity: 0.6;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

@keyframes scan {
    0% {
        top: 0;
    }

    100% {
        top: 100%;
    }
}

/* Hero Content */
.hero-grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
    align-items: center;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.hero-copy .pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 1.1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.hero-copy h1 {
    font-size: 3rem;
    line-height: 1.2;
}

.hero-copy p {
    font-size: 1.1rem;
    opacity: 0.95;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.hero-actions .ghost-link {
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
    background: transparent;
}

.hero-actions .ghost-link:hover {
    background: rgba(255, 255, 255, 0.15);
}

.hero-video.pulse {
    animation: buttonPulse 0.8s ease-out;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(100px, 1fr));
    gap: 1rem;
}

.hero-stats div {
    padding: 1rem;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-stats h3 {
    font-size: 2rem;
    margin-bottom: 0.25rem;
}

.hero-preview {
    position: relative;
    min-height: 420px;
}

.qr-orb {
    position: absolute;
    inset: -40px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.4), transparent 60%);
    filter: blur(10px);
    animation: pulse 4s ease-in-out infinite;
}

.preview-card {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-xl);
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.preview-header .badge {
    padding: 0.3rem 0.9rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.2);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
}

.preview-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.preview-avatar {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.preview-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.2);
    padding: 0.5rem;
}

.preview-qr {
    background: rgba(17, 24, 39, 0.6);
    border-radius: 16px;
    padding: 1.5rem;
    text-align: center;
}

.animated-qr {
    width: 120px;
    height: 120px;
    margin: 0 auto 0.75rem;
    background: repeating-linear-gradient(45deg, #10B981, #10B981 10px, transparent 10px, transparent 20px);
    animation: qrScan 3s linear infinite;
    border-radius: 12px;
}

.preview-meta {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.preview-meta li {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.95rem;
}

.preview-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
}

.preview-footer button {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
}

/* CTA Button */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    background: var(--qr-accent-light);
    color: white;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 1.05rem;
    text-decoration: none;
    transition: all var(--transition);
    box-shadow: 0 15px 30px rgba(16, 185, 129, 0.25);
    position: relative;
    overflow: hidden;
}

.cta-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.cta-btn:hover::before {
    width: 280px;
    height: 280px;
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 35px rgba(16, 185, 129, 0.4);
    background: #059669;
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: linear-gradient(180deg, #ffffff 0%, var(--qr-neutral-light) 100%);
}

.section-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto 3rem;
}

.section-header span {
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--qr-accent-light);
    font-size: 0.85rem;
}

.section-header h2 {
    font-size: 2.5rem;
    margin: 1rem 0;
    color: var(--qr-neutral-dark);
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
}

/* Feature Cards */
.feature-card {
    background: white;
    border-radius: 24px;
    border: 1px solid rgba(124, 58, 237, 0.12);
    padding: 2.5rem;
    box-shadow: var(--shadow-md);
    transition: transform var(--transition), box-shadow var(--transition);
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 18px;
    background: rgba(124, 58, 237, 0.15);
    color: var(--qr-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
}

.feature-card ul {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    color: var(--qr-text-light);
}

.feature-card ul li::before {
    content: '•';
    color: var(--qr-accent-light);
    margin-right: 0.5rem;
}

/* Journey Section */
.journey {
    background: var(--qr-neutral-dark);
    color: white;
    padding: 6rem 1.5rem;
}

.journey-heading {
    max-width: 760px;
    margin: 0 auto 3rem;
    text-align: center;
}

.journey-heading span {
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--qr-accent-light);
    font-size: 0.9rem;
}

.journey-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 2rem;
}

.journey-step {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    padding: 2rem;
    position: relative;
    overflow: hidden;
}

.journey-step::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    border: 1px solid transparent;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25), transparent);
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    padding: 1px;
}

.step-count {
    font-size: 0.85rem;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
    margin-bottom: 1rem;
}

.journey-step h3 {
    margin-bottom: 0.75rem;
}

.journey-step p {
    color: rgba(255, 255, 255, 0.85);
}

/* Trust Section */
.trust {
    padding: 6rem 1.5rem;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 3rem;
    align-items: center;
}

.trust-copy span {
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--qr-accent-light);
    font-size: 0.85rem;
}

.trust-copy h2 {
    font-size: 2.3rem;
    margin: 1rem 0;
}

.trust-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 1.5rem;
}

.stat-card {
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 18px;
    padding: 1.5rem;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.stat-card i {
    color: var(--qr-primary);
    font-size: 1.5rem;
    margin-bottom: 0.8rem;
}

.stat-card h3 {
    font-size: 1.8rem;
}

/* CTA */
.cta {
    padding: 4rem 1.5rem 6rem;
}

.cta-card {
    background: var(--qr-primary);
    color: white;
    border-radius: 32px;
    padding: 3rem;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    align-items: center;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.cta-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 20% 20%, rgba(255, 255, 255, 0.2), transparent 55%);
    pointer-events: none;
}

.cta-card > div {
    position: relative;
    z-index: 1;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

/* Footer */
footer {
    background: #111827;
    color: #bbb;
    padding: 3rem 0;
    text-align: center;
}

footer a {
    color: var(--qr-accent-light);
    text-decoration: none;
    transition: color var(--transition);
}

footer a:hover {
    color: var(--qr-accent);
    text-decoration: underline;
}

footer p {
    margin: 0;
    color: #bbb;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Staggered animation for feature cards */
.feature-card:nth-child(1) {
    animation: fadeInUp 0.6s ease-out 0.1s both;
}

.feature-card:nth-child(2) {
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.feature-card:nth-child(3) {
    animation: fadeInUp 0.6s ease-out 0.3s both;
}

@keyframes qrScan {
    0% {
        background-position: 0 0;
    }

    100% {
        background-position: 40px 40px;
    }
}

@keyframes pulse {
    0%,
    100% {
        opacity: 0.6;
        transform: scale(1);
    }

    50% {
        opacity: 0.9;
        transform: scale(1.05);
    }
}

@keyframes buttonPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.4);
    }

    100% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(255, 255, 255, 0);
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .nav-container {
        grid-template-columns: 1fr auto;
    }

    .nav-container nav,
    .nav-cta {
        display: none;
    }

    .nav-toggle {
        display: flex;
        justify-self: end;
    }
}

@media (max-width: 768px) {
    .hero {
        padding-top: 120px;
    }

    .hero-copy h1 {
        font-size: 2.4rem;
    }

    .hero-stats {
        grid-template-columns: repeat(2, minmax(120px, 1fr));
    }

    .cta-card {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .hero {
        padding: 120px 1rem 60px;
    }

    .hero-stats {
        grid-template-columns: 1fr;
    }

    .cta-card {
        padding: 2rem;
    }
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.text-center {
    text-align: center;
}

.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -12px;
}

.col-md-4 {
    flex: 0 0 33.333%;
    max-width: 33.333%;
    padding: 0 12px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

.g-4 {
    gap: 1.5rem;
}