:root {
    /* --- Modern Vibrant Theme --- */
    --bg-gradient-start: #667eea;
    --bg-gradient-end: #764ba2;
    --bg-dark: #0a0e27;
    --bg-card: rgba(255, 255, 255, 0.95);

    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #ec4899;

    --text-main: #1e293b;
    --text-light: #ffffff;
    --text-muted: #64748b;

    --success: #10b981;
    --error: #ef4444;

    --shadow-glow: 0 0 30px rgba(99, 102, 241, 0.3);
    --shadow-card: 0 20px 60px rgba(0, 0, 0, 0.3);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--bg-gradient-start) 0%, var(--bg-gradient-end) 100%);
    color: var(--text-main);
    font-family: 'Inter', system-ui, sans-serif;
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Mobile scroll fixes */
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scroll-behavior: smooth;
}

/* --- Floating Background Elements --- */
.floating-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.float-computer {
    position: absolute;
    font-size: 3rem;
    opacity: 0.15;
    animation: floatAround 20s infinite ease-in-out;
    color: white;
}

.float-computer:nth-child(1) {
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.float-computer:nth-child(2) {
    top: 60%;
    left: 80%;
    animation-delay: -5s;
}

.float-computer:nth-child(3) {
    top: 30%;
    left: 70%;
    animation-delay: -10s;
}

.float-computer:nth-child(4) {
    top: 80%;
    left: 20%;
    animation-delay: -15s;
}

@keyframes floatAround {

    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }

    25% {
        transform: translate(30px, -40px) rotate(5deg);
    }

    50% {
        transform: translate(-20px, 20px) rotate(-5deg);
    }

    75% {
        transform: translate(40px, 10px) rotate(3deg);
    }
}

/* --- Animated Text Particles --- */
.text-particle {
    position: absolute;
    font-size: 1.2rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.2);
    animation: floatText 15s infinite ease-in-out;
    pointer-events: none;
}

.text-particle:nth-child(1) {
    top: 15%;
    left: 5%;
    animation-delay: 0s;
}

.text-particle:nth-child(2) {
    top: 45%;
    left: 90%;
    animation-delay: -3s;
}

.text-particle:nth-child(3) {
    top: 75%;
    left: 15%;
    animation-delay: -6s;
}

.text-particle:nth-child(4) {
    top: 25%;
    left: 85%;
    animation-delay: -9s;
}

@keyframes floatText {

    0%,
    100% {
        transform: translateY(0) scale(1);
        opacity: 0.2;
    }

    50% {
        transform: translateY(-30px) scale(1.1);
        opacity: 0.4;
    }
}

/* --- Header removed - Prepten is displayed in hero section --- */

/* --- Brand Highlight in Hero --- */
.brand-highlight {
    text-align: center;
    margin-bottom: 40px;
    animation: fadeInDown 0.8s ease;
}

.brand-logo-large {
    display: inline-flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
    padding: 20px 40px;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
}

.brand-logo-large:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(99, 102, 241, 0.4);
    border-color: rgba(255, 255, 255, 0.5);
}

.brand-logo-large i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: rocketFloat 3s infinite ease-in-out;
    filter: drop-shadow(0 0 10px rgba(251, 191, 36, 0.5));
}

.brand-name {
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, #e0e7ff 50%, #c7d2fe 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: 0.1em;
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
    position: relative;
}

.brand-name::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, transparent, #fbbf24, transparent);
    border-radius: 2px;
    animation: shimmer 2s infinite;
}

@keyframes rocketFloat {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    25% {
        transform: translateY(-10px) rotate(-5deg);
    }

    75% {
        transform: translateY(10px) rotate(5deg);
    }
}

@keyframes shimmer {

    0%,
    100% {
        opacity: 0.3;
        transform: translateX(-100%);
    }

    50% {
        opacity: 1;
        transform: translateX(100%);
    }
}

.brand-tagline {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-top: 8px;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Main Content --- */
main {
    position: relative;
    z-index: 10;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Ensure main doesn't constrain scrolling */
    height: auto;
    overflow: visible;
}

.view-section {
    display: none;
    width: 100%;
}

.view-section.active {
    display: block;
}

/* --- HERO SETUP SCREEN --- */
.hero-setup {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 120px 20px 60px;
    position: relative;
}

.hero-content {
    max-width: 900px;
    width: 100%;
    text-align: center;
    z-index: 20;
}

/* Typewriter Effect */
.typewriter-container {
    margin-bottom: 30px;
    min-height: 80px;
}

.typewriter-text {
    font-size: 3.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    line-height: 1.2;
    margin-bottom: 20px;
}

.cursor {
    display: inline-block;
    width: 3px;
    height: 1.2em;
    background: white;
    margin-left: 4px;
    animation: blink 1s infinite;
    vertical-align: baseline;
}

@keyframes blink {

    0%,
    50% {
        opacity: 1;
    }

    51%,
    100% {
        opacity: 0;
    }
}

.hero-subtitle {
    font-size: 1.3rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 50px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Price Display */
.price-display {
    animation: slideUp 0.6s ease;
    border: 2px solid rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

.price-display:hover {
    border-color: rgba(99, 102, 241, 0.5);
    background: rgba(99, 102, 241, 0.15) !important;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(99, 102, 241, 0.2);
}

/* Config Card */
.config-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(255, 255, 255, 0.3);
    animation: slideUp 0.6s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.config-group {
    margin-bottom: 32px;
}

.group-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.choice-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.choice-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.choice-card:hover::before {
    left: 100%;
}

.choice-card:hover {
    transform: translateY(-5px) scale(1.02);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.2);
}

.choice-card.active {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    border-color: var(--primary);
    color: white;
    box-shadow: var(--shadow-glow);
    transform: translateY(-3px);
}

.choice-card i {
    font-size: 2rem;
    margin-bottom: 8px;
}

.choice-card span {
    font-weight: 600;
    font-size: 1rem;
}

.text-input {
    width: 100%;
    padding: 14px 18px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 1rem;
    outline: none;
    transition: 0.3s;
    background: white;
}

.text-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* Highlighted topic input - more prominent */
.topic-input-highlight {
    border: 2px solid rgba(99, 102, 241, 0.4) !important;
    background: white !important;
    font-weight: 500 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.15) !important;
}

.topic-input-highlight:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), 0 4px 12px rgba(99, 102, 241, 0.25) !important;
    transform: scale(1.01);
}

.topic-input-highlight::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    border-radius: 16px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    width: 100%;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.4);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(99, 102, 241, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

/* --- INTERVIEW VIEW --- */
.interview-layout {
    max-width: 1000px;
    margin: 40px auto;
    height: calc(100vh - 80px);
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 24px;
    box-shadow: 0 -10px 50px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.status-bar {
    padding: 16px 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-info {
    display: flex;
    gap: 20px;
    align-items: center;
}

.badge {
    padding: 6px 14px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.timer {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 700;
    font-size: 1.1rem;
}

.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.msg-row {
    display: flex;
    gap: 16px;
    max-width: 80%;
    animation: slideIn 0.4s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.msg-row.ai {
    align-self: flex-start;
}

.msg-row.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.avatar {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: var(--primary);
    font-size: 1.1rem;
}

.user .avatar {
    background: var(--primary);
    color: white;
}

.bubble {
    padding: 16px 20px;
    border-radius: 18px;
    font-size: 1rem;
    line-height: 1.6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ai .bubble {
    background: white;
    color: var(--text-main);
    border-top-left-radius: 4px;
}

.user .bubble {
    background: var(--primary);
    color: white;
    border-top-right-radius: 4px;
}

.user .bubble strong {
    color: white;
}

.controls-wrapper {
    padding: 20px 24px;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.input-container {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    background: #f8f9fa;
    padding: 10px;
    border-radius: 16px;
    border: 2px solid transparent;
    transition: 0.3s;
}

.input-container:focus-within {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.chat-textarea {
    flex: 1;
    border: none;
    background: transparent;
    resize: none;
    padding: 12px;
    font-size: 1rem;
    outline: none;
    font-family: inherit;
    max-height: 120px;
}

.icon-btn {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: 0.2s;
    font-size: 1.1rem;
    background: transparent;
    color: var(--text-muted);
}

.icon-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-main);
}

.mic-active {
    background: var(--error) !important;
    color: white !important;
    animation: pulse 1.5s infinite;
}

.send-btn {
    background: var(--primary);
    color: white;
}

.send-btn:hover {
    background: var(--primary);
    transform: scale(1.05);
}

/* --- REPORT VIEW --- */
.report-container {
    max-width: 1000px;
    margin: 100px auto 40px;
    padding: 0 20px 40px;
    /* Ensure bottom padding for scrolling */
}

.report-card {
    background: white;
    border-radius: 24px;
    overflow: visible;
    /* Changed from hidden to allow scrolling on mobile */
    box-shadow: var(--shadow-card);
    /* Ensure card doesn't constrain height */
    min-height: auto;
}

.report-header-bg {
    background: linear-gradient(135deg, var(--primary) 0%, #818cf8 100%);
    padding: 50px;
    text-align: center;
    color: white;
}

.score-circle {
    width: 200px;
    height: 200px;
    background: white;
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: visible;
}

.score-number {
    font-size: 4.5rem;
    font-weight: 800;
    line-height: 1;
    color: var(--primary);
}

.score-denominator {
    font-size: 1.8rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-top: 5px;
}

.report-body {
    padding: 40px;
    /* Ensure content is scrollable on mobile */
    overflow-y: visible;
    max-height: none;
    /* Ensure body content flows naturally */
    min-height: auto;
    height: auto;
}

.feedback-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

.fb-box h3 {
    font-size: 1.1rem;
    text-transform: uppercase;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

.fb-box ul {
    list-style: none;
}

.fb-box li {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    color: var(--text-secondary);
    display: flex;
    gap: 10px;
}

.fb-box li::before {
    content: "✓";
    color: var(--success);
    font-weight: bold;
}

.transcript-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
}

.transcript-table th {
    text-align: left;
    padding: 14px 16px;
    background: #f8f9fa;
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    border-bottom: 2px solid #e5e7eb;
}

.transcript-table td {
    padding: 20px 16px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: top;
}

.transcript-table tr:last-child td {
    border-bottom: none;
}

.ideal-answer {
    background: #ecfdf5;
    color: #065f46;
    padding: 14px;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 0.9rem;
    border-left: 4px solid var(--success);
}

/* Mobile Scroll Fixes */
html {
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Prevent auto-scroll and scroll jump on mobile */
* {
    -webkit-tap-highlight-color: transparent;
}

button,
.btn-primary,
input,
select {
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Fix button click scroll jump */
.btn-primary:active {
    transform: scale(0.98);
}

/* Mobile viewport fix */
.view-section {
    min-height: 100vh;
    min-height: -webkit-fill-available;
    /* iOS Safari fix */
    position: relative;
    /* Removed overflow-y: auto - let body handle scrolling naturally */
    /* Ensure view-section allows content to overflow naturally */
    overflow: visible;
    height: auto;
}

/* Specifically for report view - ensure it's scrollable */
#view-summary {
    min-height: 100vh;
    height: auto;
    overflow: visible;
    padding-bottom: 40px;
}

/* Prevent scroll bounce on iOS */
@supports (-webkit-touch-callout: none) {
    .view-section.active {
        /* Removed nested scrolling - body handles all scrolling */
        overscroll-behavior: contain;
    }
}

/* Config card - no nested scrolling, scrolls with main page */
/* Removed max-height and overflow-y from .config-card to allow natural page scrolling */

/* Responsive */
@media (max-width: 768px) {

    .grid-2,
    .grid-3,
    .feedback-grid {
        grid-template-columns: 1fr;
    }

    /* Reduce hero section padding on mobile */
    .hero-setup {
        padding: 40px 15px 30px !important;
        min-height: auto !important;
    }

    /* Hide typewriter animation on mobile */
    .typewriter-container {
        display: none !important;
    }

    /* Make brand logo much smaller on mobile */
    .brand-highlight {
        margin-bottom: 15px !important;
    }

    .brand-logo-large {
        padding: 8px 15px !important;
        gap: 8px !important;
    }

    .brand-logo-large i {
        font-size: 1.2rem !important;
    }

    .brand-name {
        font-size: 1.3rem !important;
        letter-spacing: 0.03em !important;
    }

    .brand-tagline {
        font-size: 0.7rem !important;
        margin-top: 2px !important;
    }

    /* Reduce subtitle size and margin */
    .hero-subtitle {
        font-size: 1rem !important;
        margin-bottom: 25px !important;
    }

    /* Reduce config card padding */
    .config-card {
        padding: 20px 15px !important;
        margin: 0 !important;
    }

    /* Reduce config group spacing */
    .config-group {
        margin-bottom: 20px !important;
    }

    /* Make topic input even more prominent on mobile */
    #topic-input-wrapper {
        padding: 16px !important;
        margin-top: 20px !important;
        border-width: 2px !important;
    }

    #topic-input-wrapper label {
        font-size: 0.95rem !important;
    }

    .topic-input-highlight {
        font-size: 0.95rem !important;
        padding: 12px !important;
    }

    .btn-primary {
        padding: 16px 20px !important;
        font-size: 1rem !important;
    }
}