:root {
    --bg-color: #1F2937;
    --card-bg: #374151;
    --primary-red: #F97316;
    /* Renamed visually but keeping CSS variable name to avoid refactoring all CSS */
    --accent-red: #FB923C;
    --success-green: #22C55E;
    --text-main: #F8FAFC;
    --text-muted: #9CA3AF;
    --nav-bg: rgba(31, 41, 55, 0.95);
    --glass-border: rgba(255, 255, 255, 0.08);
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.4);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Barlow', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

h1,
h2,
h3 {
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Header */
.app-header {
    padding: 28px 20px;
    text-align: center;
    background: linear-gradient(to bottom, rgba(26, 26, 26, 0.9), transparent);
    backdrop-filter: blur(4px);
    z-index: 100;
    position: relative;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 1.5rem;
    letter-spacing: -1px;
    color: var(--text-main);
}

.logo-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.4);
}

.logo span {
    color: var(--primary-red);
}

/* Main Content Area */
#main-content {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
}

/* Chat Section */
#chat-section {
    display: flex;
    flex-direction: column;
}

.chat-header {
    text-align: center;
    margin-bottom: 20px;
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 200px;
    /* Space for fixed chat input and bottom nav */
}

.message {
    max-width: 80%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 0.95rem;
    animation: fadeIn 0.3s ease-out;
    margin-bottom: 8px;
    word-wrap: break-word;
    line-height: 1.5;
}

.message p {
    margin-bottom: 8px;
}

/* Alpha Pulse Thinking Indicator */
.thinking-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    width: fit-content;
    margin-bottom: 15px;
    box-shadow: var(--shadow-premium);
    animation: fadeIn 0.3s ease-out;
}

.thinking-dot {
    width: 6px;
    height: 6px;
    background: var(--primary-red);
    border-radius: 50%;
    animation: alphaPulse 1.4s infinite ease-in-out;
}

.thinking-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.thinking-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes alphaPulse {

    0%,
    80%,
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }

    40% {
        transform: scale(1.1);
        opacity: 1;
    }
}

.app-version-footer {
    text-align: center;
    padding: 40px 20px 60px;
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 20px;
}

.app-version-footer span {
    display: block;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}


.message p:last-child {
    margin-bottom: 0;
}

.profile-card:last-child {
    margin-bottom: 30px;
}

/* Quiz Mode Styles */
.quiz-progress-container {
    margin-bottom: 25px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.quiz-progress-bar {
    height: 8px;
    background: var(--bg-color);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
}

.quiz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-red), #F87171);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.quiz-progress-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    font-weight: 600;
}

.quiz-card {
    background: var(--card-bg);
    border-radius: 24px;
    padding: 30px;
    border: 2px solid var(--glass-border);
    box-shadow: var(--shadow-premium);
    margin-bottom: 30px;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.quiz-label {
    display: block;
    font-size: 0.75rem;
    color: var(--primary-red);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}

.quiz-question {
    font-size: 1.4rem;
    margin-bottom: 25px;
    line-height: 1.3;
}

.quiz-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.quiz-btn {
    flex: 1;
    max-width: 140px;
    padding: 15px;
    border-radius: 12px;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 800;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    color: white;
}

.btn-yes {
    background: var(--success-green);
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.2);
}

.btn-no {
    background: #ef4444;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.2);
}

.quiz-btn:hover {
    transform: translateY(-3px) scale(1.05);
}

.quiz-btn:active {
    transform: scale(0.95);
}

/* Quiz Feedback */
.quiz-feedback {
    margin-top: 10px;
    animation: fadeIn 0.5s ease-out;
}

.feedback-icon {
    font-size: 3rem;
    margin-bottom: 10px;
}

.feedback-msg {
    font-weight: 800;
    font-size: 1.2rem;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.feedback-expl {
    background: rgba(0, 0, 0, 0.2);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    text-align: left;
    border: 1px solid var(--glass-border);
}

.feedback-expl p {
    font-size: 0.95rem;
    color: var(--text-main);
}

.next-btn {
    width: 100%;
}

/* Answered Items */
.answered-list {
    margin-top: 30px;
}

.answered-title {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
    padding-bottom: 10px;
}

.read-quiz .revelation-content p {
    margin-bottom: 10px;
}

.read-quiz .revelation-content p:last-child {
    margin-bottom: 0;
}

.quiz-complete-card {
    text-align: center;
    padding: 40px 20px;
    background: var(--card-bg);
    border-radius: 24px;
    border: 2px solid var(--primary-red);
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.2);
    animation: fadeIn 0.5s ease-out;
}

.quiz-icon-large {
    font-size: 4rem;
    margin-bottom: 20px;
}

.quiz-complete-card h3 {
    font-size: 1.8rem;
    color: var(--primary-red);
    margin-bottom: 15px;
}

.quiz-complete-card p {
    margin-bottom: 25px;
    color: var(--text-muted);
}


.message ul,
.message ol {
    margin-left: 20px;
    margin-bottom: 10px;
}

.message li {
    margin-bottom: 4px;
}

.message strong {
    color: inherit;
    font-weight: 700;
}

.message.system {
    align-self: flex-start;
    background: linear-gradient(145deg, #1a1a1a, #0d0d0d);
    /* OLED Deep Black */
    border: 1px solid rgba(249, 115, 22, 0.15);
    /* Subtile Alpha Glow */
    border-bottom-left-radius: 4px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    color: #F8FAFC;
}

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, var(--primary-red), #F87171);
    border-bottom-right-radius: 4px;
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.2);
}

/* Navigation Arrows */
.scroll-nav-controls {
    position: fixed;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 90;
}

.scroll-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(55, 65, 81, 0.85);
    backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    color: var(--text-main);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.scroll-btn:hover {
    background: var(--primary-red);
    color: white;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
}

.scroll-btn:active {
    transform: scale(0.95);
}

/* Chat Input Area */
.chat-input-area {
    position: fixed;
    bottom: 85px;
    left: 15px;
    right: 15px;
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    padding: 10px 15px;
    border-radius: 30px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-premium);
}

textarea {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1.05rem;
    outline: none;
    resize: none;
    max-height: 120px;
    padding-top: 5px;
}

.icon-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 10px rgba(249, 115, 22, 0.3);
}

.icon-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(249, 115, 22, 0.5);
}

.icon-btn:active {
    transform: scale(0.95);
}

.icon-btn svg {
    width: 20px;
    height: 20px;
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(15px);
    display: flex;
    justify-content: space-around;
    padding: 10px 0 25px;
    /* Extra padding for phone home bar */
    border-top: 1px solid var(--glass-border);
    z-index: 100;
}

.nav-item {
    background: transparent;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-item.active {
    color: var(--primary-red);
}

.nav-item svg {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    width: 26px;
    height: 26px;
}

.nav-item.active svg {
    transform: translateY(-4px) scale(1.1);
    filter: drop-shadow(0 4px 6px rgba(249, 115, 22, 0.4));
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* View visibility */
.hidden-view {
    display: none !important;
}

.view-header {
    text-align: center;
    margin-bottom: 30px;
}

.view-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Auth Styling */
.auth-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.auth-box {
    background: var(--card-bg);
    padding: 40px 30px;
    border-radius: 24px;
    border: 2px solid var(--glass-border);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5);
    width: 100%;
    max-width: 400px;
    text-align: center;
    animation: fadeIn 0.4s ease-out;
}

.auth-box h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: var(--text-main);
}

.auth-box p {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 25px;
}

.auth-input {
    width: 100%;
    background: var(--bg-color);
    border: 2px solid var(--glass-border);
    color: var(--text-main);
    padding: 16px;
    margin-bottom: 20px;
    border-radius: 12px;
    font-family: inherit;
    font-size: 1.05rem;
    outline: none;
    transition: all 0.3s;
}

.auth-input:focus {
    border-color: var(--primary-red);
    box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.15);
}

.password-wrapper {
    position: relative;
    width: 100%;
    margin-bottom: 20px;
}

.password-wrapper .auth-input {
    margin-bottom: 0;
    padding-right: 50px;
}

.password-toggle {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    transition: color 0.3s;
    z-index: 10;
}

.password-toggle:hover {
    color: var(--primary-red);
}

.password-toggle:focus {
    outline: none;
    color: var(--primary-red);
}

.auth-btn {
    width: 100%;
    margin-bottom: 20px;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
}

.auth-links a {
    color: var(--primary-red);
    text-decoration: none;
    transition: opacity 0.3s;
}

.auth-links a:hover {
    opacity: 0.8;
}

/* Stats Styling */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--card-bg);
    padding: 15px 10px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid var(--glass-border);
}

.stat-card.highlight {
    border-color: var(--primary-red);
}

.stat-card .label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 5px;
}

.stat-card .value {
    font-weight: 800;
    font-size: 1.2rem;
}

.stat-card .value span {
    font-size: 0.7rem;
    margin-left: 2px;
}

/* Fasting Styling */
.timer-container {
    display: flex;
    justify-content: center;
    margin: 40px 0;
}

.timer-circle {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 30px rgba(249, 115, 22, 0.2);
    position: relative;
    background: conic-gradient(var(--success-green) 0%, var(--card-bg) 0%);
    transition: background 1s linear;
}

.timer-circle::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--bg-color);
    border-radius: 50%;
}

.timer-text {
    text-align: center;
    position: relative;
    z-index: 5;
}

.timer-text .time {
    display: block;
    font-size: 2.8rem;
    font-weight: 700;
    font-family: 'Barlow Condensed', sans-serif;
    letter-spacing: 1px;
}

.timer-text .status {
    font-size: 0.7rem;
    color: var(--primary-red);
    font-weight: 700;
}

.fasting-controls {
    text-align: center;
}

.primary-btn {
    background: var(--primary-red);
    color: white;
    border: none;
    padding: 16px 48px;
    border-radius: 12px;
    font-weight: 800;
    font-family: 'Barlow Condensed', sans-serif;
    text-transform: uppercase;
    font-size: 1.2rem;
    letter-spacing: 1px;
    margin-bottom: 15px;
    box-shadow: 0 8px 15px -5px rgba(249, 115, 22, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 20px -5px rgba(249, 115, 22, 0.6);
}

.primary-btn:active {
    transform: scale(0.96);
}

.secondary-btn {
    background: transparent;
    border: 2px solid var(--glass-border);
    color: var(--text-muted);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s;
    cursor: pointer;
}

.secondary-btn:hover {
    border-color: var(--primary-red);
    color: var(--text-main);
}

.stats-controls {
    text-align: center;
    margin-bottom: 20px;
}

#weight-input-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
}

#new-weight-input {
    background: var(--card-bg);
    border: 2px solid var(--glass-border);
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
    width: 120px;
    font-family: inherit;
    font-size: 1.1rem;
    text-align: center;
    transition: border-color 0.3s;
}

#new-weight-input:focus {
    border-color: var(--primary-red);
    outline: none;
}

.hint {
    color: var(--text-muted);
    font-size: 0.9rem;
    font-style: italic;
}

/* Chart placeholder */
.chart-placeholder {
    height: 150px;
    display: flex;
    align-items: flex-end;
    gap: 15px;
    padding: 20px;
    background: var(--card-bg);
    border-radius: 15px;
}

.chart-placeholder .bar {
    flex: 1;
    background: linear-gradient(to top, var(--primary-red), var(--accent-red));
    border-radius: 6px 6px 0 0;
    transition: height 1s ease-out;
}



::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 10px;
}

/* Revelations Styling */
.revelations-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-bottom: 120px;
}

.revelation-item {
    background: var(--card-bg);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.revelation-item:hover {
    border-color: rgba(249, 115, 22, 0.4);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* New styles for speaker and mic buttons */
:root {
    --primary-red: #F97316;
    /* Actually Orange-Red based on prev edits */
    --primary-glow: rgba(249, 115, 22, 0.4);
    --mic-active: #EF4444;
}

.speaker-btn,
.mic-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    transition: all 0.2s ease;
    margin-left: 10px;
    flex-shrink: 0;
}

.speaker-btn:hover,
.mic-btn:hover {
    color: var(--primary-red);
    background: rgba(249, 115, 22, 0.12);
}

.mic-btn.active {
    color: var(--mic-active);
    background: rgba(239, 68, 68, 0.15);
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

.revelation-header {
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.revelation-header h3 {
    font-size: 1.1rem;
    font-family: 'Barlow', sans-serif;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
    flex: 1;
}

.revelation-status {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    margin-left: 10px;
    transition: all 0.3s;
}

.revelation-status.unread {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.revelation-status.read {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
    box-shadow: 0 0 10px rgba(74, 222, 128, 0.2);
}

.revelation-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    background: rgba(0, 0, 0, 0.2);
    border-top: 1px solid transparent;
}

.revelation-content.open {
    max-height: 2000px;
    /* arbitrary large value for transition */
    padding: 20px;
    border-top-color: var(--glass-border);
}

.revelation-content p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
}

/* ================================
   PROFILE SECTION
   ================================ */
.profile-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    padding: 0 16px;
    margin-bottom: 20px;
}

.profile-stat {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-stat .label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.profile-stat .value {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.profile-edit-cards {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 0 16px 24px;
}

.profile-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 16px;
    border: 1px solid var(--card-border, rgba(255, 255, 255, 0.06));
}

.profile-card h3 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--primary-red);
    margin: 0 0 10px 0;
}

.profile-msg {
    font-size: 0.82rem;
    min-height: 1.2em;
    margin: 6px 0 0;
    font-weight: 500;
    transition: all 0.3s ease;
}

.profile-msg.success {
    color: #4ade80;
}

.profile-msg.error {
    color: var(--primary-red);
}

/* Author Button & Modal Style - UI UX PRO MAX */
.icon-btn-ghost {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    padding: 10px;
    border-radius: 12px;
    z-index: 100;
}

.header-action-group {
    position: absolute;
    top: 50%;
    left: 20px;
    transform: translateY(-50%);
    display: flex;
    gap: 12px;
    align-items: center;
}

#logout-btn {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
}

.icon-btn-ghost:hover {
    color: var(--primary-red) !important;
    background: rgba(249, 115, 22, 0.12);
    transform: translateY(-50%) scale(1.05);
    /* Account for group transform */
}

/* Re-fix hover scale for individual buttons not in group */
#logout-btn:hover {
    transform: translateY(-50%) scale(1.05);
}

#author-info-btn:hover,
#header-guide-btn:hover {
    transform: scale(1.05);
    /* In group, only scale */
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
    animation: fadeIn 0.3s ease-out;
}

.modal-container {
    background: var(--card-bg);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    max-width: 450px;
    width: 100%;
    position: relative;
    box-shadow: var(--shadow-premium);
    animation: modalSlideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
}

@keyframes modalSlideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-muted);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    color: white;
    background: var(--primary-red);
    transform: rotate(90deg);
}

/* Feedback System - Thumb Down & Modal */
.message-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    opacity: 1;
    /* Always visible for better UX on all devices */
    transition: all 0.3s ease;
}

.message.system:hover .message-actions {
    opacity: 1;
}

.action-btn-mini {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.3);
    /* Subtle orange border for visibility */
    color: var(--primary-red);
    padding: 6px 14px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.action-btn-mini:hover {
    background: var(--primary-red);
    color: white;
    border-color: var(--primary-red);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.feedback-textarea {
    width: 100%;
    min-height: 120px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 0.95rem;
    margin: 20px 0;
    resize: vertical;
    outline: none;
    transition: border-color 0.3s;
}

.feedback-textarea:focus {
    border-color: var(--primary-red);
}

.feedback-submit-btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-weight: 700;
    background: var(--primary-red);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
}

.feedback-submit-btn:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.3);
}

/* Profile Version Footer - Positioned above Bottom Nav */
.app-version-footer {
    text-align: center;
    padding: 40px 20px 120px;
    /* Increased bottom padding for visibility */
    color: var(--text-muted);
    font-size: 0.8rem;
    border-top: 1px solid var(--glass-border);
    margin-top: 20px;
}

.app-version-footer span {
    display: block;
    font-weight: 700;
    color: var(--primary-red);
    letter-spacing: 1px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

/* Multi-Tier Feedback Styles */
.message-actions {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.like-btn {
    transition: all 0.2s ease;
}

.like-btn:hover {
    color: var(--primary-red) !important;
    background: rgba(249, 115, 22, 0.1) !important;
    transform: translateY(-1px);
}

.pulse-once {
    animation: pulseOnce 0.4s ease-out;
}

@keyframes pulseOnce {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

/* Voice Features Animations & Toggles */
.icon-btn.active {
    color: var(--primary-red);
    background: rgba(249, 115, 22, 0.1);
}

#mic-btn.listening {
    color: var(--mic-active);
    background: rgba(239, 68, 68, 0.1);
    animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
    }

    70% {
        transform: scale(1.1);
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0);
    }

    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

#speaker-toggle-btn.muted svg path {
    opacity: 0.3;
}

/* Admin Dashboard */
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
    margin-top: 15px;
}

.user-admin-card {
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s;
}

.user-admin-card:hover {
    border-color: var(--primary-red);
    background: rgba(249, 115, 22, 0.05);
}

.user-info-mini h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-main);
}

.user-info-mini p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.user-role-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--primary-red);
    color: white;
    margin-left: 5px;
    vertical-align: middle;
}

.btn-delete-user {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-delete-user:hover {
    background: #ef4444;
    color: white;
}

/* Onboarding Wizard */
.onboarding-wizard {
    animation: fadeIn 0.4s ease-out;
}

.wizard-step {
    text-align: left;
    animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
    from {
        transform: translateX(20px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.wizard-step h3 {
    font-size: 1.5rem;
    color: var(--primary-red);
    margin-bottom: 25px;
    text-align: center;
}

.wizard-input-group {
    margin-bottom: 20px;
}

.wizard-input-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    font-weight: 600;
}

.wizard-radio-group {
    display: flex;
    gap: 15px;
    margin-top: 10px;
}

.wizard-radio-card {
    flex: 1;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.wizard-radio-card:hover {
    border-color: var(--primary-red);
}

.wizard-radio-card.active {
    background: rgba(249, 115, 22, 0.1);
    border-color: var(--primary-red);
    color: var(--text-main);
}

.goal-proposal-card {
    background: linear-gradient(145deg, rgba(31, 41, 55, 0.8), rgba(17, 24, 39, 0.8));
    border: 1px solid var(--primary-red);
    border-radius: 20px;
    padding: 25px;
    margin-top: 20px;
    box-shadow: 0 0 20px rgba(249, 115, 22, 0.15);
}

.goal-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--glass-border);
}

.goal-stat:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.goal-stat span:first-child {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.goal-stat span:last-child {
    font-weight: 800;
    font-size: 1.2rem;
    color: var(--primary-red);
}

/* Fasting UI Styles */
.fasting-card,
.fasting-phase-card,
.fasting-history-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 20px;
    border-radius: 15px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.fasting-controls-grid {
    display: flex;
    gap: 15px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.fasting-controls-grid .input-group {
    flex: 1;
    min-width: 140px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fasting-controls-grid label {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 600;
}

.fasting-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#fasting-timer-circle {
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.active-fasting-card #fasting-timer-circle {
    border-color: var(--primary-red);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.4);
}

/* Savoir Section Enhancements */
.savoir-top-cards .profile-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.5);
}

.savoir-top-cards .profile-card h3 {
    transition: color 0.3s ease;
}

.savoir-top-cards .profile-card:hover h3 {
    color: var(--primary-color);
}

#fasting-manual-controls {
    border-top: 1px dashed var(--glass-border);
    padding-top: 15px;
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 10px;
}

/* Author Photo styles */
.author-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-red);
    margin: 0 auto 15px auto;
    display: block;
    box-shadow: 0 4px 15px rgba(249, 115, 22, 0.4);
}