/* =========================================
   1. Design Tokens & Reset
   ========================================= */
:root {
    /* Colors - Updated Palette */
    --bg-color: #0D0D0D;
    --text-primary: #F8FAFC;
    --text-secondary: #94A3B8;
    --accent-primary: #2405F2;
    /* Deep blue */
    --accent-secondary: #2E4BF2;
    /* Medium blue */
    --accent-tertiary: #2E83F2;
    /* Blue */
    --accent-light: #29A5F2;
    /* Light cyan */
    --accent-gradient-start: #2E83F2;
    --accent-gradient-end: #2405F2;
    --status-success: #22C55E;
    --glass-bg: rgba(13, 13, 13, 0.2);
    --glass-border: rgba(41, 165, 242, 0.1);
    --glass-blur: 12px;

    /* Typography */
    --font-primary: 'Inter', system-ui, -apple-system, sans-serif;
    --font-display: 'Sora', system-ui, -apple-system, sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    /* 8px */
    --spacing-sm: 1rem;
    /* 16px */
    --spacing-md: 1.5rem;
    /* 24px */
    --spacing-lg: 2rem;
    /* 32px */
    --border-radius-lg: 24px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-primary);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Background 3D Container */
#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    /* Above ripple, below content */
    overflow: hidden;
    pointer-events: none;
}

/* Background Ripple Grid (behind 3D) */
#ripple-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    /* Behind everything */
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

button {
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* Screen Reader Only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* =========================================
   2. Layout & Card
   ========================================= */
.container {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-sm);
    z-index: 1;
}

.card {
    background: var(--glass-bg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    border: none;
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    animation: fadeIn 0.8s ease-out forwards;
    position: relative;
    overflow: hidden;
}

/* Define property only if supported to avoid warnings in older parsers */
@property --border-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes rotateBorder {
    to {
        --border-angle: 360deg;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =========================================
   3. Hero Section
   ========================================= */
.hero {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.avatar-container {
    position: relative;
    width: 100px;
    height: 100px;
    margin-bottom: var(--spacing-sm);
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(46, 131, 242, 0.3);
    /* Static fallback */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    display: block;
    position: relative;
    z-index: 1;
}

/* Animated gradient border for avatar - Modern Browsers */
@supports (background: paint(something)) or (background: conic-gradient(from 0deg, red, blue)) {
    .avatar-img {
        border: none;
    }

    .avatar-container::before {
        content: '';
        position: absolute;
        inset: -3px;
        border-radius: 50%;
        background: conic-gradient(from var(--border-angle, 0deg),
                #2405F2 0deg,
                #2E4BF2 90deg,
                #2E83F2 180deg,
                #29A5F2 270deg,
                #2405F2 360deg);
        animation: rotateBorder 3s linear infinite;
        z-index: 0;
    }
}

.avatar-container::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: var(--bg-color);
    z-index: 0;
}

/* =========================================
   9. Alternative Layouts
   ========================================= */
/* Split Layout (Card Right) */
body.layout-split .container {
    margin-left: auto;
    /* Push to right */
    margin-right: 10vw;
    max-width: 420px;
}

/* Top Layout (Card Bottom) */
body.layout-top {
    align-items: flex-end;
    /* Align card to bottom */
    padding-bottom: 5vh;
}

body.layout-top .container {
    max-width: 480px;
}

@media (max-width: 768px) {

    /* Reset on mobile to stack normally */
    body.layout-split .container,
    body.layout-top .container {
        margin: 0 auto;
        max-width: 100%;
    }

    body.layout-top {
        align-items: center;
        padding-bottom: 0;
    }
}

.hero h1 {
    font-family: var(--font-display);
    font-size: 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    font-weight: 700;
    color: var(--text-primary);
}

.hero h2 {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
    max-width: 80%;
}

.tagline {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-align: center;
    line-height: 1.5;
    margin-top: var(--spacing-xs);
}

.tagline strong {
    color: var(--text-primary);
}

.experience {
    font-size: 0.8rem;
    color: var(--accent-light);
    text-align: center;
    font-weight: 500;
    margin-top: var(--spacing-xs);
}





/* =========================================
   4. Smart Links
   ========================================= */
.links-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.smart-btn {
    position: relative;
    display: flex;
    align-items: center;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.05);
    border: none;
    border-radius: var(--border-radius-md);
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s ease;
    overflow: visible;
    z-index: 1;
}

/* Animated border for buttons */
.smart-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--border-radius-md);
    padding: 1px;
    background: conic-gradient(from var(--border-angle, 0deg),
            transparent 0deg,
            transparent 180deg,
            #2E83F2 270deg,
            #29A5F2 360deg);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: rotateBorder 3s linear infinite;
    opacity: 0.3;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.smart-btn:hover::before {
    opacity: 1;
    background: conic-gradient(from var(--border-angle, 0deg),
            #2405F2 0deg,
            #2E4BF2 90deg,
            #2E83F2 180deg,
            #29A5F2 270deg,
            #2405F2 360deg);
}

/* Featured Button Style */
.smart-btn.featured {
    background: rgba(46, 131, 242, 0.1);
}

.smart-btn.featured::before {
    opacity: 0.6;
}

.smart-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(46, 131, 242, 0.3);
}

.smart-btn:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1.25rem;
    margin-right: var(--spacing-sm);
    width: 24px;
    display: flex;
    justify-content: center;
    color: var(--text-secondary);
    transition: color 0.2s;
}

.smart-btn:hover .btn-icon {
    color: #fff;
}

/* Spotlight Glow Effect container - populated by JS */
.btn-glow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    background: radial-gradient(circle at var(--x, 50%) var(--y, 50%), rgba(37, 99, 235, 0.15), transparent 150px);
    opacity: 0;
    transition: opacity 0.3s;
}

.smart-btn:hover .btn-glow {
    opacity: 1;
}

/* =========================================
   5. Form Section & Modal Inputs
   ========================================= */
.divider {
    border: none;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--glass-border), transparent);
    margin: var(--spacing-xs) 0;
}

h3[id^="modal-title"] {
    text-align: center;
    margin-bottom: var(--spacing-sm);
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
}

.form-group {
    margin-bottom: var(--spacing-sm);
}

input,
select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius-sm);
    color: var(--text-primary);
    font-family: var(--font-primary);
    font-size: 0.95rem;
    transition: all 0.2s;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-gradient-start);
    background: rgba(0, 0, 0, 0.5);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
}

.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--accent-gradient-start), var(--accent-gradient-end));
    border-radius: var(--border-radius-sm);
    color: #fff;
    font-weight: 600;
    font-size: 1rem;
    transition: filter 0.2s, transform 0.2s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: var(--spacing-sm);
}

.submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.loading-spinner {
    display: none;
}

.submit-btn.loading .loading-spinner {
    display: block;
}

.submit-btn.loading .btn-content {
    display: none;
}

.form-feedback {
    margin-top: var(--spacing-sm);
    text-align: center;
    font-size: 0.9rem;
    min-height: 1.4em;
    /* Prevent jump */
}

.form-feedback.success {
    color: var(--status-success);
}

.form-feedback.error {
    color: #EF4444;
}

/* =========================================
   6. Footer
   ========================================= */
.footer {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

/* =========================================
   7. Modal
   ========================================= */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    /* Slightly darker for better focus */
    backdrop-filter: blur(8px);
    z-index: 999;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #0f131a;
    border: 1px solid var(--glass-border);
    width: 90%;
    max-width: 400px;
    /* Standard modal width */
    padding: var(--spacing-lg);
    border-radius: var(--border-radius-lg);
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: color 0.2s;
    line-height: 1;
    width: 32px;
    height: 32px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

/* Location Modal Specifics */
.modal-address {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: var(--spacing-lg);
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.app-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px;
    border-radius: var(--border-radius-md);
    background: rgba(255, 255, 255, 0.05);
    font-weight: 600;
    transition: all 0.2s;
}

.app-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
}

.app-btn.waze:hover {
    color: #33CCFF;
    background: rgba(51, 204, 255, 0.15);
}

.app-btn.maps:hover {
    color: #4285F4;
    background: rgba(66, 133, 244, 0.15);
}

.app-btn.uber:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.2);
}

/* =========================================
   8. Responsive Adjustments
   ========================================= */
@media (max-width: 480px) {
    .container {
        padding: var(--spacing-xs);
    }

    .card {
        padding: var(--spacing-md);
    }

    .hero h1 {
        font-size: 1.25rem;
    }

    .modal-content {
        padding: var(--spacing-md);
    }
}