/* assets/css/style.css */
/* Premium CSS Design System with Typography, Glassmorphism, and Slide-up Mobile Modals */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&family=Instrument+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400;1,500;1,600&display=swap');

/* Typography – Raw tokens (Layer 2) */
:root {
    --font-cormorant-garamond: 'Cormorant Garamond', serif;
    --font-instrument-sans: 'Instrument Sans', sans-serif;
    --text-12: 12px;
    --text-13: 13px;
    --text-14: 14px;
    --text-15: 15px;
    --text-16: 16px;
    --text-17: 17px;
    --text-18: 18px;
    --text-20: 20px;
    --text-24: 24px;
    --text-25: 25px;
    --text-35: 35px;
    --text-56: 56px;
    --tracking-neg-1-12: -1.12px;
    --tracking-neg-0-704: -0.704px;
    --tracking-neg-0-4: -0.4px;
    --tracking-neg-0-368: -0.368px;

    /* Colors */
    --color-white: #ffffff;
    --color-linen: #ece9e6;
    --color-linen-1: #f8f2e6;
    --color-light-gray: #d8cfc5;
    --color-dark-gray: #b3a290;
    --color-pastel-orange: #ecbd5e;
    --color-tomato: #ef4444;
    --color-gray: #a19384;
    --color-cadet-blue: #56ad6a;
    --color-crimson: #d02e2e;
    --color-lime-green: #22c55e;
    --color-charcoal: #493728;
    --color-charcoal-1: #49443f;
    --color-charcoal-2: #575048;
    --color-charcoal-3: #6a503a;
    --color-black: #000000;

    /* Semantics */
    --bg-main: var(--color-linen);
    --bg-surface: rgba(255, 255, 255, 0.82);
    --bg-surface-solid: var(--color-white);
    --bg-card: var(--color-linen-1);
    --border-color: var(--color-light-gray);
    --border-color-active: var(--color-dark-gray);

    --text-primary: var(--color-charcoal);
    --text-secondary: var(--color-charcoal-2);
    --text-muted: var(--color-gray);

    --color-primary: var(--color-charcoal-3);
    --color-primary-hover: var(--color-charcoal);

    --shadow-sm: 0 2px 8px -1px rgba(73, 55, 40, 0.06);
    --shadow-md: 0 10px 25px -5px rgba(73, 55, 40, 0.1), 0 8px 10px -6px rgba(73, 55, 40, 0.05);
    --shadow-lg: 0 20px 40px -10px rgba(73, 55, 40, 0.15);

    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-border: rgba(216, 207, 197, 0.6);
    --glass-blur: blur(16px);

    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-full: 9999px;

    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Typography – Semantic type styles (Layer 1) */
.type-h1 {
    font-family: var(--font-cormorant-garamond);
    font-size: var(--text-56);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: var(--tracking-neg-1-12);
}

.type-h3 {
    font-family: var(--font-cormorant-garamond);
    font-size: var(--text-35);
    font-weight: 700;
    line-height: normal;
    letter-spacing: var(--tracking-neg-0-704);
}

.type-heading {
    font-family: var(--font-cormorant-garamond);
    font-size: var(--text-25);
    font-weight: 800;
    line-height: normal;
}

.type-heading-25 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-25);
    font-weight: 800;
    line-height: normal;
}

.type-heading-24 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-24);
    font-weight: 800;
    line-height: normal;
}

.type-heading-24-800 {
    font-family: var(--font-cormorant-garamond);
    font-size: var(--text-24);
    font-weight: 800;
    line-height: normal;
}

.type-button {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-24);
    font-weight: 400;
    line-height: normal;
}

.type-h3-20 {
    font-family: var(--font-cormorant-garamond);
    font-size: var(--text-20);
    font-weight: 700;
    line-height: normal;
    letter-spacing: var(--tracking-neg-0-4);
}

.type-h4 {
    font-family: var(--font-cormorant-garamond);
    font-size: var(--text-18);
    font-weight: 700;
    line-height: normal;
    letter-spacing: var(--tracking-neg-0-368);
}

.type-body {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-17);
    font-weight: 400;
    line-height: 1.66;
}

.type-heading-16 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-16);
    font-weight: 600;
    line-height: normal;
}

.type-link {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-16);
    font-weight: 600;
    line-height: normal;
}

.type-body-16 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-16);
    font-weight: 400;
    line-height: normal;
}

.type-body-16-400 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-16);
    font-weight: 400;
    line-height: normal;
}

.type-link-15 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-15);
    font-weight: 500;
    line-height: normal;
}

.type-body-15 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-15);
    font-weight: 400;
    line-height: 1.52;
}

.type-small-body {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-14);
    font-weight: 400;
    line-height: normal;
}

.type-subheading {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-14);
    font-weight: 600;
    line-height: normal;
}

.type-small-body-14 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-14);
    font-weight: 400;
    line-height: normal;
}

.type-body-14 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-14);
    font-weight: 400;
    line-height: 1.44;
}

.type-body-14-400 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-14);
    font-weight: 400;
    line-height: 1.65;
}

.type-button-13 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-13);
    font-weight: 600;
    line-height: normal;
}

.type-link-13 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-13);
    font-weight: 600;
    line-height: normal;
}

.type-body-13 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-13);
    font-weight: 400;
    line-height: normal;
}

.type-caption {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-12);
    font-weight: 700;
    line-height: normal;
}

.type-caption-12 {
    font-family: var(--font-instrument-sans);
    font-size: var(--text-12);
    font-weight: 400;
    line-height: normal;
}

/* ==========================================================================
   BASE STYLES & RESET
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-instrument-sans);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    background-image:
        radial-gradient(at 0% 0%, rgba(73, 55, 40, 0.02) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(236, 189, 94, 0.03) 0px, transparent 50%);
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-cormorant-garamond);
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    outline: none;
    font-family: inherit;
}

/* Scrollbar Style */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-main);
}

::-webkit-scrollbar-thumb {
    background: rgba(73, 55, 40, 0.15);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-primary);
}

/* ==========================================================================
   CAPSULE Floating Header
   ========================================================================== */
.header-wrapper {
    position: fixed;
    top: 20px;
    left: 0;
    width: 100%;
    z-index: 1000;
    padding: 0 20px;
    pointer-events: none;
}

.main-header {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    padding: 8px 24px;
    border-radius: var(--radius-full);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: var(--shadow-md);
    pointer-events: auto;
    transition: var(--transition-smooth);
}

.main-header:hover {
    border-color: var(--border-color-active);
    box-shadow: 0 0 20px rgba(73, 55, 40, 0.06);
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-cormorant-garamond);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-primary);
    cursor: pointer;
}

.logo-dot {
    width: 8px;
    height: 8px;
    background-color: var(--color-pastel-orange);
    border-radius: var(--radius-full);
    display: inline-block;
    animation: pulse 2.5s infinite ease-in-out;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 0.5;
    }

    50% {
        transform: scale(1.4);
        opacity: 1;
    }
}

.desktop-nav-menu {
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-link {
    font-weight: 600;
    font-size: 0.95rem;
    padding: 10px 18px;
    border-radius: var(--radius-full);
    color: var(--text-secondary);
    transition: var(--transition-fast);
    cursor: pointer;
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-primary);
    background: rgba(73, 55, 40, 0.05);
}

.nav-btn {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    padding: 10px 24px;
    transition: var(--transition-smooth);
    cursor: pointer;
    border: 1px solid var(--color-primary);
}

.nav-btn:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 5px 12px rgba(73, 55, 40, 0.15);
}

.nav-btn-secondary {
    background: transparent;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.95rem;
    border-radius: var(--radius-full);
    padding: 10px 24px;
    border: 1px solid var(--border-color);
    transition: var(--transition-fast);
    cursor: pointer;
}

.nav-btn-secondary:hover {
    background: rgba(73, 55, 40, 0.05);
    border-color: var(--border-color-active);
}

/* Hamburger menu button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 22px;
    height: 16px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1010;
}

.hamburger span {
    width: 100%;
    height: 2px;
    background-color: var(--text-primary);
    border-radius: var(--radius-full);
    transition: var(--transition-fast);
}

.hamburger.open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.hamburger.open span:nth-child(2) {
    opacity: 0;
}

.hamburger.open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ==========================================================================
   MOBILE DRAWER NAVIGATION
   ========================================================================== */
.nav-menu {
    position: fixed;
    inset: 0;
    background: rgba(73, 55, 40, 0.5);
    backdrop-filter: blur(8px);
    z-index: 2010;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
    display: flex !important;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0 !important;
}

.nav-menu.open {
    opacity: 1;
    pointer-events: auto;
}

.nav-menu-content {
    background: var(--bg-surface-solid);
    width: 100%;
    margin: 0;
    left: 0;
    right: 0;
    border-radius: 0 0 24px 24px;
    padding: 20px 24px 28px 24px;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 8px 32px rgba(73, 55, 40, 0.15);
    transform: translateY(-100%);
    transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 0;
    box-sizing: border-box;
}

.nav-menu.open .nav-menu-content {
    transform: translateY(0);
}

.mobile-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 16px;
    margin-bottom: 20px;
}

.mobile-menu-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-secondary);
    line-height: 1;
}

.mobile-menu-links {
    display: flex;
    flex-direction: column;
    gap: 0;
}

#mobile-auth-links-mount {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.mobile-menu-links .nav-link {
    font-size: 1.1rem;
    padding: 16px 0;
    border-bottom: 1px solid rgba(73, 55, 40, 0.06);
    width: 100%;
    text-align: left;
    color: var(--text-secondary);
    display: block;
    transition: color 0.2s ease;
    background: none !important;
    border-radius: 0 !important;
}

.mobile-menu-links .nav-link:hover,
.mobile-menu-links .nav-link.active {
    color: var(--text-primary);
}

/* Styled filled buttons in mobile menu */
.mobile-menu-links button.nav-btn,
.mobile-menu-links button.nav-btn-secondary,
.mobile-menu-links #mobile-auth-links-mount button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    width: 100%;
    background: var(--color-primary);
    color: var(--color-white) !important;
    border: 1px solid var(--color-primary);
    transition: var(--transition-smooth);
    box-sizing: border-box;
}

/* Add margin-top to the first button inside the container to separate it from navigation links */
.mobile-menu-links button:first-of-type,
#mobile-auth-links-mount button:first-of-type {
    margin-top: 24px;
}

.mobile-menu-links button.nav-btn:hover,
.mobile-menu-links button.nav-btn-secondary:hover,
.mobile-menu-links #mobile-auth-links-mount button:hover {
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(73, 55, 40, 0.15);
}

/* Logout button custom red styling on mobile */
.mobile-menu-links button[onclick*="handleLogout"] {
    background: var(--color-tomato) !important;
    border-color: var(--color-tomato) !important;
}

.mobile-menu-links button[onclick*="handleLogout"]:hover {
    background: var(--color-crimson) !important;
    border-color: var(--color-crimson) !important;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.2) !important;
}

/* ==========================================================================
   APP PAGE SHELL & SPA CONTENT WRAPPER
   ========================================================================== */
#app {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 100px;
    min-height: calc(100vh - 100px);
}

.page-section {
    padding: 24px 10px 60px;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    animation: fadeIn 0.4s ease-out forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   HOMEPAGE
   ========================================================================== */
.hero-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding-top: 30px;
    /*padding-bottom: 50px;*/
}

.hero-content h1 {
    font-size: 3.4rem;
    line-height: 1.15;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.hero-content h1 span {
    color: var(--color-pastel-orange);
}

.hero-content p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 36px;
}

.hero-stats {
    display: flex;
    gap: 40px;
    justify-content: center;
    padding-top: 30px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: 200px;
}

@media (min-width: 769px) {
    .stat-item.border-left-desktop {
        border-left: 1px solid var(--border-color);
        padding-left: 40px;
    }
}

.stat-item h3 {
    font-size: 2.2rem;
    color: var(--color-primary);
    font-weight: 700;
}

.stat-item p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   SKELETON LOADER
   ========================================================================== */
.skeleton-shimmer {
    background: linear-gradient(90deg, #ece9e6 25%, #f4f1ed 37%, #ece9e6 63%);
    background-size: 400% 100%;
    animation: shimmer 1.4s ease infinite;
}

@keyframes shimmer {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0 50%;
    }
}

/* ==========================================================================
   DASHBOARD WORKSPACE Layout
   ========================================================================== */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1.8fr 1.2fr;
    gap: 30px;
    margin-top: 20px;
}

#recording-panel-mount {
    align-self: start;
}

#device-capsule-mount,
#calendar-card-mount {
    margin-bottom: 24px;
}

@media (min-width: 993px) {
    .dashboard-sidebar {
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    #calendar-card-mount {
        flex: 1;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
    }
    .calendar-widget {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }
}

@media (max-width: 992px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        display: contents;
    }

    #device-capsule-mount {
        order: 1;
        margin-bottom: 0;
    }

    #recording-panel-mount {
        order: 2;
    }

    #calendar-card-mount {
        order: 3;
        margin-bottom: 0;
    }

    #recent-recordings-card-mount {
        order: 4;
    }
}

.dashboard-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow-sm);
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.dashboard-card:hover {
    border-color: var(--border-color-active);
    box-shadow: var(--shadow-md);
}

.dashboard-card-title {
    font-size: 1.4rem;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

/* Sound Wave Equalizer Box */
.soundwave-box {
    height: 120px;
    background: rgba(73, 55, 40, 0.03);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.soundwave-bar {
    width: 6px;
    height: 10px;
    background-color: var(--color-primary);
    border-radius: var(--radius-full);
    transition: height 0.1s ease;
}

.soundwave-box.active .soundwave-bar {
    background-color: var(--color-pastel-orange);
    animation: equalize 1.2s ease-in-out infinite alternate;
}

.soundwave-box.active .soundwave-bar:nth-child(2) {
    animation-delay: 0.1s;
    animation-duration: 0.8s;
}

.soundwave-box.active .soundwave-bar:nth-child(3) {
    animation-delay: 0.25s;
    animation-duration: 1.4s;
}

.soundwave-box.active .soundwave-bar:nth-child(4) {
    animation-delay: 0.05s;
    animation-duration: 1.0s;
}

.soundwave-box.active .soundwave-bar:nth-child(5) {
    animation-delay: 0.3s;
    animation-duration: 0.6s;
}

.soundwave-box.active .soundwave-bar:nth-child(6) {
    animation-delay: 0.15s;
    animation-duration: 1.1s;
}

.soundwave-box.active .soundwave-bar:nth-child(7) {
    animation-delay: 0.4s;
    animation-duration: 0.9s;
}

.soundwave-box.active .soundwave-bar:nth-child(8) {
    animation-delay: 0.2s;
    animation-duration: 1.3s;
}

@keyframes equalize {
    0% {
        height: 10px;
    }

    100% {
        height: 70px;
    }
}

.recording-status-indicator {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-dot-active {
    width: 8px;
    height: 8px;
    background-color: var(--color-lime-green);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--color-lime-green);
    display: inline-block;
    animation: statusPulse 1.5s infinite;
}

@keyframes statusPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }
}

/* Stats capsule grids */
.stats-capsule-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .stats-capsule-grid {
        grid-template-columns: 1fr;
    }
}

.stat-capsule {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-capsule-icon {
    font-size: 1.3rem;
    color: var(--color-primary);
    width: 40px;
    height: 40px;
    background: rgba(73, 55, 40, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-capsule-info h4 {
    font-family: var(--font-instrument-sans);
    font-size: 1.15rem;
    font-weight: 700;
}

.stat-capsule-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Live speech to text area */
.live-transcript-box {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    height: 250px;
    overflow-y: auto;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
}

.live-transcript-box:empty::before {
    content: "Live meeting speech transcription will stream here in real-time...";
    color: var(--text-muted);
    font-style: italic;
}

.btn-record-toggle {
    width: 100%;
    padding: 15px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition-smooth);
    border: none;
}

.btn-record-toggle.off {
    background: var(--color-lime-green);
    color: var(--color-white);
}

.btn-record-toggle.off:hover {
    background: #1ca54d;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.3);
}

.btn-record-toggle.on {
    background: var(--color-tomato);
    color: var(--color-white);
    animation: btnPulse 2s infinite;
}

@keyframes btnPulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    50% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }
}

/* Calendar Card */
.calendar-widget {
    margin-bottom: 24px;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    text-align: center;
}

.calendar-day-header {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    padding-bottom: 8px;
    text-transform: uppercase;
}

.calendar-cell {
    aspect-ratio: 1;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-fast);
    background: rgba(73, 55, 40, 0.02);
    border: 1px solid transparent;
}

.calendar-cell:hover {
    background: rgba(73, 55, 40, 0.06);
}

.calendar-cell.active {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 700;
}

.calendar-cell.has-recordings::after {
    content: '';
    position: absolute;
    bottom: 4px;
    width: 4px;
    height: 4px;
    background: var(--color-pastel-orange);
    border-radius: 50%;
}

/* Skeleton Loader Shimmer Effect */
.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(73, 55, 40, 0.04) 25%, rgba(73, 55, 40, 0.09) 37%, rgba(73, 55, 40, 0.04) 63%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
}

@keyframes skeleton-loading {
    0% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Recent list card */
.recent-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.recent-item {
    padding: 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition-fast);
    cursor: pointer;
}

.recent-item:hover {
    border-color: var(--border-color-active);
    background: var(--color-white);
}

.recent-item-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.recent-item-info p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.recent-item-meta {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
}

/* ==========================================================================
   BRAIN / RECORDINGS LISTING
   ========================================================================== */
.brain-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.search-box-wrapper {
    position: relative;
    max-width: 400px;
    width: 100%;
}

.search-box-input {
    width: 100%;
    padding: 12px 20px 12px 45px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    background: var(--bg-surface-solid);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.search-box-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 10px rgba(73, 55, 40, 0.05);
}

.search-box-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-box-calendar-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    padding: 0;
}

.search-box-calendar-btn:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.search-box-calendar-btn.active {
    background: var(--color-primary) !important;
    color: var(--color-white) !important;
}

.recording-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 15px;
    align-items: stretch;
}

.recording-box {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    transition: var(--transition-smooth);
    position: relative;
}

.recording-box:hover {
    transform: translateY(-3px);
    border-color: var(--border-color-active);
    box-shadow: var(--shadow-md);
}

.recording-box-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.recording-box-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    max-width: 80%;
    line-height: 1.3;
}

.recording-box-actions {
    display: flex;
    gap: 8px;
}

.action-btn-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(73, 55, 40, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-fast);
}

.action-btn-small:hover {
    background: var(--color-primary);
    color: var(--color-white);
    border-color: var(--color-primary);
}

.action-btn-small.delete:hover {
    background: var(--color-tomato);
    border-color: var(--color-tomato);
}

.recording-box-body {
    flex: 1;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recording-box-footer {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(73, 55, 40, 0.05);
    padding-top: 12px;
}

.recording-box-footer span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ==========================================================================
   MYTH UNIVERSAL AI CHAT WINDOW
   ========================================================================== */
.myth-chat-container {
    height: 60vh;
    min-height: 480px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.myth-chat-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    gap: 12px;
}

.myth-chat-header-info h3 {
    font-size: 1.2rem;
    font-weight: 700;
}

.myth-chat-header-info p {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.chat-message-list {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.chat-message {
    max-width: 97%;
    padding: 12px 18px;
    border-radius: var(--radius-md);
    line-height: 1.5;
    font-size: 0.95rem;
}

.chat-message.system {
    align-self: flex-start;
    background: var(--bg-card);
    color: var(--text-primary);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--border-color);
}

.chat-message.user {
    align-self: flex-end;
    background: var(--color-primary);
    color: var(--color-white);
    border-bottom-right-radius: 4px;
}

.chat-input-bar {
    padding: 16px 24px;
    border-top: 1px solid var(--border-color);
    background: var(--bg-surface-solid);
    display: flex;
    gap: 12px;
}

.chat-input-field {
    flex: 1;
    padding: 14px 20px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.chat-input-field:focus {
    border-color: var(--color-primary);
}

.chat-send-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-primary);
    color: var(--color-white);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: var(--transition-fast);
}

.chat-send-btn:hover {
    background: var(--color-primary-hover);
    transform: scale(1.05);
}

.typing-indicator {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 10px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: var(--text-muted);
    border-radius: 50%;
    animation: typingPulse 1s infinite alternate;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typingPulse {
    from {
        transform: translateY(0);
        opacity: 0.4;
    }

    to {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* ==========================================================================
   SETTINGS PANEL & UTILS
   ========================================================================== */
.settings-section-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-top: 30px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    font-size: 0.95rem;
    background: var(--color-white);
    transition: var(--transition-fast);
}

.form-control:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 8px rgba(73, 55, 40, 0.05);
}

.password-input-container {
    position: relative;
    width: 100%;
}

.password-toggle-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 0.95rem;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s ease;
}

.password-toggle-btn:hover {
    color: var(--text-primary);
}

.password-input-container .form-control {
    padding-right: 40px;
}

.usage-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.usage-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 20px;
    text-align: center;
}

.usage-card h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--color-primary);
}

.usage-card p {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

/* ==========================================================================
   GLOBAL MODALS & MOBILE SLIDE-UP DRAWERS
   ========================================================================== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(73, 55, 40, 0.4);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.modal-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    max-width: 500px;
    width: 95%;
    box-shadow: var(--shadow-lg);
    position: relative;
    transform: scale(0.92);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (min-width: 769px) {
    .modal-content.modal-large {
        max-width: 850px;
        width: 90%;
    }

    .modal-overlay.chat-modal-layout .modal-content {
        height: 650px;
        max-height: 85vh;
        display: flex;
        flex-direction: column;
    }

    .modal-overlay.chat-modal-layout #modal-body-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        min-height: 0;
    }
}

.modal-overlay.open .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-muted);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Facebook Bottom-to-Top Slide-up Auth Drawer on Mobile */
@media (max-width: 768px) {

    .modal-overlay#auth-modal,
    .modal-overlay#edit-title-modal,
    .modal-overlay#space-action-modal,
    .modal-overlay#device-offline-modal,
    .modal-overlay#memory-calendar-modal {
        align-items: flex-end;
        /* Align to bottom */
    }

    .auth-drawer-content {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        /* Rounded top corners only */
        margin: 0 !important;
        padding: 30px 24px 40px !important;
        box-shadow: 0 -10px 30px rgba(73, 55, 40, 0.15) !important;
        transform: translateY(100%) !important;
        /* Offscreen bottom */
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .modal-overlay#auth-modal.open .auth-drawer-content,
    .modal-overlay#edit-title-modal.open .auth-drawer-content,
    .modal-overlay#space-action-modal.open .auth-drawer-content,
    .modal-overlay#device-offline-modal.open .auth-drawer-content,
    .modal-overlay#memory-calendar-modal.open .auth-drawer-content {
        transform: translateY(0) !important;
        /* Slide up to view */
    }

    /* Pull down visual bar/handle */
    .mobile-drawer-handle {
        width: 40px;
        height: 5px;
        background-color: var(--border-color);
        border-radius: var(--radius-full);
        margin: -15px auto 20px;
        display: block;
    }
}

@media (min-width: 769px) {
    .mobile-drawer-handle {
        display: none;
    }

    .auth-drawer-content {
        max-width: 450px !important;
        border-radius: var(--radius-lg) !important;
        padding: 35px 30px !important;
    }
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    padding: 60px 20px 30px;
    margin-top: auto;
}

.footer-inner {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 40px;
    margin-bottom: 40px;
}

@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.footer-brand .footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-cormorant-garamond);
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 15px;
}

.footer-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(73, 55, 40, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.footer-social a:hover {
    background: var(--color-primary);
    color: var(--color-white);
}

.footer-col h4 {
    font-size: 1.1rem;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    font-size: 0.9rem;
    color: var(--text-secondary);
    transition: var(--transition-fast);
}

.footer-links a:hover {
    color: var(--text-primary);
    padding-left: 4px;
}

.footer-contact li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    border-top: 1px solid var(--border-color);
    padding-top: 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   RESPONSIVENESS AND UTILITIES
   ========================================================================== */
@media (max-width: 1024px) {
    .desktop-nav-menu {
        display: none;
    }

    .hamburger {
        display: flex;
    }

    .hero-content h1 {
        font-size: 2.6rem;
    }
}

@media (max-width: 576px) {
    .stats-capsule-grid {
        grid-template-columns: 1fr;
    }

    .hero-content h1 {
        font-size: 2.1rem;
    }

    .dashboard-card {
        padding: 20px;
    }
}

/* Settings Responsive Layout & Ordering */
.settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.settings-col {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

@media (max-width: 992px) {
    .settings-grid {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .settings-col {
        display: contents;
    }

    .section-hardware {
        order: 1;
    }

    .section-usage {
        order: 2;
    }

    .section-wifi {
        order: 3;
    }

    .section-api {
        order: 4;
    }
}

@media (min-width: 993px) {
    .usage-stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .usage-stats-grid .usage-card {
        grid-column: auto !important;
    }
}


/* ==========================================================================
   HOMEPAGE NEW SECTIONS (VIDEO, FEATURES, WHY CHOOSE, FAQ)
   ========================================================================== */

/* Homepage Video Player Section */
.video-section {
    margin-bottom: 80px;
    margin-top: 50px;
}

.video-wrapper {
    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow-lg);
    background: var(--bg-surface-solid);
}

.video-thumbnail {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    cursor: pointer;
    z-index: 2;
    transition: opacity 0.5s ease;
}

.video-thumbnail::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.5) 0%, transparent 50%);
    pointer-events: none;
}

.video-thumbnail.hidden {
    opacity: 0;
    pointer-events: none;
}

.video-play-btn {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #fff;
    font-size: 1.8rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 3;
    padding: 0;
}

.video-play-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translate(-50%, -50%) scale(1.08);
    border-color: #fff;
}

.video-iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.video-iframe iframe {
    width: 100%;
    height: 100%;
    border: none;
}

@media (max-width: 768px) {
    .video-play-btn {
        width: 60px;
        height: 60px;
        font-size: 1.4rem;
    }
}

/* Why Choose Us & Features Header */
.section-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 50px auto;
}

.section-header h2 {
    font-family: var(--font-cormorant-garamond);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.feature-card {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 32px;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--border-color-active);
    background: var(--bg-surface-hover);
}

.feature-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    background: rgba(73, 55, 40, 0.08);
    color: var(--color-pastel-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 24px;
}

.feature-card h3 {
    margin-bottom: 12px;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.feature-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
}

/* FAQ Section Styling */
.faq-accordion {
    max-width: 800px;
    margin: 0 auto 80px auto;
}

.faq-item {
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 15px;
    overflow: hidden;
    transition: var(--transition-fast);
}

.faq-question {
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    font-weight: 600;
    font-size: 1.05rem;
    user-select: none;
    transition: var(--transition-fast);
    color: var(--text-primary);
}

.faq-question:hover {
    color: var(--color-pastel-orange);
}

.faq-answer {
    max-height: 0;
    overflow: hidden;
    padding: 0 24px;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    transition: max-height var(--transition-smooth), padding var(--transition-smooth);
}

.faq-item.active {
    border-color: var(--border-color-active);
}

.faq-item.active .faq-answer {
    max-height: 200px;
    padding-bottom: 20px;
}

.faq-icon {
    transition: transform var(--transition-fast);
    color: var(--text-secondary);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
    color: var(--color-pastel-orange);
}

/* Mobile Bottom Drawer layout for Global Modal (Recording details, etc) */
@media (max-width: 768px) {
    .modal-overlay#global-modal {
        align-items: flex-end !important;
    }

    .modal-overlay#global-modal .modal-content {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 80vh !important;
        /* Open more than half of the screen */
        border-radius: 24px 24px 0 0 !important;
        margin: 0 !important;
        /*padding: 24px 20px 40px !important;*/
        padding: 15px 8px 8px !important;
        box-shadow: 0 -10px 30px rgba(73, 55, 40, 0.15) !important;
        transform: translateY(100%) !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
        display: flex !important;
        flex-direction: column !important;
    }

    .modal-overlay#global-modal.open .modal-content {
        transform: translateY(0) !important;
    }

    .modal-overlay#global-modal #modal-body-content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .modal-overlay#global-modal .recording-details-view {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        max-height: calc(90vh - 80px) !important;
        overflow: hidden !important;
    }

    .modal-overlay#global-modal .recording-details-grid {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        gap: 15px !important;
    }

    /* AI Summary section on mobile - Share height dynamically based on open state */
    .modal-overlay#global-modal .summary-section-wrapper {
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        margin-bottom: 15px !important;
    }

    .modal-overlay#global-modal .summary-section-wrapper.open-section {
        flex: 1 !important;
    }

    .modal-overlay#global-modal #modal-summary-content {
        flex: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
    }

    /* Full Text Transcript section on mobile - Share height dynamically based on open state */
    .modal-overlay#global-modal .transcript-section-wrapper {
        flex: 0 0 auto !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    .modal-overlay#global-modal .transcript-section-wrapper.open-section {
        flex: 1 !important;
    }

    .modal-overlay#global-modal .transcript-content-box {
        flex: 1 !important;
        overflow-y: auto !important;
        min-height: 0 !important;
        max-height: none !important;
    }

    /* Responsive Download Button on Mobile: Hide text, make circular */
    .modal-overlay#global-modal .download-capsule-btn {
        padding: 8px 10px !important;
        border-radius: 50% !important;
        width: 42px !important;
        height: 42px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
    }

    .modal-overlay#global-modal .download-capsule-btn span {
        display: none !important;
    }

    .modal-overlay#global-modal .download-capsule-btn i {
        font-size: 1.25rem !important;
        margin-bottom: 0 !important;
    }

    /* Download Choice Popup on Mobile */
    .download-choice-overlay {
        align-items: flex-end !important;
    }

    .download-choice-card {
        width: 100% !important;
        max-width: 100% !important;
        border-radius: 24px 24px 0 0 !important;
        margin: 0 !important;
        transform: translateY(100%) !important;
        transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1) !important;
    }

    .download-choice-overlay.open-choice .download-choice-card {
        transform: translateY(0) !important;
    }
}

@media (max-width: 480px) {
    .modal-overlay#global-modal h3 {
        font-size: 1.25rem !important;
    }

    .modal-overlay#global-modal .type-caption-12 {
        font-size: 0.75rem !important;
    }
}

/* Download Capsule Button Custom Styling */
.download-capsule-btn {
    border-color: var(--border-color) !important;
    color: var(--text-primary) !important;
}

.download-capsule-btn:hover {
    background-color: var(--bg-surface-hover) !important;
    border-color: var(--border-color-active) !important;
}

/* Chat modal layout override on Desktop */
@media (min-width: 769px) {
    .modal-overlay.chat-modal-layout .modal-content {
        max-width: 800px !important;
        width: 90% !important;
        height: 80vh !important;
        min-height: 80vh !important;
        max-height: 80vh !important;
        display: flex !important;
        flex-direction: column !important;
        overflow: hidden !important;
    }

    .modal-overlay.chat-modal-layout #modal-body-content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }
}

/* Chat modal layout override on Mobile */
@media (max-width: 768px) {
    .modal-overlay#global-modal.chat-modal-layout .modal-content {
        height: 80vh !important;
        min-height: 80vh !important;
        max-height: 80vh !important;
        overflow: hidden !important;
        border-radius: 24px 24px 0 0 !important;
        margin: 0 !important;
        /* padding: 24px 20px 40px !important; */
        width: 100% !important;
        max-width: 100% !important;
    }

    .modal-overlay#global-modal.chat-modal-layout #modal-body-content {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
        max-height: 100% !important;
        overflow: hidden !important;
    }
}

/* Custom Toast notification responsive adaptation */
@media (max-width: 480px) {
    .custom-toast {
        left: 20px !important;
        right: 20px !important;
        bottom: 20px !important;
        justify-content: center !important;
    }
}

/* Skeleton loader shimmer animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -200% 0;
    }

    100% {
        background-position: 200% 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(90deg, rgba(73, 55, 40, 0.04) 25%, rgba(73, 55, 40, 0.1) 50%, rgba(73, 55, 40, 0.04) 75%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.5s infinite linear;
}

/* Stable quick fade-in for skeleton containers */
.page-section.skeleton-section {
    animation: fadeInSkeleton 0.2s ease-out forwards;
    transform: none !important;
}

@keyframes fadeInSkeleton {
    from {
        opacity: 0;
    }

    to {
        opacity: 0.85;
    }
}

/* Mobile Assistant Portal fullscreen styling */
@media (max-width: 768px) {
    .assistant-page-header {
        display: none !important;
    }

    .assistant-page-section {
        position: fixed !important;
        inset: 0 !important;
        top: 85px !important;
        /* Start right below the floating header wrapper */
        background: #ECE9E6 !important;
        /* Matches exactly the requested background color */
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        z-index: 950 !important;
        padding: 0 !important;
        margin: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-end !important;
    }

    .myth-chat-container {
        height: 85vh !important;
        /* Slide up more than half screen, leaving header area visible */
        max-height: calc(100vh - 100px) !important;
        min-height: 0 !important;
        border: none !important;
        border-top: 1px solid var(--border-color) !important;
        border-radius: 24px 24px 0 0 !important;
        /* Rounded top corners matching other chat models */
        box-shadow: 0 -10px 30px rgba(73, 55, 40, 0.15) !important;
        margin: 0 !important;
        background: var(--bg-surface-solid) !important;
        overflow: hidden !important;
        display: flex !important;
        flex-direction: column !important;

        /* Smooth bottom-to-top transition slide */
        transform: translateY(100vh);
        animation: slideUpAssistantMobile 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    .myth-chat-container .chat-message-list {
        padding: 15px !important;
    }

    .myth-chat-container .chat-input-bar {
        padding: 12px 15px !important;
        background: var(--bg-surface-solid) !important;
    }
}

@keyframes slideUpAssistantMobile {
    from {
        transform: translateY(100vh);
    }

    to {
        transform: translateY(0);
    }
}

/* Mobile responsive fixes for homepage stats and video margins */
@media (max-width: 768px) {
    .hero-stats {
        flex-direction: row !important;
        /* Force single row alignment */
        flex-wrap: nowrap !important;
        /* Prevent line wraps */
        gap: 8px !important;
        /* Reduce gap to fit perfectly */
        padding-top: 15px !important;
        margin-bottom: 25px !important;
        justify-content: space-between !important;
    }

    .hero-stats .stat-item {
        flex: 1 !important;
        min-width: 0 !important;
        /* Enable shrinking */
    }

    .hero-stats .stat-item:not(:first-child) {
        border-left: 1px solid var(--border-color) !important;
    }

    .hero-stats .stat-item h3 {
        font-size: 1.4rem !important;
        /* Responsive scaling for numbers */
    }

    .hero-stats .stat-item p {
        font-size: 0.72rem !important;
        /* Responsive scaling for descriptions */
        line-height: 1.2 !important;
    }

    .video-section {
        margin-top: 15px !important;
        margin-bottom: 40px !important;
    }
}

/* Recording Details Grid for Desktop (Responsive two-column view) */
.recording-details-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
    flex: 1;
    min-height: 0;
}

@media (min-width: 1025px) {
    .recording-details-grid {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
        align-items: stretch;
    }

    #modal-summary-content {
        max-height: 380px !important;
        height: 380px;
    }

    .recording-details-view .transcript-content-box {
        max-height: 380px !important;
        height: 380px;
    }

    .accordion-header {
        cursor: default !important;
        pointer-events: none;
    }

    .accordion-header .action-btn-small {
        pointer-events: auto;
    }

    .accordion-chevron {
        display: none !important;
    }

    .accordion-content {
        display: block !important;
    }

    .myth-chat-container {
        height: 75vh !important;
        min-height: 650px !important;
    }
}

/* Download capsule button responsive styling (horizontal layout on desktop) */
.download-capsule-btn {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    border-radius: 50px;
    padding: 8px 16px;
    background: transparent;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.2s;
    gap: 8px;
    height: 38px;
}

.download-capsule-btn i {
    font-size: 1.1rem;
    color: var(--text-primary);
}

.download-capsule-btn span {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
}

.download-capsule-btn:hover {
    background-color: var(--bg-surface-hover);
    border-color: var(--border-color-active);
}

/* Internet Issue Banner Toast */
.internet-issue-banner {
    background: rgba(220, 38, 38, 0.95);
    color: #fff;
    padding: 12px 24px;
    position: fixed;
    top: 90px;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 50px;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
    font-family: var(--font-instrument-sans);
    font-size: 0.9rem;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: slideDownBanner 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    width: auto;
    max-width: 90%;
    box-sizing: border-box;
}

.banner-message-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    text-align: left;
}

.banner-retry-btn {
    background: #fff;
    color: #dc2626;
    border: none;
    padding: 6px 16px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    white-space: nowrap;
    flex-shrink: 0;
}

.banner-retry-btn:hover {
    background: #fdf2f2;
    transform: scale(1.03);
}

@keyframes slideDownBanner {
    from {
        transform: translate(-50%, -20px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

/* Mobile responsive adjustments */
@media (max-width: 576px) {
    .internet-issue-banner {
        top: 80px;
        width: calc(100% - 32px);
        max-width: 420px;
        border-radius: var(--radius-md);
        padding: 12px 16px;
        gap: 10px;
        font-size: 0.85rem;
    }

    .banner-message-wrapper {
        gap: 8px;
    }
}

/* Space Card and Dropdown Styles */
.space-card-wrapper {
    position: relative;
    z-index: 1;
    transition: z-index 0s, border-radius var(--transition-fast), box-shadow var(--transition-fast);
}

.space-card-wrapper.dropdown-open {
    z-index: 150;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    box-shadow: var(--shadow-md);
}

.space-recordings-dropdown {
    position: absolute;
    top: calc(100% - 1px);
    left: -1px;
    right: -1px;
    background: var(--bg-surface-solid);
    border: 1px solid var(--border-color);
    border-top: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    padding: 16px 24px 24px;
    display: none;
    flex-direction: column;
    gap: 12px;
    z-index: 160;
    box-shadow: var(--shadow-md);
    max-height: 280px;
    overflow-y: auto;
}

/* Custom Settings Slider System */
.settings-slider-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    width: 100%;
}

.settings-slider {
    display: flex;
    background: rgba(73, 55, 40, 0.04);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    padding: 4px;
    width: 100%;
    position: relative;
    box-shadow: inset 0 1px 3px rgba(73, 55, 40, 0.05);
}

.settings-slider-tab {
    flex: 1;
    text-align: center;
    padding: 10px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    border-radius: var(--radius-full);
    z-index: 2;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: none;
    background: transparent;
}

.settings-slider-tab:hover {
    color: var(--text-primary);
}

.settings-slider-tab.active {
    color: var(--color-white) !important;
    background: var(--color-primary);
    /* matches the theme color style */
    box-shadow: var(--shadow-sm);
}

/* Small helper link styling under input boxes */
.input-helper-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 6px;
    display: block;
}

.input-helper-text a {
    color: var(--color-charcoal-3);
    text-decoration: underline;
    font-weight: 600;
    transition: color var(--transition-fast);
}

.input-helper-text a:hover {
    color: var(--color-charcoal);
}