/* -------------------------------------------------------------------
 * MODERN DASHBOARD STYLES (Tailwind-inspired)
 * ------------------------------------------------------------------- */
:root {
    --iaw-color-primary: #2563eb;
    --iaw-color-primary-dark: #1e40af;
    --iaw-color-secondary: #4f46e5;
    --iaw-color-bg: #f8f9fc;
    --iaw-color-text-dark: #1e293b;
    --iaw-color-text-light: #64748b;
}

.iaw-modern-dashboard {
    /* background-color: var(--iaw-color-bg); removed for transparency */
    background-color: transparent !important;
    padding: 0 !important;
    margin: 0 auto 20px auto;
    /* Centered and spaced */
    gap: 0 !important;
    border: none !important;
    box-shadow: none !important;
    min-height: 600px;
    position: relative;
    /* overflow: hidden; removed for full width */
    overflow: visible !important;
    display: flex;
    flex-direction: column;
    width: 100%;
    /* border-radius: 24px; removed */
}

/* Ambient Background Blobs */
.iaw-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    z-index: 0;
    animation: iaw-pulse-slow 6s infinite ease-in-out;
}

.iaw-blob-1 {
    top: -10%;
    left: -5%;
    width: 500px;
    height: 500px;
    background-color: #bfdbfe;
    /* blue-200 */
}

.iaw-blob-2 {
    bottom: -10%;
    right: -5%;
    width: 600px;
    height: 600px;
    background-color: #c7d2fe;
    /* indigo-200 */
    animation-delay: 1s;
}

.iaw-grid-texture {
    position: absolute;
    inset: 0;
    opacity: 0.4;
    background-image: radial-gradient(#cbd5e1 1px, transparent 1px);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.iaw-dashboard-content {
    position: relative;
    z-index: 10;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

/* Animations */
@keyframes iaw-pulse-slow {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

@keyframes iaw-fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.iaw-animate-fade-in-up {
    animation: iaw-fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Header / Hero */
.iaw-hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 9999px;
    background-color: #eff6ff;
    color: #2563eb;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    border: 1px solid #dbeafe;
    margin-bottom: 24px;
    text-transform: uppercase;
}

.iaw-hero-title {
    font-size: 2.5rem;
    /* Reduced from 3rem */
    font-weight: 800;
    color: #1e293b;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}

.iaw-gradient-text {
    background: linear-gradient(to right, #2563eb, #4f46e5);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.iaw-hero-desc {
    color: #64748b;
    font-size: 1.125rem;
    line-height: 1.6;
    font-weight: 500;
    max-width: 600px;
    margin: 0 auto 48px auto;
}

/* Info Cards Grid */
.iaw-info-grid {
    display: grid;
    grid-template-columns: repeat(1, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    max-width: 1000px;
    margin-bottom: 48px;
}

@media (min-width: 768px) {
    .iaw-info-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.iaw-info-card {
    position: relative;
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    /* Soft shadow */
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: left;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Align content to top */
}

.iaw-info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px -5px rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.8);
}

/* Gradient hover effect background */
.iaw-info-card::before {
    content: '';
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
    border-radius: 24px;
}

.iaw-info-card.blue::before {
    background: linear-gradient(135deg, rgba(239, 246, 255, 0.5), transparent);
}

.iaw-info-card.orange::before {
    background: linear-gradient(135deg, rgba(255, 247, 237, 0.5), transparent);
}

.iaw-info-card.purple::before {
    background: linear-gradient(135deg, rgba(250, 245, 255, 0.5), transparent);
}

.iaw-info-card:hover::before {
    opacity: 1;
}

.iaw-card-content {
    position: relative;
    z-index: 1;
}

.iaw-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    transition: transform 0.3s ease;
}

.iaw-info-card:hover .iaw-icon-box {
    transform: scale(1.1) rotate(-5deg);
}

.iaw-icon-box.blue {
    background-color: #dbeafe;
    color: #2563eb;
}

.iaw-icon-box.orange {
    background-color: #ffedd5;
    color: #ea580c;
}

.iaw-icon-box.purple {
    background-color: #f3e8ff;
    color: #9333ea;
}

.iaw-card-header-row {
    display: block;
    margin-bottom: 8px;
}

.iaw-info-title {
    font-size: 1rem;
    /* Reduced from 1.125rem */
    font-weight: 700;
    color: #1e293b;
    margin: 0;
    line-height: 1.3;
}

.iaw-time-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    background-color: #f1f5f9;
    padding: 4px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

.iaw-info-text {
    font-size: 0.85rem;
    /* Reduced from 0.875rem */
    color: #64748b;
    margin: 0;
    line-height: 1.4;
}

/* Action Button */
.iaw-start-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 16px;
    padding: 24px 60px;
    /* Increased from 20px 40px */
    background-color: #0f172a;
    /* Slate 900 */
    color: white;
    border-radius: 9999px;
    border: none;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px -5px rgba(37, 99, 235, 0.4);
    text-decoration: none;
    /* Reset link styles */
}

.iaw-start-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -5px rgba(37, 99, 235, 0.5);
    background-color: #1e293b;
}

.iaw-start-btn-text {
    font-size: 1.25rem;
    /* Increased from 1.125rem */
    font-weight: 700;
    letter-spacing: 0.025em;
    position: relative;
    z-index: 1;
}

.iaw-play-icon-circle {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 1;
}

.iaw-start-btn:hover .iaw-play-icon-circle {
    background-color: white;
    color: #2563eb;
}

/* Footer Stats */
.iaw-footer-stats {
    margin-top: 48px;
    display: flex;
    gap: 32px;
    font-size: 0.875rem;
    color: #94a3b8;
    font-weight: 500;
}

.iaw-footer-val {
    color: #475569;
    font-weight: 700;
}

/* Responsive Fixes */
@media (max-width: 768px) {
    .iaw-hero-title {
        font-size: 2.25rem;
    }

    .iaw-start-btn {
        width: 100%;
        justify-content: center;
    }
}

/* -------------------------------------------------------------------
 * SETUP SCREEN STYLES
 * ------------------------------------------------------------------- */
#iaw-speaking-pre-test-screen {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    width: 100%;
    height: 100%;
    /* Take full height of parent */
    min-height: 600px;
    /* Match intro screen min-height for consistency */
    margin: 0 auto;
}

/* Sparkle Icon Container */
.iaw-setup-icon-wrapper {
    position: relative;
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
}

.iaw-setup-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120px;
    height: 120px;
    background-color: rgba(59, 130, 246, 0.2);
    /* Blue-500 low opacity */
    border-radius: 50%;
    filter: blur(24px);
    z-index: 0;
}

.iaw-setup-icon-box {
    position: relative;
    z-index: 10;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #6366f1, #3b82f6);
    /* Indigo to Blue */
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 25px -5px rgba(59, 130, 246, 0.4);
    transform: rotate(-6deg);
    color: white;
}

.iaw-setup-title {
    font-size: 2rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 12px;
    text-align: center;
}

.iaw-setup-subtitle {
    font-size: 1.125rem;
    color: #64748b;
    font-weight: 500;
    margin-bottom: 40px;
    text-align: center;
}

/* Language Toggle */
.iaw-lang-toggle-container {
    margin: 0 auto 40px auto;
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.iaw-lang-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 16px;
    text-align: center;
}

.iaw-lang-toggle-box {
    background-color: #f1f5f9;
    padding: 6px;
    border-radius: 16px;
    display: flex;
    position: relative;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    width: 100%;
}

.iaw-lang-option {
    flex: 1;
    padding: 12px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    color: #64748b;
}

.iaw-lang-toggle-box input[type="radio"] {
    display: none;
}

.iaw-lang-toggle-box input[type="radio"]:checked+.iaw-lang-option {
    background-color: white;
    color: #2563eb;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.iaw-lang-info {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 12px;
    text-align: center;
}

/* Setup Action Button */
.iaw-setup-btn {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background-color: #374151;
    /* Dark Gray requested by user */
    color: white;
    padding: 20px;
    border-radius: 20px;
    border: none;
    font-size: 1.125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 10px 25px -5px rgba(55, 65, 81, 0.4);
}

.iaw-setup-btn:hover {
    background-color: #1f2937;
    /* Even darker gray on hover */
    transform: translateY(-4px);
    box-shadow: 0 20px 35px -5px rgba(55, 65, 81, 0.5);
}

.iaw-play-box {
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.iaw-setup-btn:hover .iaw-play-box {
    background-color: white;
    color: #1f2937;
}

/* -------------------------------------------------------------------
 * EXAM SCREEN STYLES
 * ------------------------------------------------------------------- */
#iaw-speaking-test-screen {
    display: none;
    /* Initially hidden */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
    min-height: 600px;
    position: relative;
    padding-bottom: 80px;
    /* Space for footer */
}

/* Question Area */
.iaw-question-area {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin-bottom: 48px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 10;
}

.iaw-question-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 16px;
    border-radius: 9999px;
    background-color: white;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    font-size: 0.75rem;
    font-weight: 700;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 32px;
}

.iaw-big-question {
    font-size: 2.25rem;
    font-weight: 800;
    color: #1e293b;
    line-height: 1.2;
    letter-spacing: -0.02em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: all 0.5s ease;
}

@media (max-width: 768px) {
    .iaw-big-question {
        font-size: 1.5rem;
    }
}

/* Cue Card (Part 2) */
#iaw-cue-card-display {
    background: white;
    padding: 24px;
    border-radius: 16px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    text-align: left;
    max-width: 600px;
    width: 100%;
    margin-top: 24px;
    border: 1px solid #e2e8f0;
}

#iaw-cue-card-display h4 {
    color: #2563eb;
    margin-bottom: 12px;
    font-size: 1.1rem;
}

#iaw-cue-card-display ul {
    list-style-type: disc;
    padding-left: 20px;
    color: #475569;
}

#iaw-cue-card-display li {
    margin-bottom: 4px;
}


/* VOICE ORB INTERFACE */
.iaw-orb-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 320px;
    height: 320px;
    margin-bottom: 20px;
}

/* Orbital Rings */
.iaw-orb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(226, 232, 240, 0.6);
    transition: all 1s ease;
}

.iaw-orb-ring.ring-1 {
    width: 280px;
    height: 280px;
}

.iaw-orb-ring.ring-2 {
    width: 400px;
    height: 400px;
    opacity: 0.4;
    border-color: rgba(226, 232, 240, 0.4);
}

/* Recording State: Animations */
.iaw-recording .iaw-orb-ring.ring-1 {
    border-color: #fecaca;
    /* red-200 */
    background-color: rgba(254, 242, 242, 0.3);
    /* red-50 */
    transform: scale(1.1) rotate(180deg);
    opacity: 1;
}

.iaw-recording .iaw-orb-ring.ring-2 {
    border-color: #ffedd5;
    /* orange-100 */
    transform: scale(1.05) rotate(-90deg);
    opacity: 0.8;
}

/* Main Orb Button */
.iaw-voice-orb-btn {
    position: relative;
    width: 144px;
    height: 144px;
    border-radius: 50%;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none;
    z-index: 20;
    transition: transform 0.3s ease;
}

.iaw-voice-orb-btn:hover {
    transform: scale(1.05);
}

.iaw-orb-glow {
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background-color: rgba(96, 165, 250, 0.3);
    /* blue-400 */
    filter: blur(24px);
    transition: all 0.5s ease;
}

.iaw-recording .iaw-orb-glow {
    background-color: rgba(248, 113, 113, 0.4);
    /* red-400 */
    animation: iaw-pulse-fast 2s infinite ease-in-out;
    transform: scale(1.25);
}

.iaw-orb-core {
    position: absolute;
    inset: 4px;
    border-radius: 50%;

    /* Glossy Gradient Style matching #iaw-audio-wave */
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.4), transparent 25%),
        linear-gradient(135deg, var(--iaw-blue-primary), var(--iaw-blue-secondary), var(--iaw-blue-accent));

    box-shadow:
        inset -4px -4px 10px rgba(0, 0, 0, 0.15),
        inset 4px 4px 10px rgba(255, 255, 255, 0.4),
        0 10px 20px rgba(59, 130, 246, 0.3);

    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    z-index: 25;
    transition: all 0.5s ease;
    border: none;
    /* Removed white border */
}

.iaw-recording .iaw-orb-core {
    /* Glossy Red Gradient */
    background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, 0.4), transparent 25%),
        linear-gradient(135deg, var(--iaw-red-primary), var(--iaw-red-secondary), var(--iaw-red-accent));

    box-shadow:
        inset -4px -4px 10px rgba(0, 0, 0, 0.15),
        inset 4px 4px 10px rgba(255, 255, 255, 0.4),
        0 10px 20px rgba(239, 68, 68, 0.6);

    border: none;
}

.iaw-orb-icon {
    width: 48px;
    height: 48px;
    transition: transform 0.3s ease;
}

/* Progress Ring SVG */
.iaw-orb-progress {
    position: absolute;
    inset: -20px;
    width: calc(100% + 40px);
    height: calc(100% + 40px);
    transform: rotate(-90deg);
    pointer-events: none;
    z-index: 22;
}

.iaw-progress-bg {
    fill: none;
    stroke: rgba(226, 232, 240, 0.5);
    /* slate-200 */
    stroke-width: 3;
}

.iaw-progress-bar {
    fill: none;
    stroke: #f97316;
    /* orange-500 */
    stroke-width: 4;
    stroke-dasharray: 289;
    /* 2 * PI * 46 approx */
    stroke-dashoffset: 289;
    /* Start empty */
    transition: stroke-dashoffset 1s linear;
    stroke-linecap: round;
    opacity: 0;
}

.iaw-recording .iaw-progress-bar {
    opacity: 1;
}

/* Status Text Below Orb */
.iaw-orb-status {
    position: absolute;
    bottom: -80px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 200px;
}

.iaw-timer {
    font-family: monospace;
    font-size: 2.5rem;
    font-weight: 700;
    color: #cbd5e1;
    /* slate-300 */
    letter-spacing: -0.05em;
    transition: color 0.3s ease;
}

.iaw-recording~.iaw-orb-status .iaw-timer,
.iaw-recording .iaw-timer {
    /* Adjust selector based on structure or JS class application */
    color: #1e293b;
}

/* Since the orb wrapper has .iaw-recording toggled, we target children */
.iaw-orb-wrapper.iaw-recording .iaw-timer {
    color: #1e293b;
}

.iaw-status-msg {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #60a5fa;
    /* blue-400 */
    margin-top: 8px;
    transition: all 0.3s ease;
}

.iaw-orb-wrapper.iaw-recording .iaw-status-msg {
    color: #ef4444;
    /* red-500 */
    animation: iaw-pulse-fast 2s infinite;
}

/* EXAM FOOTER */
.iaw-exam-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    background: rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(8px);
    border-top: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 0 0 24px 24px;
    /* Assuming parent has radius, match it or be full width */
}

/* Mic Equalizer Animation */
.iaw-mic-status {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.iaw-equalizer {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 16px;
}

.iaw-equalizer .bar {
    width: 4px;
    background-color: #3b82f6;
    border-radius: 2px;
    animation: iaw-equalizer 1s infinite ease-in-out;
}

.iaw-equalizer .bar:nth-child(2) {
    animation-delay: 0.1s;
    height: 12px;
}

.iaw-equalizer .bar:nth-child(3) {
    animation-delay: 0.2s;
    height: 8px;
}

@keyframes iaw-equalizer {

    0%,
    100% {
        height: 4px;
    }

    50% {
        height: 16px;
    }
}

.iaw-mic-status span {
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Next Question Button */
.iaw-next-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px 12px 32px;
    background-color: #1e293b;
    color: white;
    border-radius: 9999px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.iaw-next-btn:hover {
    background-color: #0f172a;
    padding-right: 28px;
    transform: translateY(-2px);
}

.iaw-next-btn span {
    font-size: 0.875rem;
    font-weight: 600;
}

.iaw-icon-circle {
    width: 24px;
    height: 24px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.iaw-next-btn:hover .iaw-icon-circle {
    background-color: white;
    color: #1e293b;
}

@keyframes iaw-pulse-fast {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.8;
        transform: scale(1.05);
    }
}