/* ========================================================
   AskFoxy - Dedicated Parent Dashboard Stylesheet
   ======================================================== */

:root {
    --primary-orange: #f39c12;
    --primary-dark: #d35400;
    --primary-amber: #e67e22;
    --bg-sky: #74b9ff;
    --bg-page: #f8fafc;
    --card-bg: #ffffff;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --accent-green: #10b981;
    --accent-blue: #0284c7;
    --accent-purple: #8b5cf6;
    --border-light: #e2e8f0;
    --radius-lg: 18px;
    --radius-md: 12px;
    --shadow-card: 0 10px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.04);
    --shadow-float: 0 8px 20px -4px rgba(0, 0, 0, 0.12), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Fredoka', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: linear-gradient(135deg, #74b9ff 0%, #a29bfe 100%);
    background-attachment: fixed;
    color: var(--text-dark);
    min-height: 100vh;
    min-height: 100dvh;
    min-height: var(--app-height, 100dvh);
    display: flex;
    flex-direction: column;
    padding: 16px 12px max(16px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px));
}

/* Top Sticky Navigation Bar */
.parent-nav {
    position: sticky;
    top: 10px;
    z-index: 100;
    max-width: 920px;
    width: 100%;
    margin: 0 auto 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 2px solid #ffd700;
    border-radius: var(--radius-lg);
    padding: 10px 16px;
    box-shadow: var(--shadow-float);
    gap: 12px;
}

.btn-back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff8e7;
    color: var(--primary-dark);
    border: 2px solid var(--primary-orange);
    border-radius: 24px;
    padding: 8px 16px;
    font-size: 0.92rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.22s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    white-space: nowrap;
}

.btn-back-home:hover {
    background: var(--primary-orange);
    color: #ffffff;
    transform: translateY(-2px) scale(1.03);
    box-shadow: 0 6px 16px rgba(243, 156, 18, 0.3);
}

.btn-back-home:active {
    transform: scale(0.96);
}

.parent-nav-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.15rem;
    font-weight: 800;
    color: #2f3542;
    white-space: nowrap;
}

.parent-nav-title i {
    color: var(--primary-orange);
    font-size: 1.3rem;
}

.parent-nav-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-shortcut-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #f8fafc;
    color: #475569;
    border: 1.5px solid var(--border-light);
    border-radius: 20px;
    padding: 7px 14px;
    font-size: 0.84rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.nav-shortcut-btn:hover {
    background: #ffffff;
    border-color: var(--primary-orange);
    color: var(--primary-dark);
    transform: translateY(-1px);
}

.nav-shortcut-btn.lock-btn {
    background: #fff1f2;
    border-color: #fecdd3;
    color: #e11d48;
}

.nav-shortcut-btn.lock-btn:hover {
    background: #e11d48;
    color: #ffffff;
}

/* Main Container Card */
.parent-container {
    max-width: 920px;
    width: 100%;
    margin: 0 auto 20px;
    background: #ffffff;
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    flex: 0 1 auto;
}

/* PIN Protection Gate */
#parent-pin-gate {
    max-width: 420px;
    margin: 40px auto;
    width: 100%;
    text-align: center;
    background: #fffdf5;
    border: 2px solid #ffd700;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 4px 16px rgba(246, 185, 59, 0.12);
}

.pin-gate-icon {
    font-size: 2.8rem;
    color: var(--primary-orange);
    margin-bottom: 12px;
}

.pin-gate-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: #2f3542;
    margin-bottom: 6px;
}

.pin-gate-desc {
    font-size: 0.88rem;
    color: #64748b;
    margin-bottom: 18px;
    line-height: 1.45;
}

/* Vertical Tab Navigation (Clean 2-Column Sidebar Layout) */
.parent-dashboard-layout {
    display: flex;
    gap: 24px;
    min-height: 480px;
    flex: 1;
}

.vertical-tabs-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 210px;
    flex-shrink: 0;
    border-right: 1.5px solid #f1f2f6;
    padding-right: 16px;
}

.vertical-tab-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1.5px solid transparent;
    background: transparent;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    width: 100%;
    user-select: none;
    font-family: inherit;
}

.vertical-tab-btn i {
    font-size: 1rem;
    width: 22px;
    text-align: center;
    color: #94a3b8;
    transition: color 0.2s ease, transform 0.2s ease;
}

.vertical-tab-btn:hover {
    background: #f8fafc;
    color: #1e293b;
}

.vertical-tab-btn:hover i {
    color: #f59e0b;
    transform: scale(1.1);
}

.vertical-tab-btn.active {
    background: #fff8e7;
    color: #d35400;
    border-color: #ffd700;
    box-shadow: 0 3px 10px rgba(246, 185, 59, 0.16);
}

.vertical-tab-btn.active i {
    color: #d35400;
    transform: scale(1.1);
}

.vertical-tab-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 6px 0;
}

.tab-panels-container {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overflow-x: hidden !important;
    padding-right: 6px;
}

.tab-panels-container::-webkit-scrollbar {
    width: 6px;
}

.tab-panels-container::-webkit-scrollbar-thumb {
    background: #f6b93b;
    border-radius: 4px;
}

.tab-content {
    display: none;
    animation: tabFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.tab-content.active {
    display: block;
}

@keyframes tabFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Settings Card & Controls */
.settings-card {
    background: #fffdf5;
    border: 1px solid #ffeaa7;
    border-radius: 18px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.settings-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.settings-title {
    font-size: 1rem;
    font-weight: 800;
    color: #d35400;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-badge {
    background: #e8f8f0;
    color: #27ae60;
    border: 1px solid #2ecc71;
    font-size: 0.8rem;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 12px;
}

.settings-desc {
    font-size: 0.88rem;
    color: #57606f;
    line-height: 1.45;
}

/* Age Selector Bar */
.settings-age-bar {
    margin-top: 6px;
    background: #f1f2f6;
    border-radius: 14px;
    padding: 4px;
    display: flex;
    gap: 4px;
}

.settings-age-bar .age-btn {
    flex: 1;
    padding: 8px 10px;
    border: none;
    background: transparent;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    color: #57606f;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.settings-age-bar .age-btn.active {
    background: #ffffff;
    color: var(--primary-dark);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.tier-callout-box {
    margin-top: 8px;
    background: #ffffff;
    border-left: 4px solid #f39c12;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.88rem;
    color: #2f3542;
    line-height: 1.45;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.tier-callout-box strong {
    color: #d35400;
}

/* Modern Toggle Switch */
.toggle-setting-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 8px;
    background: #ffffff;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid #f1f2f6;
}

.custom-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
    cursor: pointer;
}

.custom-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.custom-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #dcdde1;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 26px;
}

.custom-slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: #ffffff;
    transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.custom-switch input:checked + .custom-slider {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.custom-switch input:checked + .custom-slider:before {
    transform: translateX(22px);
}

.toggle-setting-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toggle-setting-label strong {
    font-size: 0.92rem;
    color: #2f3542;
}

.toggle-setting-label small {
    font-size: 0.82rem;
    color: #747d8c;
    line-height: 1.35;
}

.saved-toast {
    margin-top: 10px;
    padding: 8px 14px;
    background: #e8f8f0;
    color: #27ae60;
    border: 1px solid #2ecc71;
    border-radius: 12px;
    font-size: 0.86rem;
    font-weight: 700;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    animation: fadeIn 0.2s ease-in;
}

/* Voice Dropdown Component */
.voice-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
}

.voice-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.voice-action-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 9px;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    color: #475569;
    font-size: 0.88rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.voice-action-icon-btn:hover {
    background: #ffffff;
    border-color: var(--primary-orange);
    color: var(--primary-dark);
}

.voice-dropdown-wrapper {
    position: relative;
    width: 100%;
}

.voice-trigger-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #ffffff;
    border: 2px solid #ffd700;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    font-size: 0.95rem;
    color: #2d3436;
}

.voice-trigger-btn:hover,
.voice-trigger-btn:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

.voice-selected-display {
    display: flex;
    align-items: center;
    gap: 10px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.voice-selected-display i {
    color: var(--primary-orange);
    font-size: 1rem;
}

.voice-dropdown-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 2px solid #ffd700;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    z-index: 200;
    display: none;
    flex-direction: column;
    overflow: hidden;
}

.voice-dropdown-wrapper.open .voice-dropdown-menu {
    display: flex;
}

.voice-search-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1.5px solid #f1f2f6;
    background: #fffdf5;
}

.voice-search-header input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 0.9rem;
    font-family: inherit;
}

.voice-list-scroll {
    max-height: 220px;
    overflow-y: auto;
}

.voice-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 9px 14px;
    cursor: pointer;
    transition: background-color 0.12s;
    user-select: none;
    gap: 10px;
}

.voice-item:hover,
.voice-item.highlighted {
    background-color: #fff8e7;
    color: #d35400;
}

.voice-item.selected {
    background-color: #e8f8f0;
    color: #27ae60;
    font-weight: 700;
}

.voice-item-left {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    flex: 1;
}

.voice-item-left i {
    font-size: 0.85rem;
    color: #f39c12;
}

.voice-item-title {
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.88rem;
}

.voice-item-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.voice-badge-lang {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    background: #f1f2f6;
    color: #57606f;
}

.voice-section-header {
    padding: 6px 14px;
    font-size: 0.74rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: #f8fafc;
    color: #64748b;
    border-bottom: 1px solid #f1f2f6;
    border-top: 1px solid #f1f2f6;
    display: flex;
    align-items: center;
}

.voice-badge-preset {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 8px;
    background: #fff3e0;
    color: #e67e22;
    border: 1px solid #ffe0b2;
}

/* Sliders & Form Controls */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 14px;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 700;
    color: #2f3542;
}

.form-group input,
.form-group select {
    padding: 10px 14px;
    border: 2px solid #ffd700;
    border-radius: 12px;
    font-size: 0.95rem;
    outline: none;
    font-family: inherit;
    background: #ffffff;
}

.form-group input:focus {
    border-color: var(--primary-orange);
    box-shadow: 0 0 0 3px rgba(243, 156, 18, 0.2);
}

.slider-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.slider-group input[type="range"] {
    flex: 1;
    accent-color: var(--primary-orange);
    cursor: pointer;
}

.btn-primary {
    background: linear-gradient(135deg, #1dd1a1, #10ac84);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 11px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(29, 209, 161, 0.3);
}

.btn-secondary {
    background: #f1f2f6;
    color: #57606f;
    border: none;
    border-radius: 14px;
    padding: 11px 18px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: inherit;
}

.btn-secondary:hover {
    background: #e2e8f0;
    color: #1e293b;
}

/* Analytics Chart & Stats */
.stats-chart-wrapper {
    background: #ffffff;
    border: 1.5px solid #f1f2f6;
    border-radius: 16px;
    padding: 16px;
    margin-top: 8px;
}

/* ========================================================
   Application Footer (VAapps Brand & Version Attribution)
   ======================================================== */
.app-footer {
    text-align: center;
    padding: 6px 16px;
    margin-top: auto;
    margin-bottom: max(12px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px));
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
    display: inline-flex;
    justify-content: center;
    align-items: center;
    align-self: center;
    z-index: 10;
}

.footer-content {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 7px;
    font-size: 0.72rem;
    color: #475569;
}

.vaapps-link {
    color: #4338ca;
    text-decoration: none;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    font-size: 0.76rem;
    transition: transform 0.2s ease;
}

.vaapps-link:hover {
    transform: translateY(-1px);
}

.footer-brand {
    font-weight: 800;
    color: #4338ca;
    letter-spacing: -0.2px;
    font-size: 0.78rem;
}

.footer-by {
    font-weight: 600;
    color: #6366f1;
    font-size: 0.72rem;
}

.footer-vaapps {
    font-weight: 800;
    color: #4338ca;
    position: relative;
    display: inline-block;
    padding-bottom: 2px;
    letter-spacing: -0.2px;
    font-size: 0.78rem;
}

.footer-vaapps::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 1.8px;
    border-radius: 2px;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 25%, #d946ef 50%, #ec4899 75%, #4f46e5 100%);
    background-size: 200% 100%;
    animation: vaappsGradientSlide 3s linear infinite;
    box-shadow: 0 1px 4px rgba(124, 58, 237, 0.45);
}

.vaapps-link:hover .footer-vaapps::after {
    height: 2.2px;
    box-shadow: 0 2px 8px rgba(217, 70, 239, 0.6);
}

@keyframes vaappsGradientSlide {
    0% {
        background-position: 0% 50%;
    }
    100% {
        background-position: 200% 50%;
    }
}

.footer-sep {
    color: #94a3b8;
    font-size: 0.70rem;
    user-select: none;
}

.footer-version {
    font-weight: 700;
    color: #ffffff;
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
    padding: 1px 7px;
    border-radius: 10px;
    font-size: 0.65rem;
    letter-spacing: 0.3px;
    border: 1px solid rgba(211, 84, 0, 0.25);
    box-shadow: 0 1px 4px rgba(230, 126, 34, 0.3);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}

.footer-copy {
    color: #64748b;
    font-weight: 500;
}

/* Responsive Styles */
@media (max-width: 768px) {
    body {
        padding: 10px 8px max(14px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px));
    }

    .parent-nav {
        padding: 8px 12px;
        flex-wrap: wrap;
    }

    .parent-container {
        padding: 16px;
        border-radius: 18px;
        margin: 0 auto 16px;
    }

    .parent-dashboard-layout {
        flex-direction: column;
        gap: 14px;
    }

    .vertical-tabs-nav {
        width: 100%;
        border-right: none;
        border-bottom: 1.5px solid #f1f2f6;
        padding-right: 0;
        padding-bottom: 12px;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
    }

    .vertical-tab-btn {
        flex: 1 1 calc(50% - 6px);
        padding: 8px 10px;
        font-size: 0.82rem;
    }

    .tab-panels-container {
        max-height: none;
        overflow: visible;
    }

    .app-footer {
        padding: 6px 14px;
        margin-top: auto;
        margin-bottom: max(10px, env(safe-area-inset-bottom, 0px), var(--safe-bottom, 0px));
        border-radius: 16px;
        max-width: 95%;
    }

    .footer-content {
        font-size: 0.76rem;
        gap: 6px;
    }

    .vaapps-link {
        font-size: 0.82rem;
    }

    .footer-brand,
    .footer-vaapps {
        font-size: 0.86rem;
    }

    .footer-version {
        font-size: 0.66rem;
        padding: 1px 6px;
    }
}
