/* Glassmorphic OS Dashboard Stylesheet */
:root {
    --color-bg-dark: #070414;
    --color-text: #FFFFFF;
    --color-text-dim: rgba(255, 255, 255, 0.6);

    /* Logo Brand Gradient Accents */
    --color-logo-violet: #5F3A80;
    --color-logo-orchid: #A64A85;
    --color-logo-slate: #7F7FB5;
    --color-logo-blue: #6E8FC9;

    /* Neon Glow Highlights */
    --color-cyan: #00F2FE;
    --color-cyan-glow: rgba(0, 242, 254, 0.35);
    --color-magenta: #F43F5E;
    --color-magenta-glow: rgba(244, 63, 94, 0.35);

    /* Glassmorphism Specs */
    --glass-bg: rgba(255, 255, 255, 0.04);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-blur: blur(24px) saturate(120%);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);

    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    --transition-spring: 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    --font-display: 'Outfit', sans-serif;
    --font-body: 'Plus Jakarta Sans', sans-serif;
}

/* Reset and Core Body Setup */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    background-color: var(--color-bg-dark);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.5;
}

body {
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 1.5rem 1rem;
}

@media (min-width: 768px) {
    body {
        padding: 3rem 2rem;
    }
}

/* Immersive Smooth Backdrop Gradient */
.mesh-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
    background: radial-gradient(circle at 80% 20%, #7d1c58 0%, transparent 55%),
        radial-gradient(circle at 15% 85%, #00d9e8 0%, transparent 55%),
        radial-gradient(circle at 50% 50%, #462c7a 0%, transparent 70%),
        #070414;
}

/* Faint Eastern Pattern Overlay (Watermark) */
.eastern-pattern-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 12;
    pointer-events: none;
    opacity: 0.12; /* Faint pale white watermark outline */
    background-image: url('pattern_white.png');
    background-size: 1040px auto; /* Scaled up 2x for optimal visual watermark balance */
    background-repeat: repeat;
}

/* OS Window Glass Wrapper */
.os-container {
    width: 100%;
    max-width: 1280px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px) saturate(140%);
    border-radius: 24px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* OS Navigation Header */
.os-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 2rem;
    border-bottom: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
}

.header-left,
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.os-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    outline: none;
    border: 2px solid transparent;
    padding: 0.25rem;
    border-radius: 8px;
}

.os-logo:focus-visible {
    border-color: var(--color-cyan);
}

.brand-logo {
    height: 32px;
    width: auto;
}

.brand-name {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-text);
    letter-spacing: -0.02em;
}

.os-nav ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

.os-nav .nav-link {
    text-decoration: none;
    color: var(--color-text-dim);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    outline: none;
    transition: color var(--transition-smooth), background-color var(--transition-smooth);
}

.os-nav .nav-link.active,
.os-nav .nav-link:hover,
.os-nav .nav-link:focus-visible {
    color: var(--color-text);
    background: rgba(255, 255, 255, 0.08);
}

/* Language Selection buttons */
.lang-selector {
    display: flex;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 2px;
    border: 1px solid var(--glass-border);
}

.lang-btn {
    border: none;
    background: transparent;
    color: var(--color-text-dim);
    padding: 0.3rem 0.7rem;
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    border-radius: 6px;
    font-family: var(--font-body);
    transition: color var(--transition-smooth), background-color var(--transition-smooth);
}

.lang-btn.active {
    background: rgba(255, 255, 255, 0.15);
    color: var(--color-text);
}

.lang-btn:not(.active):hover {
    color: var(--color-text);
}

/* OS Buttons Icons */
.os-btn-icon {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    outline: none;
    transition: background var(--transition-smooth), border-color var(--transition-smooth);
}

.os-btn-icon:hover,
.os-btn-icon:focus-visible {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--color-cyan);
}

.user-profile {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-logo-orchid), var(--color-logo-blue));
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Main Content Area */
.os-main {
    padding: 3rem 2rem 4rem 2rem;
}

/* Dashboard Hero */
.dashboard-hero {
    text-align: center;
    margin-bottom: 3.5rem;
}

.hero-text-container {
    max-width: 760px;
    margin: 0 auto;
}

.hero-eyebrow {
    font-family: var(--font-display);
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.15em;
    color: var(--color-cyan);
    margin-bottom: 0.75rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--color-text-dim);
    line-height: 1.6;
}

/* Search Bar Section */
.search-section {
    display: flex;
    justify-content: center;
    margin-bottom: 3.5rem;
    position: relative;
    z-index: 15;
}

.search-container {
    width: 100%;
    max-width: 680px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
}

/* Glassmorphic Suggestion Box for Autocomplete */
.suggest-box {
    position: absolute;
    top: 56px;
    left: 0;
    width: calc(100% - 130px);
    background: rgba(15, 10, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 16px;
    backdrop-filter: blur(25px) saturate(130%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    z-index: 999;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.suggest-item {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    transition: background-color var(--transition-smooth), color var(--transition-smooth);
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.suggest-item svg {
    width: 14px;
    height: 14px;
    color: rgba(255, 255, 255, 0.4);
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.suggest-item:hover,
.suggest-item.selected {
    background-color: rgba(255, 255, 255, 0.08);
    color: #FFFFFF;
}

.suggest-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

@media (max-width: 576px) {
    .suggest-box {
        width: 100%;
        top: 102px;
    }
}

.search-form {
    display: flex;
    width: 100%;
    gap: 0.75rem;
}

.search-input-wrapper {
    position: relative;
    flex-grow: 1;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50px;
    padding: 0.25rem 0.5rem 0.25rem 1.25rem;
    backdrop-filter: var(--glass-blur);
    box-shadow: var(--glass-shadow);
    transition: border-color var(--transition-smooth), box-shadow var(--transition-smooth);
}

.search-input-wrapper:focus-within {
    border-color: var(--color-cyan);
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.15), var(--glass-shadow);
}

.search-left-icon {
    font-size: 1rem;
    color: var(--color-text-dim);
    margin-right: 0.75rem;
    pointer-events: none;
    user-select: none;
}

.search-input {
    flex-grow: 1;
    border: none;
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    padding: 0.6rem 0;
}

.search-input::placeholder {
    color: var(--color-text-dim);
    opacity: 0.8;
}

.search-mic-btn {
    border: none;
    background: transparent;
    font-size: 1.15rem;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    transition: transform var(--transition-smooth), background-color var(--transition-smooth);
}

.search-mic-btn:hover {
    transform: scale(1.1);
    background-color: rgba(255, 255, 255, 0.08);
}

.search-submit-btn {
    background: linear-gradient(135deg, var(--color-logo-orchid), var(--color-logo-blue));
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    padding: 0 1.75rem;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(166, 74, 133, 0.25);
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), opacity var(--transition-smooth);
}

.search-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(166, 74, 133, 0.35);
    opacity: 0.95;
}

.search-submit-btn:active {
    transform: translateY(0);
}

.search-suggestions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

.suggestion-label {
    margin-right: 0.25rem;
    font-weight: 500;
}

.suggest-tag {
    color: var(--color-text-dim);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    transition: color var(--transition-smooth), border-color var(--transition-smooth), background-color var(--transition-smooth);
}

.suggest-tag:hover {
    color: var(--color-text);
    border-color: var(--color-cyan);
    background-color: rgba(255, 255, 255, 0.08);
}

/* Responsive adjustment for search bar on mobile */
@media (max-width: 576px) {
    .search-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    .search-submit-btn {
        padding: 0.8rem;
    }
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 4rem;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .dashboard-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    #widget-music,
    #widget-tv {
        grid-column: span 3;
    }

    #widget-translate,
    #widget-book,
    #widget-saif {
        grid-column: span 2;
    }
}

/* Glassmorphic Widget Cards */
.widget-card {
    background: rgba(255, 255, 255, 0.012);
    /* Almost fully transparent */
    border: 1px solid rgba(255, 255, 255, 0.12);
    /* Thin white border */
    backdrop-filter: blur(12px) saturate(110%);
    /* Subtle separation blur */
    border-radius: 18px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform var(--transition-smooth), border-color var(--transition-smooth), box-shadow var(--transition-smooth);
    outline: none;
    position: relative;
    overflow: hidden;
}

.widget-card:hover,
.widget-card:focus-within {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.35);
    /* Bright white thin border on hover */
    box-shadow: 0 8px 32px 0 rgba(255, 255, 255, 0.05);
    /* Clean white soft shadow */
}

.widget-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.03) 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
}

/* Widget Header */
.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.75rem;
    z-index: 2;
}

.widget-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.widget-icon {
    font-size: 1.25rem;
}

.widget-title {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.widget-action-link {
    text-decoration: none;
    color: var(--color-text-dim);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.3rem 0.6rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 6px;
    outline: none;
    transition: color var(--transition-smooth), border-color var(--transition-smooth), background var(--transition-smooth);
}

.widget-action-link:hover,
.widget-action-link:focus-visible {
    color: var(--color-text);
    border-color: var(--color-cyan);
    background: rgba(255, 255, 255, 0.12);
}

/* 1. MUSIC PLAYER DETAILS */
.music-player-body {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    z-index: 2;
}

.waveform-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 6px;
    height: 48px;
    width: 100%;
}

.waveform-container .bar {
    width: 5px;
    height: 10%;
    background: linear-gradient(to top, var(--color-logo-orchid), var(--color-cyan));
    border-radius: 4px;
    animation: waveJump 1.4s infinite alternate ease-in-out;
}

/* Variable animation delay for bars */
.waveform-container .bar:nth-child(1) {
    animation-delay: 0.1s;
}

.waveform-container .bar:nth-child(2) {
    animation-delay: 0.3s;
    height: 30%;
}

.waveform-container .bar:nth-child(3) {
    animation-delay: 0.5s;
    height: 50%;
}

.waveform-container .bar:nth-child(4) {
    animation-delay: 0.2s;
    height: 75%;
}

.waveform-container .bar:nth-child(5) {
    animation-delay: 0.6s;
    height: 40%;
}

.waveform-container .bar:nth-child(6) {
    animation-delay: 0.4s;
    height: 90%;
}

.waveform-container .bar:nth-child(7) {
    animation-delay: 0.7s;
    height: 60%;
}

.waveform-container .bar:nth-child(8) {
    animation-delay: 0.15s;
    height: 80%;
}

.waveform-container .bar:nth-child(9) {
    animation-delay: 0.35s;
    height: 35%;
}

.waveform-container .bar:nth-child(10) {
    animation-delay: 0.55s;
    height: 70%;
}

.waveform-container .bar:nth-child(11) {
    animation-delay: 0.25s;
    height: 20%;
}

.waveform-container .bar:nth-child(12) {
    animation-delay: 0.45s;
    height: 45%;
}

.track-info {
    text-align: center;
}

.track-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.track-artist {
    font-size: 0.85rem;
    color: var(--color-text-dim);
}

.player-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
}

.ctrl-btn {
    border: none;
    background: transparent;
    color: var(--color-text-dim);
    font-size: 1.1rem;
    cursor: pointer;
    outline: none;
    transition: color var(--transition-smooth), transform var(--transition-smooth);
}

.ctrl-btn:hover,
.ctrl-btn:focus-visible {
    color: var(--color-text);
    transform: scale(1.1);
}

.ctrl-btn.play-pause {
    background: var(--color-text);
    color: var(--color-bg-dark);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.25);
    transition: background var(--transition-smooth), box-shadow var(--transition-smooth), transform var(--transition-smooth);
}

.ctrl-btn.play-pause:hover,
.ctrl-btn.play-pause:focus-visible {
    background: var(--color-cyan);
    box-shadow: 0 4px 20px var(--color-cyan-glow);
    transform: scale(1.05);
}

.progress-bar-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
}

.progress-bar-group .time {
    font-size: 0.75rem;
    color: var(--color-text-dim);
    width: 35px;
}

.progress-slider {
    flex-grow: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--color-logo-orchid), var(--color-cyan));
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
}

.progress-thumb {
    width: 12px;
    height: 12px;
    background: var(--color-text);
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.progress-slider:hover .progress-thumb {
    opacity: 1;
}

/* 2. TV CARD DETAILS */
.tv-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    z-index: 2;
}

.video-preview {
    width: 100%;
    max-width: 320px; /* Limit width to maintain natural 16:9 monitor proportion */
    margin: 0 auto; /* Center horizontally inside TV card */
    aspect-ratio: 16/9;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #181236 0%, #0C0824 100%);
}

/* Stylized movie clip backdrop */
.video-preview::after {
    content: '';
    position: absolute;
    top: 30%;
    left: 30%;
    width: 40%;
    height: 40%;
    background: radial-gradient(circle, var(--color-logo-blue) 0%, transparent 70%);
    filter: blur(20px);
    opacity: 0.6;
}

.video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    z-index: 3;
}

.play-overlay-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    color: var(--color-text);
    font-size: 1.1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    outline: none;
    transition: transform var(--transition-spring), background var(--transition-smooth), border-color var(--transition-smooth);
}

.play-overlay-btn:hover,
.play-overlay-btn:focus-visible {
    transform: scale(1.1);
    background: rgba(255, 255, 255, 0.25);
    border-color: var(--color-text);
}

.video-timeline-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 5;
}

.timeline-fill {
    height: 100%;
    background: var(--color-logo-blue);
}

.video-info h4 {
    font-family: var(--font-display);
    font-size: 1.05rem;
    font-weight: 600;
    margin-bottom: 0.2rem;
}

.video-info p {
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

/* 3. TRANSLATE WIDGET DETAILS */
.translate-body {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    z-index: 2;
}

.translate-languages {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--glass-border);
}

.lang-switch-arrow {
    color: var(--color-logo-orchid);
    font-size: 0.95rem;
}

.translate-input {
    width: 100%;
    height: 70px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.75rem;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.9rem;
    resize: none;
    outline: none;
}

.translate-output-group {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

.translate-output {
    flex-grow: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    padding: 0.75rem;
    font-size: 0.9rem;
    color: var(--color-text);
    min-height: 42px;
    display: flex;
    align-items: center;
}

.translate-btn {
    background: linear-gradient(135deg, var(--color-logo-violet), var(--color-logo-orchid));
    color: var(--color-text);
    border: none;
    border-radius: 10px;
    padding: 0 1.25rem;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    font-family: var(--font-body);
    transition: opacity var(--transition-smooth), transform var(--transition-smooth);
    outline: none;
}

.translate-btn:hover,
.translate-btn:focus-visible {
    opacity: 0.9;
    transform: translateY(-1px);
}

/* 4. DOYA BOOK WIDGET */
.book-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    justify-content: space-between;
    height: 100%;
    z-index: 2;
}

.book-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.book-item {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.book-details {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}

.book-name {
    font-family: var(--font-display);
    font-weight: 600;
}

.book-progress-percent {
    font-weight: 700;
    color: var(--color-logo-slate);
}

.book-progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.book-progress-fill {
    height: 100%;
    background: linear-gradient(to right, var(--color-logo-slate), var(--color-logo-blue));
    border-radius: 3px;
}

.add-book-btn {
    width: 100%;
    border: 1px dashed var(--glass-border);
    background: transparent;
    color: var(--color-text-dim);
    padding: 0.6rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.8rem;
    cursor: pointer;
    font-family: var(--font-body);
    transition: color var(--transition-smooth), border-color var(--transition-smooth), background var(--transition-smooth);
    outline: none;
}

.add-book-btn:hover,
.add-book-btn:focus-visible {
    color: var(--color-text);
    border-color: var(--color-logo-slate);
    background: rgba(255, 255, 255, 0.03);
}

/* 5. sAIf ASSISTANT DETAILS */
.saif-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    text-align: center;
    z-index: 2;
}

.saif-prompt {
    font-size: 0.95rem;
    font-weight: 500;
    min-height: 40px;
    max-width: 200px;
}

.saif-mic-container {
    position: relative;
    width: 72px;
    height: 72px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.saif-pulse-ring {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    border: 1px solid var(--color-cyan);
    opacity: 0.35;
    animation: micPulse 2.5s infinite ease-in-out;
}

.saif-mic-btn {
    border: 1px solid rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(8px);
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1.25rem;
    outline: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    transition: transform var(--transition-spring), background var(--transition-smooth), box-shadow var(--transition-smooth);
    z-index: 2;
}

.saif-mic-btn:hover,
.saif-mic-btn:focus-visible {
    transform: scale(1.05);
    background: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 20px var(--color-cyan-glow);
}

.saif-voice-waves {
    display: flex;
    gap: 4px;
    align-items: center;
    height: 20px;
}

.saif-voice-waves span {
    width: 3px;
    height: 4px;
    background: var(--color-cyan);
    border-radius: 2px;
    transition: height var(--transition-smooth);
}

.saif-status {
    font-size: 0.75rem;
    color: var(--color-text-dim);
}

/* Micro-waves animation class triggers on active state */
.saif-body.active-listening .saif-voice-waves span {
    animation: voiceActive 1s infinite alternate ease-in-out;
}

.saif-body.active-listening .saif-voice-waves span:nth-child(1) {
    animation-delay: 0.1s;
}

.saif-body.active-listening .saif-voice-waves span:nth-child(2) {
    animation-delay: 0.3s;
}

.saif-body.active-listening .saif-voice-waves span:nth-child(3) {
    animation-delay: 0s;
}

.saif-body.active-listening .saif-voice-waves span:nth-child(4) {
    animation-delay: 0.2s;
}

.saif-body.active-listening .saif-voice-waves span:nth-child(5) {
    animation-delay: 0.4s;
}

/* Mission / Sovereignty Section style */
.mission-section {
    grid-column: 1 / -1;
    z-index: 2;
}

.mission-card {
    background: rgba(13, 9, 29, 0.35);
}

.mission-card:hover {
    border-color: var(--color-logo-violet);
    box-shadow: 0 10px 40px rgba(95, 58, 128, 0.15);
}

.mission-badge {
    display: inline-block;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--glass-border);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--color-cyan);
    margin-bottom: 1.5rem;
}

.mission-title {
    font-family: var(--font-display);
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
    margin-bottom: 2.5rem;
}

.mission-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
}

@media (min-width: 900px) {
    .mission-grid {
        grid-template-columns: 1.1fr 0.9fr;
        gap: 5rem;
    }
}

.mission-text p {
    font-size: 1.05rem;
    color: var(--color-text-dim);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.mission-text p:last-child {
    margin-bottom: 0;
}

.mission-features {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.feat-item {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.feat-bullet {
    font-size: 1rem;
    color: var(--color-cyan);
    line-height: 1.2;
}

.feat-item h4 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.feat-item p {
    font-size: 0.9rem;
    color: var(--color-text-dim);
}

/* OS Footer */
.os-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 2rem;
    border-top: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.02);
    font-size: 0.8rem;
    color: var(--color-text-dim);
}

/* Background orb Animations */
@keyframes orbMove1 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(10vw, 15vh) scale(1.1);
    }
}

@keyframes orbMove2 {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(-15vw, -10vh) scale(1.15);
    }
}

@keyframes orbMove3 {
    0% {
        transform: translate(0, 0) scale(1.2);
    }

    100% {
        transform: translate(8vw, -12vh) scale(0.9);
    }
}

/* Wave jump animations */
@keyframes waveJump {
    0% {
        height: 10%;
    }

    100% {
        height: 95%;
    }
}

@keyframes micPulse {

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

    50% {
        transform: scale(1.25);
        opacity: 0.65;
        border-color: var(--color-cyan);
    }
}

@keyframes voiceActive {
    0% {
        height: 4px;
    }

    100% {
        height: 18px;
    }
}

/* Card Sizing and Layout Alignments for Tablet/Desktop */
@media (min-width: 768px) {
    .dashboard-grid .widget-card {
        height: 360px; /* Perfectly equalized height to match Translate box */
    }

    .music-player-body,
    .tv-body,
    .book-body,
    .saif-body {
        flex: 1;
        justify-content: space-between;
    }

    .translate-body {
        flex: 1;
    }

    .translate-input {
        flex: 1;
        min-height: 60px;
    }
}

/* Custom Toast Notification */
.custom-toast {
    position: fixed;
    top: -80px; /* Hidden offscreen by default */
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 1rem 2rem;
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3), 0 0 20px rgba(0, 242, 254, 0.2);
    backdrop-filter: blur(20px) saturate(120%);
    z-index: 9999;
    opacity: 0;
    transition: top 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.4s ease;
    pointer-events: none;
    text-align: center;
    white-space: nowrap;
}

.custom-toast.visible {
    top: 24px; /* Slide down into view */
    opacity: 1;
}

/* Error Page Layouts */
.error-page-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 1rem;
}

.error-container {
    width: 100%;
    max-width: 500px;
    z-index: 10;
}

.error-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(40px) saturate(140%);
    border-radius: 24px;
    padding: 3rem 2rem;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.error-logo {
    margin-bottom: 2rem;
}

.error-code {
    font-family: var(--font-display);
    font-size: 6rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 1.5rem;
    background: linear-gradient(135deg, var(--color-cyan), var(--color-logo-blue));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.05em;
    filter: drop-shadow(0 4px 12px rgba(0, 242, 254, 0.3));
}

.error-code-502 {
    background: linear-gradient(135deg, var(--color-magenta), var(--color-logo-orchid));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 4px 12px rgba(244, 63, 94, 0.3));
}

.error-message-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.error-message-desc {
    font-size: 0.95rem;
    color: var(--color-text-dim);
    line-height: 1.5;
    margin-bottom: 2.5rem;
    max-width: 380px;
}

.error-btn {
    text-decoration: none;
    display: inline-block;
    padding: 0.8rem 2rem;
}

.error-btn-502 {
    background: linear-gradient(135deg, var(--color-magenta), var(--color-logo-orchid));
    box-shadow: 0 4px 15px rgba(244, 63, 94, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 50px;
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform var(--transition-smooth), box-shadow var(--transition-smooth), opacity var(--transition-smooth);
}

.error-btn-502:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(244, 63, 94, 0.35);
    opacity: 0.95;
}

.error-btn-502:active {
    transform: translateY(0);
}

/* Background Glowing Aura on Error Cards */
.error-glow {
    position: absolute;
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--color-cyan-glow) 0%, transparent 70%);
    top: -100px;
    left: 50%;
    transform: translateX(-50%);
    pointer-events: none;
    z-index: 0;
    opacity: 0.8;
}

.error-glow-502 {
    background: radial-gradient(circle, var(--color-magenta-glow) 0%, transparent 70%);
}

/* Reduced Motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-delay: -1ms !important;
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        background-attachment: initial !important;
        scroll-behavior: auto !important;
        transition-duration: 0s !important;
        transition-delay: 0s !important;
    }

    .mesh-backdrop,
    .mesh-orb {
        animation: none !important;
    }
}