@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

:root {
    --gold: #EFBF04;
    --gold-glow: rgba(239, 191, 4, 0.3);
    --bg-dark: #0A0F1E;
    --card-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #FFFFFF;
    --text-muted: rgba(255, 255, 255, 0.6);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    background-image:
        radial-gradient(circle at 20% 20%, rgba(239, 191, 4, 0.05) 0%, transparent 40%),
        radial-gradient(circle at 80% 80%, rgba(239, 191, 4, 0.05) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
}

#app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    padding: 2rem;
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 2rem;
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #FFF 0%, var(--gold) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

header p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* Responsive Main Layout */
main {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
}

/* Desktop Layout */
@media (min-width: 1024px) {
    main {
        flex-direction: row;
        align-items: flex-start;
    }

    .coaching-hub {
        flex: 1.5;
        position: sticky;
        top: 2rem;
    }

    .transcript-area {
        flex: 1;
        margin-top: 0;
        height: calc(100vh - 200px);
    }
}

.coaching-hub {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Central Visual Area */
.visual-hub {
    position: relative;
    height: 300px;
    width: 300px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 2rem;
}

/* The Orb */
.orb-container {
    position: relative;
    width: 220px;
    height: 220px;
}

#waveform-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
}

.orb {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.2), transparent),
        radial-gradient(circle at 70% 70%, rgba(239, 191, 4, 0.2), transparent),
        rgba(239, 191, 4, 0.05);
    box-shadow: 0 0 40px var(--gold-glow), inset 0 0 20px rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.orb::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: conic-gradient(from 0deg, transparent, rgba(239, 191, 4, 0.1), transparent 40%);
    animation: rotate 10s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Circular Loader */
.loader-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 240px;
    height: 240px;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.loader-overlay.active {
    opacity: 1;
    visibility: visible;
}

.circular-progress {
    position: relative;
    width: 100%;
    height: 100%;
}

.circular-progress svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.circular-progress circle {
    fill: none;
    stroke-width: 4;
    stroke-linecap: round;
}

.circular-progress .bg {
    stroke: rgba(255, 255, 255, 0.05);
}

.circular-progress .progress {
    stroke: var(--gold);
    stroke-dasharray: 615;
    /* 2 * PI * 98 approximate */
    stroke-dashoffset: 615;
    transition: stroke-dashoffset 0.1s linear;
}

.percentage-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--gold);
}

/* Status area */
.status-area {
    text-align: center;
    margin-bottom: 2rem;
    min-height: 100px;
}

#status-display {
    font-size: 1.2rem;
    color: var(--text-main);
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#loading-message {
    font-size: 0.9rem;
    color: var(--text-muted);
    font-style: italic;
}

/* Controls */
.controls {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.btn {
    font-family: inherit;
    font-weight: 600;
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.primary-btn {
    background: var(--gold);
    color: #000;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    box-shadow: 0 10px 30px var(--gold-glow);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px var(--gold-glow);
}

.mic-btn {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    color: var(--white);
    position: relative;
}

.mic-btn svg {
    fill: var(--text-main);
    width: 24px;
    height: 24px;
}

.mic-btn.recording {
    background: var(--gold);
    box-shadow: 0 0 30px var(--gold-glow);
    animation: breathe 1.5s ease-in-out infinite;
}

.mic-btn.recording svg {
    fill: #000;
}

@keyframes breathe {

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

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

/* Skeleton Loading */
.skeleton {
    width: 100%;
    max-width: 500px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    padding: 1.5rem;
    margin: 1rem 0;
    display: none;
}

.skeleton.active {
    display: block;
}

.pulse {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 0.5;
    }

    50% {
        opacity: 1;
    }
}

.skeleton-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
}

.skeleton-line {
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 10px;
}

/* Transcript Area */
.transcript-area {
    width: 100%;
    display: flex;
    flex-direction: column;
}

.transcript-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.transcript-header h2 {
    font-size: 1rem;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.transcript-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 1.5rem;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column-reverse;
    /* Newest on top */
    gap: 1.5rem;
}

.transcript-message {
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

.transcript-message .label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    display: block;
}

.transcript-message .content {
    font-size: 1.1rem;
    line-height: 1.6;
}

.hidden {
    display: none !important;
}

/* Modal and Summary Card */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 15, 30, 0.9);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.summary-card {
    background: var(--card-bg);
    border: 1px solid var(--gold);
    width: 90%;
    max-width: 450px;
    padding: 3rem 2rem;
    border-radius: 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px var(--gold-glow);
    animation: zoomIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.summary-card h2 {
    font-size: 2rem;
    color: var(--gold);
    margin-bottom: 2rem;
}

.decorative-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px var(--gold));
}

.summary-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-item {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.stat-value {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gold);
}

.stat-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.summary-divider {
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 2rem 0;
}

.summary-insights h3 {
    font-size: 0.9rem;
    color: var(--gold);
    text-transform: uppercase;
    margin-bottom: 1rem;
}

.summary-insights p {
    font-size: 1rem;
    line-height: 1.4;
    color: var(--text-main);
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold);
}