:root {
    --bg: #0f172a;
    --bg-gradient: radial-gradient(circle at top left, #1e1b4b, #0f172a);
    --card-bg: rgba(30, 41, 59, 0.65);
    --card-hover: rgba(30, 41, 59, 0.85);
    --primary: #00acec;
    --primary-hover: #008ec4;
    --primary-glow: rgba(0, 172, 236, 0.3);
    --success: #22c55e;
    --success-glow: rgba(34, 197, 94, 0.2);
    --warning: #f59e0b;
    --warning-glow: rgba(245, 158, 11, 0.2);
    --danger: #ef4444;
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --text-light: #cbd5e1;
    --border: rgba(255, 255, 255, 0.08);
    --font-main: 'Google Sans', 'Montserrat', sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: var(--font-main);
}

body {
    background: var(--bg-gradient);
    color: var(--text);
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Header & Navigation */
header {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 12px 24px;
    z-index: 100;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: white;
}

.logo-img {
    height: 34px;
    width: auto;
}

.brand-text {
    display: flex;
    flex-direction: column;
}

.brand-name {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.brand-tag {
    font-size: 0.7rem;
    color: var(--primary);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: var(--primary);
}

/* Fullscreen Main Container */
main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    flex-direction: column;
    height: calc(100vh - 120px);
}

/* Dashboard Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
}

.card-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* Control Row: Orb and Waveform side-by-side */
.control-row {
    display: flex;
    align-items: center;
    gap: 24px;
}

.orb-column {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 130px;
}

.waveform-column {
    flex: 1;
}

/* Waveform Canvas */
.waveform-canvas {
    width: 100%;
    height: 90px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 16px;
    border: 1px solid var(--border);
}

/* Orb styles */
.pulse-orb {
    width: 86px;
    height: 86px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary) 0%, rgba(0, 172, 236, 0.4) 100%);
    box-shadow: 0 0 20px var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    z-index: 2;
    transition: transform 0.2s, background 0.3s, box-shadow 0.3s;
}

.pulse-orb::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    border: 2px solid rgba(0, 172, 236, 0.2);
    animation: orb-ping 2s cubic-bezier(0, 0, 0.2, 1) infinite;
    z-index: 1;
}

.pulse-orb.listening {
    background: radial-gradient(circle, var(--warning) 0%, rgba(245, 158, 11, 0.4) 100%);
    box-shadow: 0 0 30px var(--warning-glow);
}

.pulse-orb.listening::before {
    border-color: rgba(245, 158, 11, 0.4);
}

@keyframes orb-ping {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.3);
        opacity: 0;
    }
}

.pulse-orb-icon {
    font-size: 2rem;
    color: white;
}

.pulse-orb-status {
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 8px;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 1px;
    text-align: center;
}

.pulse-orb-status.listening {
    color: var(--warning);
}

/* Textarea Output */
.output-area {
    width: 100%;
    flex: 1;
    min-height: 150px;
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 20px;
    color: white;
    font-family: 'Google Sans', sans-serif;
    font-size: 1.45rem;
    line-height: 1.6;
    resize: none;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.output-area:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 14px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    transition: background 0.2s, transform 0.1s;
    outline: none;
    text-decoration: none;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--primary);
    color: #0f172a;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: white;
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: var(--success);
    color: #0f172a;
}

.btn-success:hover {
    background: #16a34a;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Footer */
footer {
    background: rgba(15, 23, 42, 0.9);
    border-top: 1px solid var(--border);
    padding: 12px;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: auto;
}

footer a {
    color: var(--primary);
    text-decoration: none;
}
