/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --black: #000000;
    --dark-gray: #0a0a0a;
    --medium-gray: #1a1a1a;
    --light-gray: #2a2a2a;
    --white: #ffffff;
    --accent: #ffffff;
    --accent-glow: rgba(255, 255, 255, 0.3);
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.7);
    --text-muted: rgba(255, 255, 255, 0.5);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--black);
    color: var(--text-primary);
    min-height: 100vh;
    overflow: hidden;
    position: relative;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.01) 0%, transparent 70%);
    animation: backgroundPulse 20s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}

@keyframes backgroundPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.8; transform: scale(1.1); }
}

/* Intro Screen - Apple-like Animation */
.intro-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    overflow: hidden;
}

.intro-content {
    text-align: center;
    opacity: 0;
    animation: fadeInIntro 1s ease-out 0.5s forwards;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
}

.intro-logo {
    width: 200px;
    height: 200px;
    opacity: 0;
    animation: fadeInScale 1s ease-out 0.3s forwards;
    display: flex;
    align-items: center;
    justify-content: center;
}

.intro-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 30px rgba(255, 255, 255, 0.3));
}

.logo-fallback {
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--white);
    text-shadow: 0 0 30px rgba(255, 255, 255, 0.5);
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.intro-text {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.intro-line {
    font-size: clamp(32px, 8vw, 72px);
    font-weight: 300;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--white);
    opacity: 0;
    transform: translateY(30px);
    animation: slideUpFade 1.2s ease-out forwards;
}

.intro-line:nth-child(1) { animation-delay: 0.8s; }
.intro-line:nth-child(2) { animation-delay: 1.2s; }
.intro-line:nth-child(3) { animation-delay: 1.6s; }
.intro-line:nth-child(4) { animation-delay: 2.0s; }

.intro-line.highlight {
    font-weight: 700;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 0 40px rgba(255, 255, 255, 0.5);
    position: relative;
}

.intro-line.highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.3) 0%, transparent 100%);
    filter: blur(20px);
    z-index: -1;
    animation: glowPulse 2s ease-in-out infinite;
}

@keyframes fadeInIntro {
    to { opacity: 1; }
}

@keyframes slideUpFade {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* Main Interview Container */
.interview-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    z-index: 100;
    background: var(--black);
}

/* Interview Header */
.interview-header {
    padding: 30px 40px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 10;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 30px;
}

.legendary-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50px;
    backdrop-filter: blur(10px);
}

.badge-logo {
    width: 32px;
    height: 32px;
    object-fit: contain;
    display: block;
}

.badge-text {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--text-primary);
}

.interview-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    min-width: 200px;
}

.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 50%, #93c5fd 100%);
    border-radius: 10px;
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: progressShine 2s infinite;
}

@keyframes progressShine {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes progressPulse {
    0%, 100% {
        box-shadow: 0 0 20px rgba(59, 130, 246, 0.6), 0 0 40px rgba(59, 130, 246, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(59, 130, 246, 1), 0 0 80px rgba(59, 130, 246, 0.6);
        transform: scaleY(1.1);
    }
}

.progress-text {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-primary);
    min-width: 45px;
    text-align: right;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.3);
}

/* Messages Area */
.interview-messages {
    flex: 1;
    overflow-y: auto;
    padding: 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    scroll-behavior: smooth;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 10px;
    animation: messageSlideIn 0.5s ease-out;
    opacity: 0;
    animation-fill-mode: forwards;
}

.message.user {
    align-items: flex-end;
}

.message.assistant {
    align-items: flex-start;
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-content {
    max-width: 75%;
    padding: 20px 28px;
    border-radius: 24px;
    line-height: 1.6;
    font-size: 16px;
    position: relative;
    word-wrap: break-word;
}

.message.assistant .message-content {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    white-space: pre-wrap; /* Preserve line breaks and wrap text */
    position: relative;
}

/* Typing cursor effect for AI messages */
.message.assistant .message-content::after {
    content: '▊';
    animation: blink 1s infinite;
    color: var(--text-primary);
    margin-left: 2px;
    opacity: 1;
}

.message.assistant .message-content.typing-complete::after {
    display: none;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

.message.user .message-content {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    backdrop-filter: blur(10px);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    white-space: pre-wrap;
}

.message-time {
    font-size: 11px;
    color: var(--text-muted);
    padding: 0 8px;
    font-weight: 500;
}

/* Input Container */
.interview-input-container {
    padding: 30px 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(20px);
    position: relative;
    z-index: 10;
}

.input-wrapper {
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    gap: 15px;
    align-items: center;
    position: relative;
}

.input-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    border-radius: 30px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 0;
}

#interview-input:focus ~ .input-glow,
.input-wrapper:focus-within .input-glow {
    opacity: 1;
}

#interview-input {
    flex: 1;
    padding: 18px 28px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 30px;
    color: var(--text-primary);
    font-size: 16px;
    font-family: inherit;
    outline: none;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

#interview-input::placeholder {
    color: var(--text-muted);
}

#interview-input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 30px rgba(255, 255, 255, 0.1);
}

.send-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.send-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Typing Indicator */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 0 0 0;
    color: var(--text-muted);
    font-size: 14px;
    max-width: 900px;
    margin: 0 auto;
}

.typing-dots {
    display: flex;
    gap: 6px;
}

.typing-dots span {
    width: 8px;
    height: 8px;
    background: var(--text-muted);
    border-radius: 50%;
    animation: typingDot 1.4s infinite ease-in-out;
}

.typing-dots span:nth-child(1) { animation-delay: 0s; }
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingDot {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.5;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

/* Success Screen */
.success-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--black);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    animation: fadeIn 1s ease-out;
}

.success-content {
    text-align: center;
    max-width: 800px;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.success-logo {
    width: 250px;
    height: 250px;
    margin-bottom: 50px;
    opacity: 0;
    animation: logoAppearSuccess 1.5s ease-out 0.3s forwards;
}

.success-logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.5));
    animation: logoGlowSuccess 3s ease-in-out infinite;
}

@keyframes logoAppearSuccess {
    from {
        opacity: 0;
        transform: scale(0.3) rotate(-180deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

@keyframes logoGlowSuccess {
    0%, 100% {
        filter: drop-shadow(0 0 50px rgba(255, 255, 255, 0.5));
    }
    50% {
        filter: drop-shadow(0 0 80px rgba(59, 130, 246, 0.8));
    }
}

.success-logo .logo-fallback {
    font-size: 80px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--white);
    text-shadow: 0 0 50px rgba(255, 255, 255, 0.5);
}

.success-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 40px;
    color: var(--white);
    position: relative;
}

.success-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: drawCircle 1s ease-out forwards;
}

.success-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheck 0.5s ease-out 0.8s forwards;
}

@keyframes drawCircle {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheck {
    to {
        stroke-dashoffset: 0;
    }
}

.success-title {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #3b82f6 50%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    opacity: 0;
    animation: textAppearSuccess 1s ease-out 1.5s forwards, gradientShift 3s ease-in-out infinite 2.5s;
}

.success-message {
    font-size: clamp(20px, 3vw, 28px);
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 15px;
    opacity: 0;
    animation: textAppearSuccess 1s ease-out 2s forwards;
}

.success-subtitle {
    font-size: clamp(18px, 2.5vw, 24px);
    color: var(--text-primary);
    font-weight: 600;
    opacity: 0;
    animation: textAppearSuccess 1s ease-out 2.5s forwards;
}

@keyframes textAppearSuccess {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-details {
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    text-align: left;
    backdrop-filter: blur(10px);
}

.success-details h3 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.success-details p {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Scrollbar Styling */
.interview-messages::-webkit-scrollbar {
    width: 6px;
}

.interview-messages::-webkit-scrollbar-track {
    background: transparent;
}

.interview-messages::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

.interview-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Responsive Design */
@media (max-width: 768px) {
    .interview-header {
        padding: 20px;
    }

    .header-content {
        flex-direction: column;
        gap: 20px;
    }

    .interview-progress {
        width: 100%;
    }

    .interview-messages {
        padding: 20px;
        gap: 20px;
    }

    .message-content {
        max-width: 85%;
        padding: 16px 22px;
        font-size: 15px;
    }

    .interview-input-container {
        padding: 20px;
    }

    #interview-input {
        padding: 16px 22px;
        font-size: 15px;
    }

    .send-btn {
        width: 50px;
        height: 50px;
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

/* Completion Animation - Redesigned */
#completion-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at center, rgba(0, 0, 0, 0.98) 0%, rgba(0, 0, 0, 1) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    animation: fadeInAnimation 0.6s ease-out;
}

@keyframes fadeInAnimation {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.completion-content {
    text-align: center;
    position: relative;
    z-index: 2;
}

.completion-icon {
    width: 200px;
    height: 200px;
    margin: 0 auto 40px;
    color: var(--white);
    position: relative;
    opacity: 0;
    animation: iconBounceIn 1s cubic-bezier(0.68, -0.55, 0.265, 1.55) 0.3s forwards;
}

@keyframes iconBounceIn {
    0% {
        opacity: 0;
        transform: scale(0) rotate(-180deg);
    }
    60% {
        transform: scale(1.2) rotate(10deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

.completion-circle {
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    animation: drawCircleComplete 1.2s ease-out 0.5s forwards;
    filter: drop-shadow(0 0 20px rgba(59, 130, 246, 0.8));
}

.completion-check {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: drawCheckComplete 0.6s ease-out 1.5s forwards;
}

@keyframes drawCircleComplete {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes drawCheckComplete {
    to {
        stroke-dashoffset: 0;
    }
}

.completion-title {
    font-size: clamp(40px, 7vw, 72px);
    font-weight: 800;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #3b82f6 30%, #60a5fa 60%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    background-size: 200% 200%;
    opacity: 0;
    animation: titleSlideIn 1s ease-out 2s forwards, gradientFlow 4s ease-in-out infinite 3s;
    text-shadow: 0 0 40px rgba(59, 130, 246, 0.5);
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateY(50px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes gradientFlow {
    0%, 100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.completion-message {
    font-size: clamp(18px, 3vw, 28px);
    color: var(--text-secondary);
    opacity: 0;
    animation: messageFadeIn 1s ease-out 2.5s forwards;
    line-height: 1.6;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Confetti particles */
.completion-content::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: 
        radial-gradient(circle at 20% 30%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(147, 197, 253, 0.1) 0%, transparent 50%);
    animation: particleFloat 8s ease-in-out infinite;
    z-index: -1;
}

@keyframes particleFloat {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translate(30px, -30px) rotate(180deg);
        opacity: 1;
    }
}

