/* Auth Modal & Forms */
.auth-container {
    max-width: 450px;
    width: 90%;
    padding: 40px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.auth-box {
    width: 100%;
}

.auth-box h2 {
    margin-bottom: 8px;
    color: var(--primary);
}

.auth-box p {
    font-size: 0.9rem;
    opacity: 0.7;
    margin-bottom: 24px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-family: inherit;
    transition: all 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.switch-auth {
    margin-top: 20px;
    font-size: 0.85rem;
}

.switch-auth a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Modern Smart Captcha Styling */
.captcha-wrapper {
    margin-bottom: 25px;
    padding: 12px 16px;
    background: var(--card-bg);
    border-radius: 4px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    width: 100%;
    min-height: 74px;
    justify-content: center;
}

.captcha-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.captcha-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-checkbox-custom {
    width: 28px;
    height: 28px;
    border: 2px solid #c1c1c1;
    border-radius: 2px;
    cursor: pointer;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.captcha-checkbox-custom:hover {
    border-color: #b2b2b2;
}

.captcha-checkbox-custom.loading {
    border-radius: 50%;
    border: 2px solid #eee;
    border-top-color: var(--primary);
    animation: loaderSpin 0.8s linear infinite;
}

.captcha-checkbox-custom.verified {
    border-color: #009688;
    background: #009688;
    color: white;
}

.captcha-checkbox-custom.verified::after {
    content: "L";
    transform: scaleX(-1) rotate(-45deg);
    font-weight: 900;
    margin-top: -4px;
}

@keyframes loaderSpin {
    to {
        transform: rotate(360deg);
    }
}

.captcha-text {
    font-size: 14px;
    color: var(--text-primary);
    font-weight: 500;
}

.captcha-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.captcha-logo-img {
    width: 32px;
    height: 32px;
    opacity: 0.8;
}

.captcha-right span {
    font-size: 8px;
    color: #9b9b9b;
    font-weight: 500;
}

/* Symbol Grid Popover */
#captcha-box {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
    animation: fadeIn 0.3s ease;
}

.captcha-instruction {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--primary);
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-bottom: 10px;
}

.symbol-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 15px;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.symbol-item:hover {
    background: var(--border-color);
    transform: translateY(-2px);
}

.symbol-item.selected {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.error-shake {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    10%,
    30%,
    50%,
    70%,
    90% {
        transform: translateX(-5px);
    }

    20%,
    40%,
    60%,
    80% {
        transform: translateX(5px);
    }
}

/* Premium Buttons & Controls */
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
    filter: brightness(1.1);
}

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

.auth-footer {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.link-btn {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: opacity 0.2s;
}

.link-btn.secondary {
    font-size: 0.8rem;
    opacity: 0.6;
}

.link-btn:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Modern & Premium OTP Input */
.otp-container {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 24px;
}

.otp-input {
    width: 100%;
    max-width: 280px;
    height: 56px;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    color: var(--primary);
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    letter-spacing: 12px;
    text-indent: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.2);
}

.otp-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.3), inset 0 2px 4px rgba(0, 0, 0, 0.2);
    transform: scale(1.02);
}

.otp-input::placeholder {
    font-size: 1rem;
    letter-spacing: normal;
    text-indent: 0;
    opacity: 0.4;
    font-weight: 500;
}

/* Light Mode Adjustments */
body.light-mode .otp-input {
    background: #f8fafc;
    border-color: #e2e8f0;
    color: #1e293b;
}

body.light-mode .otp-input:focus {
    background: #ffffff;
    border-color: var(--primary);
}

.user-status {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 4px 4px 4px 12px;
    border-radius: 40px;
    cursor: default;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.user-status:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15);
}

.user-info-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.user-avatar-small {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary);
    transition: transform 0.2s;
}

.user-info-wrapper:hover .user-avatar-small {
    transform: scale(1.1);
}

.user-status span {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-primary);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.logout-pill-btn {
    background: var(--bg-secondary);
    border: none;
    color: var(--text-secondary);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.logout-pill-btn:hover {
    background: #ff4757;
    color: white;
    transform: rotate(90deg);
}

/* Profile Modal Specifics */
.avatar-selection {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 20px;
}

.current-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    border: 3px solid var(--primary);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.current-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-sm:hover {
    background: var(--primary);
    color: white;
    border-color: transparent;
}

.btn-primary {
    width: 100%;
    padding: 14px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--primary-rgb), 0.3);
    filter: brightness(1.1);
}

.hidden {
    display: none !important;
}

:root {
    /* Color Palette - Light Mode */
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --accent-color: #3b82f6;
    --accent-hover: #2563eb;
    --primary: var(--accent-color);
    --primary-rgb: 59, 130, 246;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --glass-bg: rgba(255, 255, 255, 0.8);
    --header-height: 70px;
    --text-primary-rgb: 30, 41, 59;
}

body.dark-mode {
    --bg-color: #0f172a;
    --card-bg: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #60a5fa;
    --accent-hover: #3b82f6;
    --primary: var(--accent-color);
    --primary-rgb: 96, 165, 250;
    --border-color: #334155;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.3);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
    --text-primary-rgb: 248, 250, 252;
    --glass-bg: rgba(15, 23, 42, 0.8);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* --- Premium Page Loader --- */
.page-loader {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 10000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-logo {
    font-size: 3rem;
    margin-bottom: 20px;
    animation: loaderPulse 1.5s infinite ease-in-out;
}

.loader-bar-container {
    width: 200px;
    height: 4px;
    background: var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
}

.loader-bar {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
    animation: loaderSlide 1.5s infinite ease-in-out;
}

@keyframes loaderPulse {

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

    50% {
        transform: scale(1.1);
        opacity: 1;
    }
}

@keyframes loaderSlide {
    0% {
        left: -100%;
    }

    100% {
        left: 100%;
    }
}

/* --- Skeleton Screens --- */
.skeleton {
    background: linear-gradient(90deg, var(--bg-secondary) 25%, var(--border-color) 50%, var(--bg-secondary) 75%);
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite linear;
    border-radius: 10px;
}

@keyframes skeletonLoading {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
    width: 100%;
}

.skeleton-title {
    height: 2em;
    margin-bottom: 1em;
    width: 60%;
}

.skeleton-img {
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header & Navigation */
header {
    height: var(--header-height);
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

header .container {
    max-width: 100%;
    padding: 0 40px;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    text-decoration: none;
}

.logo-icon-premium {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
    transition: all 0.3s ease;
}

.logo:hover .logo-icon-premium {
    transform: rotate(-10deg) scale(1.1);
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    background: linear-gradient(135deg, var(--text-primary) 0%, #4b5563 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-family: 'Outfit', sans-serif;
    display: flex;
    align-items: center;
}

body.dark-mode .logo-text {
    background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.language-switcher {
    display: flex;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 4px;
}

.language-switcher button {
    background: none;
    border: none;
    padding: 4px 12px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 6px;
    transition: all 0.2s;
}

.language-switcher button.active {
    background: var(--accent-color);
    color: white;
}

.icon-btn {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 1.2rem;
}

.icon-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--primary);
    transform: translateY(-2px);
}

#theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

#theme-toggle .icon-moon {
    display: none;
}

body.dark-mode #theme-toggle .icon-moon {
    display: block;
}

body.dark-mode #theme-toggle .icon-sun {
    display: none;
}

/* --- FitGuide V2: Modern Drawer & Layout --- */
.tools-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: rgba(var(--bg-primary-rgb), 0.8) !important;
    background-color: var(--bg-primary);
    backdrop-filter: blur(20px);
    border-left: 1px solid var(--border-color);
    z-index: 3000;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.4);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

.tools-drawer.open {
    right: 0;
}

.drawer-header {
    padding: 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.drawer-header h3 {
    font-size: 1.5rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.close-drawer {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: transform 0.3s;
}

.close-drawer:hover {
    transform: rotate(90deg);
    color: var(--primary);
}

.drawer-content {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.drawer-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 24px;
    box-shadow: var(--shadow-sm);
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Water V2 */
.water-visual {
    display: flex;
    justify-content: center;
    margin-bottom: 25px;
}

.water-progress-circle-v2 {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: conic-gradient(var(--primary) 0deg, var(--border-color) 0deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: background 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.water-progress-circle-v2::after {
    content: '';
    position: absolute;
    inset: 12px;
    background: var(--card-bg);
    border-radius: 50%;
}

.water-info {
    position: relative;
    z-index: 2;
    text-align: center;
}

.water-info span {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    display: block;
}

.water-info small {
    font-size: 0.75rem;
    opacity: 0.6;
}

/* Water tracking styles moved to end of file for higher priority */


/* --- FitGuide V3: Luxury Layout & Glassmorphism --- */
.app-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 60px;
    padding: 40px 0 100px;
}

.sticky-sidebar {
    position: sticky;
    top: 90px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    background: rgba(var(--bg-rgb), 0.3) !important;
    backdrop-filter: blur(15px);
    border: 1px solid rgba(var(--primary-rgb), 0.1);
    padding: 30px;
    border-radius: 32px;
    scrollbar-width: none;
    /* Firefox */
}

/* Hide scrollbar for Chrome, Safari and Opera */
.sticky-sidebar::-webkit-scrollbar {
    display: none;
}

.sidebar-box h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    border: none;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-list .filter-btn {
    padding: 14px 20px;
    border-radius: 18px;
    background: rgba(var(--primary-rgb), 0.03);
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.category-list .filter-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateX(8px);
    color: var(--primary);
}

.category-list .filter-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.3);
    transform: translateX(5px) scale(1.02);
}

.equipment-type-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.equipment-type-list .equip-filter-btn {
    padding: 14px 20px;
    border-radius: 18px;
    background: rgba(var(--primary-rgb), 0.03);
    border: 1px solid transparent;
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    display: flex;
    justify-content: space-between;
    cursor: pointer;
}

.equipment-type-list .equip-filter-btn:hover {
    background: rgba(var(--primary-rgb), 0.08);
    transform: translateX(8px);
    color: var(--primary);
}

.equipment-type-list .equip-filter-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 25px rgba(var(--primary-rgb), 0.3);
    transform: translateX(5px) scale(1.02);
}

.content-header-v2 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 50px;
    padding-bottom: 30px;
    border-bottom: 1px solid var(--border-color);
}

.header-info h2 {
    font-size: 2.8rem;
    font-weight: 900;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-focus-map {
    padding: 16px 32px;
    border-radius: 20px;
    font-size: 1rem;
    font-weight: 800;
    background: var(--primary);
    color: white;
    box-shadow: 0 15px 35px rgba(var(--primary-rgb), 0.3);
    transition: all 0.4s;
    border: none;
    cursor: pointer;
}

.btn-focus-map:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(var(--primary-rgb), 0.4);
}

.drawer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(8px);
    z-index: 2900;
    opacity: 0;
    pointer-events: none;
    transition: all 0.4s;
}

.drawer-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

/* BMI Drawer Specifics */
.drawer-input-row {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.mini-input {
    flex: 1;
}

.mini-input label {
    display: block;
    font-size: 0.75rem;
    margin-bottom: 6px;
    opacity: 0.6;
}

.mini-input input {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.btn-action-full {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    border: none;
    background: var(--primary);
    color: white;
    font-weight: 700;
    cursor: pointer;
}

.drawer-result {
    margin-top: 20px;
    padding: 20px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 16px;
    text-align: center;
}

#bmi-value {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
}

/* Modal V5: Vivid Contrast & Clarity */
.map-modal {
    max-width: 1000px;
    width: 95%;
    background: var(--bg-primary);
    border-radius: 40px;
    padding: 40px;
    border: 2px solid var(--primary);
    /* Şık ve belirgin border */
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.5);
}

.map-modal .modal-header h3 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--text-primary);
    margin-bottom: 30px;
    letter-spacing: -1px;
}

.map-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    gap: 60px;
    align-items: center;
}

.map-view {
    background: rgba(var(--primary-rgb), 0.08);
    /* Biraz daha belirgin */
    border-radius: 35px;
    padding: 50px;
    display: flex;
    justify-content: center;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
    box-shadow: inset 0 0 40px rgba(var(--primary-rgb), 0.05);
    position: relative;
    overflow: hidden;
}

.human-svg-modern {
    height: 520px;
    width: auto;
    filter: drop-shadow(0 0 30px rgba(var(--primary-rgb), 0.2));
}

.map-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 15px;
}

.map-list .muscle-btn {
    padding: 20px 28px;
    border-radius: 22px;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
    font-size: 1.1rem;
    font-weight: 800;
    /* Çok daha kalın yazı */
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    text-transform: capitalize;
}

.map-list .muscle-btn:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateX(10px) scale(1.02);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.map-list .muscle-btn.active {
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    color: white;
    border-color: transparent;
    box-shadow: 0 15px 35px rgba(var(--primary-rgb), 0.4);
}

/* --- V5 Vücut Haritası: Vibrant Interaction --- */
.muscle-zone,
.muscle-zone-stroke {
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    fill: transparent;
    stroke: transparent;
}

.muscle-group:hover .muscle-zone {
    fill: rgba(var(--primary-rgb), 0.3);
    /* Daha canlı hover */
}

.muscle-group:hover .muscle-zone-stroke {
    stroke: rgba(var(--primary-rgb), 0.5);
    stroke-width: 3;
}

.muscle-group.active .muscle-zone {
    fill: url(#musclePulse);
    /* Özel radyal gradyan */
    filter: drop-shadow(0 0 20px var(--primary));
    animation: holographPulseV5 1.5s infinite ease-in-out;
}

.muscle-group.active .muscle-zone-stroke {
    stroke: var(--primary);
    stroke-width: 4;
    filter: drop-shadow(0 0 12px var(--primary));
    stroke-dasharray: 1000;
    animation: drawLineV5 2s forwards ease-out;
}

@keyframes holographPulseV5 {

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

    50% {
        opacity: 1;
        transform: scale(1.03);
    }
}

@keyframes drawLineV5 {
    from {
        stroke-dashoffset: 1000;
    }

    to {
        stroke-dashoffset: 0;
    }
}

/* Hologram Scan Effect V5 */
.map-view::after {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 60%;
    background: url(#sciFiScan);
    /* SVG definition kullanımı veya linear gradient */
    background: linear-gradient(to bottom, transparent, rgba(var(--primary-rgb), 0.1), transparent);
    animation: scanLineV5 5s infinite linear;
    pointer-events: none;
    opacity: 0.8;
}

@keyframes scanLineV5 {
    0% {
        top: -100%;
    }

    100% {
        top: 150%;
    }
}

@media (max-width: 1100px) {
    .map-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .human-svg-modern {
        height: 350px;
    }
}

/* Equipment Grid */
.equipment-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    padding-bottom: 60px;
}

.anim-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(var(--primary-rgb), 0.9);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    width: 45px;
    height: 45px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    font-size: 1.2rem;
}

.anim-btn:hover {
    transform: scale(1.1) rotate(5deg);
    background: var(--primary);
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal.hidden {
    display: none;
}

.modal-overlay {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
}

.modal-container {
    position: relative;
    background: var(--bg-primary);
    width: 95%;
    max-width: 600px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    z-index: 2100;
    border: 1px solid var(--border-color);
}

.modal-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.8;
}

.modal-body {
    padding: 0;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 300px;
}

.modal-body img {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 10px;
    right: 15px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    z-index: 2200;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.close-btn:hover {
    opacity: 1;
}

.loader-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f5f9;
}

.machine-card {
    background: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: flex;
    flex-direction: column;
}

.machine-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    border-color: var(--accent-color);
}

.machine-card:active {
    transform: translateY(-5px) scale(0.98);
}

.card-image-wrapper {
    width: 100%;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f5f9;
}

body.dark-mode .card-image-wrapper {
    background: #334155;
}

.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.machine-card:hover .card-image-wrapper img {
    transform: scale(1.1);
}

.card-content {
    padding: 24px;
}

.card-routine-info {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.routine-stats {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.85rem;
    color: var(--text-secondary);
    gap: 10px;
}

.stat-edit {
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--bg-secondary);
    padding: 4px 8px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex: 1;
}

.stat-input {
    width: 100%;
    min-width: 30px;
    background: transparent;
    border: none;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.9rem;
    padding: 0;
    outline: none;
    text-align: center;
}

.routine-stats strong {
    color: var(--primary);
    font-size: 1rem;
}

.weight-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weight-input-group label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    opacity: 0.6;
}

.weight-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-secondary);
    padding: 6px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    transition: border-color 0.3s;
}

.weight-input-wrapper:focus-within {
    border-color: var(--primary);
}

.card-weight-input {
    width: 100%;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1rem;
    text-align: left;
    outline: none;
}

.card-weight-input::-webkit-inner-spin-button,
.card-weight-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 6px;
    margin-bottom: 12px;
}

.machine-card h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

/* Detail View Overlay Modernized */
.detail-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    z-index: 5000;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    /* Slide up from bottom */
    visibility: hidden;
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.detail-overlay.active {
    visibility: visible;
    opacity: 1;
}

.detail-container {
    width: 100%;
    max-width: 900px;
    height: 90vh;
    /* Premium height */
    background: var(--card-bg);
    border-radius: 40px 40px 0 0;
    padding: 40px;
    position: relative;
    transform: translateY(100%);
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    overflow-y: auto;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.3);
}

.detail-overlay.active .detail-container {
    transform: translateY(0);
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 30px;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--accent-color);
}

.detail-content {
    display: grid;
    gap: 40px;
}

.detail-header {
    text-align: center;
}

.detail-header h2 {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

.detail-visual {
    width: 100%;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    background: radial-gradient(circle at center, var(--bg-secondary) 0%, var(--card-bg) 100%);
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    border: 1px solid var(--border-color);
    padding: 20px;
    /* Added padding to prevent image touching edges */
}

/* Media Switcher Tab Styles */
.media-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 14px;
    display: inline-flex;
}

.media-tab {
    padding: 8px 20px;
    border: none;
    border-radius: 10px;
    background: transparent;
    color: var(--text-secondary);
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 6px;
}

.media-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2);
}

.media-tab:hover:not(.active) {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
}

.media-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(var(--primary-rgb), 0.1);
    border-top: 3px solid var(--primary);
    border-radius: 50%;
    animation: mediaSpin 1s linear infinite;
    z-index: 5;
    display: none;
}

@keyframes mediaSpin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

.detail-visual img {
    display: block;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    object-fit: contain;
    cursor: zoom-in;
    /* Indicate that it can be enlarged */
}

/* Image styling - Better Balanced Size */
.detail-visual img.media-image {
    width: 85%;
    /* Reduced for better framing */
    height: auto;
    max-height: 380px;
    /* Significantly reduced to fit better */
    margin: auto;
    border-radius: 12px;
}

/* Animation styling - Smaller & Contained */
.detail-visual img.media-animation {
    width: 80%;
    /* Smaller than static image */
    max-height: 400px;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    margin: 20px auto;
}

.detail-visual img.loading {
    opacity: 0;
    transform: scale(0.95);
}

.info-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
}

.info-section {
    background: var(--card-bg);
    padding: 30px;
    border-radius: 20px;
    border: 1px solid var(--border-color);
}

.info-section h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.steps-list {
    list-style: none;
}

.steps-list li {
    margin-bottom: 12px;
    display: flex;
    gap: 15px;
}

.step-num {
    background: var(--accent-color);
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.muscle-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.muscle-tag {
    background: rgba(59, 130, 246, 0.1);
    color: var(--accent-color);
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
}

.muscle-tag.secondary {
    background: var(--bg-color);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.errors-list {
    list-style: none;
}

.errors-list li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 10px;
    color: #ef4444;
}

.errors-list li::before {
    content: "✕";
    position: absolute;
    left: 0;
    font-weight: 800;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

/* Loader */
.loader-wrapper {
    grid-column: 1 / -1;
    display: flex;
    justify-content: center;
    padding: 100px 0;
}

.loader {
    width: 48px;
    height: 48px;
    border: 5px solid var(--border-color);
    border-bottom-color: var(--accent-color);
    border-radius: 50%;
    display: inline-block;
    box-sizing: border-box;
    animation: rotation 1s linear infinite;
}

@keyframes rotation {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.error-msg {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-radius: 12px;
    font-weight: 600;
}

/* Scrollbar refinement */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* --- FitGuide V3: Hero & Search Modernization --- */
.hero {
    padding: 100px 0 60px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, transparent 100%);
    text-align: center;
}

#hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 15px;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

#hero-desc {
    max-width: 700px;
    margin: 0 auto 40px;
    font-size: 1.1rem;
    color: var(--text-secondary);
}

.search-container {
    max-width: 650px;
    margin: 0 auto;
}

.search-wrapper {
    position: relative;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 5px 25px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 15px 45px rgba(var(--primary-rgb), 0.15);
    transform: translateY(-2px);
}

.search-icon {
    font-size: 1.2rem;
    opacity: 0.5;
}

#machine-search {
    width: 100%;
    border: none;
    background: transparent;
    padding: 15px 0;
    font-size: 1.15rem;
    color: var(--text-primary);
    font-family: inherit;
    outline: none;
}

#machine-search::placeholder {
    color: var(--text-secondary);
    opacity: 0.5;
}

/* Responsive */
@media (max-width: 768px) {
    #hero-title {
        font-size: 2.2rem;
        letter-spacing: -0.2px;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    .detail-header h2 {
        font-size: 1.8rem;
    }
}

/* ==========================================================================
   LIGHTBOX FIX - HIGHEST PRIORITY
   ========================================================================== */
#media-lightbox {
    z-index: 10000 !important;
    /* Higher than 5000 */
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    display: none;
    align-items: center;
    justify-content: center;
}

#media-lightbox.active {
    display: flex !important;
}

#media-lightbox .modal-overlay {
    background: rgba(0, 0, 0, 0.95) !important;
    backdrop-filter: blur(20px) !important;
    z-index: 10001 !important;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.lightbox-container {
    position: relative !important;
    z-index: 10002 !important;
    width: 90% !important;
    max-width: 1100px !important;
    max-height: 90vh !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

#lightbox-img {
    max-width: 100% !important;
    max-height: 85vh !important;
    object-fit: contain !important;
    border-radius: 12px !important;
    box-shadow: 0 0 100px rgba(0, 0, 0, 1) !important;
    background: transparent !important;
}

#close-lightbox {
    position: absolute !important;
    top: -50px !important;
    right: 0 !important;
    color: white !important;
    font-size: 40px !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    z-index: 10003 !important;
}

/* Favorites */
.fav-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    backdrop-filter: blur(5px);
    transition: all 0.3s;
    z-index: 10;
}

.fav-btn:hover {
    background: rgba(0, 0, 0, 0.7);
    transform: scale(1.1);
}

.fav-btn.active {
    background: rgba(239, 68, 68, 0.9);
    color: white;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* --- Phase 1 & 2: Tools & Intelligence Styles --- */
.drawer-result.hidden {
    display: none;
}

.drawer-result {
    margin-top: 15px;
    padding: 15px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-box span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.sidebar-divider {
    height: 1px;
    background: var(--border-color);
    margin: 20px 0;
    opacity: 0.5;
}

.routine-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.routine-btn {
    width: 100%;
    padding: 12px 15px;
    border-radius: 12px;
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    color: var(--text-primary) !important;
    text-align: left;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 12px;
}

.routine-btn:hover {
    border-color: var(--primary) !important;
    background: rgba(var(--primary-rgb), 0.1) !important;
    transform: translateX(5px);
}

.routine-btn.active {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%) !important;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

.no-scroll {
    overflow: hidden !important;
}

.muscle-group {
    cursor: pointer;
}

.muscle-zone {
    transition: all 0.4s ease;
}

.muscle-group:hover .muscle-zone {
    fill: rgba(var(--primary-rgb), 0.3);
}

.muscle-group.active .muscle-zone {
    fill: var(--primary);
    filter: drop-shadow(0 0 10px var(--primary));
}

.detail-tools-floating {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 12px;
    z-index: 5000;
    background: rgba(var(--bg-primary-rgb), 0.8);
    backdrop-filter: blur(10px);
    padding: 10px 20px;
    border-radius: 40px;
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.tool-pill {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--text-primary);
}

.tool-pill:hover {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.1);
}

.rest-timer-overlay {
    position: fixed;
    bottom: 100px;
    /* Above bottom nav */
    right: 20px;
    width: 90px;
    height: 90px;
    background: var(--card-bg);
    border: 3px solid var(--primary);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 6000;
    box-shadow: 0 15px 45px rgba(0, 0, 0, 0.4);
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
}

.rest-timer-overlay .time {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--primary);
}

.progress-log-section {
    margin-top: 25px;
    background: rgba(var(--text-primary-rgb), 0.03);
    padding: 20px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
}

.log-textarea {
    width: 100%;
    min-height: 100px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    margin-top: 10px;
}

.log-textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.favorites-tool {
    order: -1;
}

.favorites-list {
    max-height: 300px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.fav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-primary);
    padding: 8px;
    border-radius: 12px;
    transition: all 0.2s;
    cursor: pointer;
    border: 1px solid var(--border-color);
}

.fav-item:hover {
    transform: translateX(5px);
    border-color: var(--primary);
}

.fav-img-box {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}

.fav-img-box img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fav-item span {
    font-size: 0.9rem;
    font-weight: 600;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.fav-remove {
    background: none;
    border: none;
    opacity: 0.5;
    cursor: pointer;
    font-size: 1.4rem;
    padding: 0 5px;
    color: var(--text-primary);
}

.fav-remove:hover {
    opacity: 1;
    color: #ef4444;
}

.empty-fav {
    text-align: center;
    opacity: 0.6;
    font-size: 0.9rem;
    padding: 20px 0;
}

/* ==========================================================================
   MOBILE APP EXPERIENCE V4 (Tab Bar & Safe Areas)
   ========================================================================== */

/* Bottom Navigation Bar */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(70px + env(safe-area-inset-bottom));
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    display: none;
    /* Desktop default */
    justify-content: space-around;
    align-items: center;
    padding: 0 10px env(safe-area-inset-bottom);
    border-top: 1px solid var(--border-color);
    z-index: 4000;
    box-shadow: 0 -5px 20px rgba(0, 0, 0, 0.1);
}

.nav-item {
    background: none;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    flex: 1;
}

.nav-icon {
    font-size: 1.4rem;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-item.active {
    color: var(--primary);
}

.nav-item.active .nav-icon {
    transform: translateY(-5px) scale(1.2);
}

/* Safe Area Support */
:root {
    --safe-bottom: env(safe-area-inset-bottom);
}

@media (max-width: 768px) {
    .bottom-nav {
        display: flex;
    }

    /* Adjust main content padding for bottom nav */
    #app {
        padding-bottom: 90px;
    }

    /* Hide desktop-only elements */
    .sidebar {
        display: none;
    }

    .app-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        padding-top: 20px;
    }

    header nav .nav-controls .icon-btn#open-tools,
    header nav .nav-controls #auth-trigger,
    header nav .nav-controls .user-status {
        display: none !important;
    }

    .content-header-v2 {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
        margin-bottom: 30px;
    }

    .header-info h2 {
        font-size: 2rem;
    }

    .hero {
        padding: 40px 0 20px;
    }

    .mobile-install-banner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
        border: 1px solid rgba(var(--primary-rgb), 0.2);
        padding: 12px 16px;
        margin: 10px 15px;
        border-radius: 16px;
        backdrop-filter: blur(10px);
        animation: slideDown 0.5s ease;
    }

    .mobile-install-banner .banner-info {
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .mobile-install-banner .banner-icon {
        font-size: 1.5rem;
        background: var(--bg-primary);
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 10px;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    }

    .mobile-install-banner h4 {
        font-size: 0.9rem;
        font-weight: 700;
        margin-bottom: 2px;
    }

    .mobile-install-banner p {
        font-size: 0.75rem;
        opacity: 0.7;
    }

    .btn-install-mini {
        background: var(--primary);
        color: white;
        border: none;
        padding: 8px 14px;
        border-radius: 8px;
        font-size: 0.8rem;
        font-weight: 700;
        cursor: pointer;
    }

    /* Detail View Mobile Optimizations */
    .detail-overlay {
        padding: 0;
    }

    .detail-container {
        width: 100%;
        height: 100%;
        border-radius: 0;
        max-width: none;
        max-height: none;
    }

    .detail-content {
        padding: 20px;
    }

    .detail-img-container {
        border-radius: 0;
        margin: -20px -20px 20px -20px;
    }

    /* App-like "Pull" indicator for modals */
    .detail-container::before {
        content: '';
        position: absolute;
        top: 10px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 4px;
        background: var(--border-color);
        border-radius: 2px;
        pointer-events: none;
    }
}

/* Performance and Smoothness */
* {
    -webkit-tap-highlight-color: transparent;
}

.fade-in {
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   WORKOUT PLANNER V1
   ========================================================================== */
.planner-container {
    max-width: 600px;
    width: 95%;
    background: var(--bg-primary);
    border-radius: 32px;
    padding: 25px;
    height: 90vh;
    /* Fixed height for flex children to work */
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    .planner-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px 15px 120px;
        /* Slightly more space */
    }
}

/* No wrapper needed, children of .planner-container handle flex */

.planner-header {
    margin-bottom: 20px;
    text-align: center;
    flex-shrink: 0;
}

.planner-header h2 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.day-selector {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 20px;
    background: var(--bg-secondary);
    padding: 8px;
    border-radius: 20px;
    flex-shrink: 0;
}

.day-btn {
    flex: 1;
    padding: 12px 5px;
    border: none;
    background: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.day-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.planner-exercises {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 15px;
    padding-right: 5px;
    -webkit-overflow-scrolling: touch;
}

.planner-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 15px;
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 15px;
    align-items: center;
    transition: all 0.3s ease;
}

.planner-item:hover {
    border-color: var(--primary);
}

.item-img {
    width: 60px;
    height: 60px;
    border-radius: 12px;
    overflow: hidden;
}

.item-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-main h4 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.item-inputs {
    display: flex;
    gap: 10px;
}

.planner-input {
    width: 60px;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 5px 8px;
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 0.85rem;
    text-align: center;
}

.remove-item {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 10px;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.remove-item:hover {
    opacity: 1;
}

/* Picker Styles */
.picker-container {
    max-width: 500px;
    width: 95%;
    background: var(--bg-primary);
    padding: 25px;
    border-radius: 30px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 768px) {
    .picker-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px 15px 90px;
    }
}

.picker-search {
    margin: 15px 0;
}

.picker-search input {
    width: 100%;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
}

.picker-list {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-overflow-scrolling: touch;
}

.picker-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: var(--bg-secondary);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.picker-item:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateX(5px);
}

.picker-item img {
    width: 45px;
    height: 45px;
    border-radius: 8px;
    object-fit: cover;
}

.picker-quick-filters {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-bottom: 20px;
    padding-bottom: 5px;
}

.picker-quick-filters::-webkit-scrollbar {
    height: 3px;
}

.picker-chip {
    flex-shrink: 0;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
}

.picker-chip.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.planner-actions {
    display: flex;
    flex-direction: row;
    /* Side by side to save space */
    gap: 10px;
    padding-top: 15px;
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    flex-shrink: 0;
}

.planner-actions button {
    flex: 1;
    white-space: nowrap;
    font-size: 0.85rem !important;
    padding: 12px 5px !important;
}

.planner-notes {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    padding: 6px 12px;
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 0.8rem;
    margin-top: 10px;
    outline: none;
    transition: border-color 0.2s;
}

.planner-notes:focus {
    border-color: var(--primary);
}

/* Resend Container Styling */
.resend-container {
    background: rgba(var(--primary-rgb), 0.05);
    padding: 16px;
    border-radius: 16px;
    border: 1px dashed rgba(var(--primary-rgb), 0.3);
    margin-top: 20px;
    text-align: center;
    animation: slideUpFade 0.4s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.resend-container p {
    font-size: 0.85rem !important;
    margin-bottom: 8px !important;
    opacity: 0.7 !important;
    color: var(--text-primary) !important;
}

.resend-container button.link-btn {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(var(--primary-rgb), 0.1);
    border-radius: 10px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.2s;
}

.resend-container button.link-btn:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.05);
}

/* --- Custom Toast Notification --- */
.toast-container {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
    width: auto;
    max-width: 90vw;
}

.toast {
    background: rgba(15, 23, 42, 0.95);
    color: white;
    padding: 12px 24px;
    border-radius: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    font-weight: 500;
    animation: toast-in 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
}

.toast.removing {
    animation: toast-out 0.4s forwards;
}

.toast.error {
    border-color: rgba(239, 68, 68, 0.5);
    background: rgba(69, 10, 10, 0.95);
}

.toast.success {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(2, 44, 34, 0.95);
}

@keyframes toast-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
}

/* --- Empty States Improvement --- */
.empty-state-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(var(--primary-rgb), 0.3));
    animation: float 3s ease-in-out infinite;
}

.empty-state-text h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.empty-state-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 250px;
    line-height: 1.5;
    margin: 0 auto;
}

/* --- Animations --- */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    50% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-8px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Responsive fixes for Toast */
@media (max-width: 768px) {
    .toast-container {
        bottom: 6rem;
        /* Above bottom nav */
    }
}

/* --- Modern Form Selectors --- */
.hidden-select {
    display: none !important;
}

.gender-selector {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.gender-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 80px;
    text-align: center;
}

.gender-option:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.gender-option.active {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
    transform: translateY(-2px);
}

.gender-icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
    display: block;
}

.activity-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.activity-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-card:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateX(4px);
}

.activity-card.active {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.act-icon-box {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    margin-right: 12px;
}

.act-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.act-info span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mini-input label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: var(--text-secondary);
}

/* Fix drawer layout for new inputs */
@keyframes toast-out {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
}

/* --- Empty States Improvement --- */
.empty-state-v2 {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
}

.empty-state-icon {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(var(--primary-rgb), 0.3));
    animation: float 3s ease-in-out infinite;
}

.empty-state-text h4 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    font-weight: 700;
}

.empty-state-text p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 250px;
    line-height: 1.5;
    margin: 0 auto;
}

/* --- Animations --- */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    50% {
        transform: translateX(8px);
    }

    75% {
        transform: translateX(-8px);
    }
}

.shake {
    animation: shake 0.4s ease-in-out;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

/* Responsive fixes for Toast */
@media (max-width: 768px) {
    .toast-container {
        bottom: 6rem;
        /* Above bottom nav */
    }
}

/* --- Modern Form Selectors --- */
.hidden-select {
    display: none !important;
}

.gender-selector {
    display: flex;
    gap: 10px;
    margin-top: 5px;
}

.gender-option {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 80px;
    text-align: center;
}

.gender-option:hover {
    background: rgba(var(--primary-rgb), 0.1);
}

.gender-option.active {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
    transform: translateY(-2px);
}

.gender-icon {
    font-size: 1.8rem;
    margin-bottom: 5px;
    display: block;
}

.activity-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.activity-card {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.activity-card:hover {
    background: rgba(var(--primary-rgb), 0.1);
    transform: translateX(4px);
}

.activity-card.active {
    background: rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.1);
}

.act-icon-box {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 50%;
    margin-right: 12px;
}

.act-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.act-info span {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-primary);
}

.mini-input label {
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 6px;
    display: block;
    color: var(--text-secondary);
}

/* Fix drawer layout for new inputs */
.drawer-input-row {
    gap: 15px;
    align-items: flex-start;
}

/* TTS Button - Hidden as per request */
.tts-btn {
    display: none !important;
}

/* --- Share Button --- */
.share-btn-planner {
    background: #10b981;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
    transition: transform 0.2s;
}

.share-btn-planner:hover {
    transform: translateY(-2px);
    background: #059669;
}

/* --- Achievement Toast --- */
.toast.achievement {
    border-color: #f59e0b;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(15, 23, 42, 0.95) 100%);
}

.toast.achievement span:first-child {
    font-size: 1.5rem;
}


.btn-reset {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-reset:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: #ef4444;
    color: #ef4444;
    transform: translateY(-1px);
}

/* --- Achievements Grid --- */
.achievements-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.achievement-card {
    background: rgba(var(--surface-rgb), 0.5);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    opacity: 0.5;
    filter: grayscale(100%);
    position: relative;
    cursor: pointer;
}

.achievement-card.unlocked {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary);
    opacity: 1;
    filter: grayscale(0%);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.15);
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.achievement-icon {
    font-size: 2rem;
    margin-bottom: 5px;
    display: block;
}

.achievement-card small {
    font-size: 0.7rem;
    line-height: 1.1;
    color: var(--text-secondary);
    display: block;
}

.achievement-card.unlocked small {
    color: var(--text-primary);
    font-weight: 600;
}

/* --- Confetti Animation --- */
.confetti {
    position: fixed;
    width: 10px;
    height: 10px;
    background-color: #f00;
    animation: fall 3s linear forwards;
    z-index: 9999;
    pointer-events: none;
}

@keyframes fall {
    to {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

@keyframes popIn {
    0% {
        transform: scale(0.5);
        opacity: 0;
    }

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

/* --- Planner Checkbox & Completed State --- */
.planner-item {
    transition: all 0.3s ease;
}

.planner-item.completed {
    background: rgba(16, 185, 129, 0.05);
    border-color: rgba(16, 185, 129, 0.3);
}

.planner-checkbox-container {
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.planner-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    transition: all 0.2s;
}

.planner-item:hover .planner-checkbox {
    border-color: var(--primary);
}

.planner-checkbox.checked {
    background: #10b981;
    border-color: #10b981;
}

/* --- Header Install Button --- */
.install-header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    border-radius: 12px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
    border: none;
    transition: all 0.3s ease;
    animation: pulse-soft 2s infinite;

    /* Separation & Positioning */
    margin-left: 20px;
    position: relative;
    padding-left: 20px;
}

.install-header-btn::before {
    content: '';
    position: absolute;
    left: -10px;
    height: 24px;
    width: 1px;
    background: var(--border-color);
    opacity: 0.5;
}

.install-header-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.install-header-btn span:first-child {
    font-size: 1.2rem;
}

@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

@media (max-width: 768px) {
    .install-header-btn span[data-i18n] {
        display: none;
    }

    .install-header-btn {
        padding: 8px;
        border-radius: 50%;
        margin-left: 10px;
    }

    .install-header-btn::before {
        display: none;
    }
}


/* --- FitGuide Pro: Session Overlay --- */
.session-overlay {
    position: fixed;
    inset: 0;
    background: var(--bg-color);
    z-index: 9000;
    display: none;
    overflow-y: auto;
}

.session-overlay.active {
    display: block;
}

.session-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: 120px;
}

.session-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.step-indicator {
    background: var(--primary);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 800;
}

.close-session {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.session-media {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--card-bg);
    border-radius: 24px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid var(--border-color);
}

.session-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.session-tools {
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 40px;
}

.session-timer-row {
    display: flex;
    gap: 10px;
}

.btn-timer {
    flex: 1;
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    font-weight: 700;
    cursor: pointer;
}

.session-log {
    display: flex;
    gap: 10px;
    background: var(--card-bg);
    padding: 15px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
}

.log-input {
    flex: 1;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 10px;
    color: var(--text-primary);
    text-align: center;
    width: 60px;
}

.btn-log {
    background: var(--primary);
    color: white;
    border: none;
    padding: 0 15px;
    border-radius: 10px;
    cursor: pointer;
}

.session-nav {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    display: flex;
    gap: 15px;
    z-index: 9100;
}

.btn-session-nav {
    flex: 1;
    height: 60px;
    border-radius: 18px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-primary);
    font-size: 1.2rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.btn-session-nav.primary {
    background: var(--primary);
    color: white;
    border: none;
}

.btn-session-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* --- FitGuide Pro: Confetti --- */
.confetti {
    position: fixed;
    top: -10px;
    width: 10px;
    height: 10px;
    z-index: 10000;
    pointer-events: none;
    animation: fall linear forwards;
}

@keyframes fall {
    to {
        transform: translateY(110vh) rotate(360deg);
    }
}

/* --- Stats & Profile Charts --- */
.stats-container {
    padding-top: 10px;
}

.stats-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.trend-chart {
    position: relative;
    width: 100%;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}

.stat-mini-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: transform 0.2s;
}

.stat-mini-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
}

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    font-weight: 700;
}

.stat-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 85px;
    opacity: 0.9;
}

.stat-val {
    color: var(--primary);
}

.stat-bar-bg {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
    overflow: hidden;
}

.stat-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
    opacity: 0.8;
}

/* Macro & BMI Input Styles */
.bmi-input,
.bmi-select {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 10px;
    border-radius: 12px;
    margin-bottom: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.2s;
}

.bmi-input:focus {
    border-color: var(--primary);
}

.drawer-result {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}

.result-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.result-box small {
    display: block;
    margin-bottom: 5px;
    opacity: 0.8;
}

.result-box span {
    font-size: 1.5rem;
    font-weight: 800;
    color: #10b981;
}

.macro-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 5px;
}

/* --- Modern Tools Tabs (Premium Look) - Overrides --- */
.tools-tabs {
    display: flex;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 16px;
    gap: 0;
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    position: relative;
    box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.05);
}

.tool-tab {
    flex: 1;
    text-align: center;
    padding: 10px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.tool-tab:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
}

.tool-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    font-weight: 700;
}

/* --- Input Field Enhancements --- */
.input-label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-left: 4px;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bmi-input,
.bmi-select,
.mini-input input {
    background: var(--bg-secondary) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 12px !important;
    padding: 12px 14px !important;
    font-size: 0.95rem !important;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.bmi-input:focus,
.bmi-select:focus,
.mini-input input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15) !important;
    background: var(--bg-primary) !important;
}

.input-group {
    margin-bottom: 18px;
}

/* --- Result Box Polish --- */
.drawer-result {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(16, 185, 129, 0.05) 100%);
    border: 1px solid rgba(16, 185, 129, 0.2);
    backdrop-filter: blur(5px);
}

/* Utility */
.hidden {
    display: none !important;
}

.fade-in {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* --- Modernize Select Dropdowns (Fix Visibility) --- */
select option {
    background-color: #1f2937 !important;
    /* Dark Grey */
    color: #ffffff !important;
    /* White Text */
}

.bmi-select option {
    background-color: #1f2937 !important;
    color: #ffffff !important;
    padding: 10px;
}

/* --- Muscles Worked Section --- */
.muscles-worked-section {
    margin-top: 30px;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border-color);
}

.muscles-title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.muscles-worked-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.muscle-diagram-wrapper {
    flex: 0 0 150px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 15px;
    padding: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.human-svg-modern {
    width: 100%;
    height: auto;
    max-height: 350px;
}

.muscle-zone {
    fill: rgba(255, 255, 255, 0.05);
    transition: fill 0.3s ease;
}

/* Highlighting Logic */
.muscle-group-detail.highlight-target .muscle-zone {
    fill: #ef4444 !important;
    /* Red for Target */
    filter: drop-shadow(0 0 5px rgba(239, 68, 68, 0.5));
}

.muscle-group-detail.highlight-synergists .muscle-zone {
    fill: #3b82f6 !important;
    /* Blue for Synergists */
    filter: drop-shadow(0 0 5px rgba(59, 130, 246, 0.5));
}

.muscle-group-detail.highlight-stabilizers .muscle-zone {
    fill: #a855f7 !important;
    /* Purple for Stabilizers */
    filter: drop-shadow(0 0 5px rgba(168, 85, 247, 0.5));
}

.muscle-legend {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.legend-group h4 {
    margin: 0 0 10px 0;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.legend-items {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.muscle-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.badge-target {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-synergist {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-stabilizer {
    background: rgba(168, 85, 247, 0.15);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.3);
}

/* Responsive adjust */
@media (max-width: 600px) {
    .muscles-worked-container {
        flex-direction: column;
        align-items: center;
    }

    .muscle-diagram-wrapper {
        width: 120px;
        flex: none;
    }
}

/* ==========================================================================
   WATER TRACKING PREMIUM BUTTONS (FORCE OVERRIDE)
   ========================================================================== */
.water-buttons .btn-ctrl {
    border: none !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) !important;
    outline: none !important;
}

.water-buttons .btn-ctrl.minus {
    width: 46px !important;
    height: 46px !important;
    background: rgba(var(--primary-rgb), 0.1) !important;
    color: var(--primary) !important;
    border-radius: 14px !important;
    font-size: 1.4rem !important;
}

.water-buttons .btn-ctrl.plus {
    flex: 1 !important;
    height: 50px !important;
    background: linear-gradient(135deg, var(--primary) 0%, #3b82f6 100%) !important;
    color: white !important;
    border-radius: 16px !important;
    gap: 8px !important;
    font-weight: 800 !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
}

.water-buttons .btn-ctrl:hover {
    transform: translateY(-3px) !important;
    filter: brightness(1.1) !important;
}

.water-buttons .btn-ctrl:active {
    transform: scale(0.95) !important;
}

/* --- FitGuideAI Chatbot Premium Styles --- */
.ai-chat-widget {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 5000;
    font-family: 'Outfit', sans-serif;
}

.ai-chat-bubble {
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    padding: 14px 24px;
    border-radius: 40px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.4);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.ai-chat-bubble:hover {
    transform: translateY(-8px) scale(1.05);
    box-shadow: 0 20px 40px rgba(var(--primary-rgb), 0.5);
}

.bubble-logo {
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px;
    transition: transform 0.3s;
}

.ai-chat-bubble:hover .bubble-logo {
    transform: rotate(15deg) scale(1.2);
}

.bubble-text {
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.2px;
}

.ai-chat-window {
    position: absolute;
    bottom: 90px;
    right: 0;
    width: 400px;
    height: 600px;
    background: rgba(var(--bg-primary-rgb), 0.85);
    backdrop-filter: blur(25px) saturate(180%);
    -webkit-backdrop-filter: blur(25px) saturate(180%);
    border: 1px solid rgba(var(--text-primary-rgb), 0.12);
    border-radius: 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    transition: all 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    transform-origin: bottom right;
    z-index: 5001;
}

.ai-chat-window.hidden {
    transform: scale(0.7) translateY(40px);
    opacity: 0;
    pointer-events: none;
}

.chat-header {
    padding: 24px;
    background: linear-gradient(135deg, var(--primary) 0%, #1e40af 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.header-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 14px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header-info h3 {
    font-size: 1.2rem;
    font-weight: 800;
    margin: 0;
    letter-spacing: -0.3px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    opacity: 0.85;
    margin-top: 2px;
}

.status-dot {
    width: 10px;
    height: 10px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 12px #10b981;
    animation: pulsesvg 2s infinite;
}

@keyframes pulsesvg {
    0% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.2);
        opacity: 0.7;
    }

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

.chat-close-btn {
    background: rgba(0, 0, 0, 0.1);
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s;
}

.chat-close-btn:hover {
    background: rgba(255, 0, 0, 0.2);
    transform: rotate(90deg);
}

.chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: rgba(var(--bg-primary-rgb), 0.2);
}

/* Custom Scrollbar for Chat */
.chat-messages::-webkit-scrollbar {
    width: 5px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(var(--text-primary-rgb), 0.1);
    border-radius: 10px;
}

.message {
    max-width: 88%;
    padding: 14px 18px;
    border-radius: 20px;
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    word-wrap: break-word;
    animation: messageFadeIn 0.3s ease;
}

@keyframes messageFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.bot-message {
    background: rgba(var(--text-primary-rgb), 0.05);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 5px;
    border: 1px solid rgba(var(--text-primary-rgb), 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.user-message {
    background: linear-gradient(135deg, var(--primary) 0%, #4338ca 100%);
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.2);
}

.message-time {
    display: block;
    font-size: 0.7rem;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

.user-message .message-time {
    color: rgba(255, 255, 255, 0.9);
}

.message strong {
    color: inherit;
    font-weight: 700;
}

.bot-message .btn-sm {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    margin-top: 10px;
    display: inline-block;
    transition: all 0.3s;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.bot-message .btn-sm:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 6px 14px rgba(var(--primary-rgb), 0.4);
}

.chat-input-area {
    padding: 20px;
    background: rgba(var(--bg-primary-rgb), 0.9);
    border-top: 1px solid rgba(var(--text-primary-rgb), 0.1);
    backdrop-filter: blur(10px);
}

.chat-mode-switch {
    display: flex;
    background: rgba(var(--text-primary-rgb), 0.05);
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 15px;
    border: 1px solid rgba(var(--text-primary-rgb), 0.05);
}

.mode-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    border-radius: 10px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mode-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: center;
}

#ai-chat-input {
    flex: 1;
    background: rgba(var(--text-primary-rgb), 0.05);
    border: 1px solid rgba(var(--text-primary-rgb), 0.1);
    padding: 14px 20px;
    border-radius: 16px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s;
}

#ai-chat-input:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(var(--bg-primary-rgb), 1);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.15);
}

.send-btn {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, var(--primary) 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 20px rgba(var(--primary-rgb), 0.3);
}

.send-btn:hover {
    transform: translateY(-4px) rotate(-5deg);
    box-shadow: 0 12px 25px rgba(var(--primary-rgb), 0.4);
}

.send-btn:active {
    transform: scale(0.95);
}

.send-btn svg {
    width: 20px;
    height: 20px;
    transition: transform 0.3s;
}

.send-btn:hover svg {
    transform: translateX(2px) rotate(-10deg);
}

@media (max-width: 768px) {
    .ai-chat-widget {
        bottom: 110px;
        left: 15px;
        /* SOLA ALDIM - Profil butonunu kapamaz */
        right: auto;
    }

    .ai-chat-window {
        width: calc(100vw - 30px);
        height: 75vh;
        left: 15px;
        right: auto;
        bottom: 90px;
    }

    /* Tools Drawer Mobile Fix */
    .tools-drawer {
        width: 100% !important;
        right: -100% !important;
    }

    .tools-drawer.open {
        right: 0 !important;
    }

    .bottom-nav {
        background: rgba(var(--bg-primary-rgb), 0.7);
        backdrop-filter: blur(25px);
        height: 80px;
        padding-bottom: env(safe-area-inset-bottom);
        border-top: 1px solid rgba(var(--text-primary-rgb), 0.08);
    }

    .nav-item {
        transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-item.active {
        color: var(--primary);
        transform: translateY(-5px);
    }

    .nav-item.active .nav-icon {
        filter: drop-shadow(0 0 8px var(--primary));
    }

    .bubble-text {
        display: none;
    }

    .ai-chat-bubble {
        padding: 12px;
    }
}

.btn-refresh-chats {
    background: var(--primary);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: 0.3s;
}

.btn-refresh-chats:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

/* --- Admin Support Panel Styles --- */
.admin-support-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 900px;
    height: 600px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: panelPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes panelPop {
    from {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

.admin-header {
    padding: 20px 25px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-main {
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-icon {
    font-size: 1.5rem;
    background: rgba(var(--primary-rgb), 0.1);
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.admin-header h3 {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
}

.status-online {
    font-size: 0.75rem;
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-online::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #10b981;
    border-radius: 50%;
    box-shadow: 0 0 10px #10b981;
}

.admin-layout {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.admin-sidebar {
    width: 280px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.sidebar-tabs {
    display: flex;
    padding: 10px;
    gap: 5px;
    border-bottom: 1px solid var(--border-color);
    background: rgba(var(--primary-rgb), 0.03);
}

.admin-tab {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 5px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-tab:hover {
    background: rgba(var(--primary-rgb), 0.05);
    color: var(--text-primary);
}

.admin-tab.active {
    background: var(--primary);
    color: white;
}

.sidebar-header {
    padding: 15px 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 1px;
}

.user-list {
    flex: 1;
    overflow-y: auto;
}

.user-item {
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    position: relative;
    /* Ensure actions are positioned correctly */
    overflow: hidden;
    /* Prevent spillover */
}

.user-item:hover {
    background: rgba(var(--primary-rgb), 0.05);
}

.user-item.active {
    background: rgba(var(--primary-rgb), 0.1);
    border-left: 4px solid var(--primary);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    color: white;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-info h4 {
    margin: 0;
    font-size: 0.9rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.chat-date {
    font-size: 0.65rem;
    font-weight: 400;
    opacity: 0.6;
    white-space: nowrap;
    color: var(--text-secondary);
}

.user-info p {
    margin: 2px 0 0 0;
    font-size: 0.75rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 160px;
}

.admin-messenger {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    min-width: 0;
    /* Fix flex overflow issue */
    position: relative;
}

/* NEW: Layout Resizer and Modern Chips */
.admin-resizer {
    width: 6px;
    background: transparent;
    cursor: col-resize;
    position: relative;
    z-index: 10;
    margin-left: -3px;
    /* Center overlap */
    transition: background 0.2s;
    flex-shrink: 0;
}

.admin-resizer:hover,
.admin-resizer.resizing {
    background: rgba(var(--primary-rgb), 0.5);
}

.admin-resizer::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 2px;
    height: 30px;
    background: var(--border-color);
    border-radius: 2px;
}

.reply-chip {
    background: var(--bg-secondary) !important;
    color: var(--text-primary) !important;
    border: 1px solid var(--border-color) !important;
    padding: 8px 16px !important;
    border-radius: 20px !important;
    font-size: 0.8rem !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex-shrink: 0 !important;
    user-select: none;
    font-weight: 500 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.reply-chip:hover {
    background: var(--primary) !important;
    color: white !important;
    border-color: var(--primary) !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.3);
}

.admin-chat-messages {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.admin-welcome-msg {
    margin: auto;
    text-align: center;
    color: var(--text-secondary);
}

.welcome-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.3;
}

.admin-input-area {
    padding: 20px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 15px;
}

.admin-input-area input {
    flex: 1;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: 12px;
    color: var(--text-primary);
    outline: none;
    transition: 0.3s;
}

.admin-input-area input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(var(--primary-rgb), 0.1);
}

.empty-list-msg {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.delete-chat-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 8px;
    border-radius: 8px;
    color: var(--text-secondary);
    transition: all 0.2s;
    opacity: 0;
    margin-left: 10px;
    /* Space from text */
    flex-shrink: 0;
    /* Don't shrink */
}

.trash-actions {
    display: flex;
    gap: 5px;
    margin-left: 10px;
    flex-shrink: 0;
}

.trash-actions .delete-chat-btn {
    opacity: 1 !important;
    /* Always show actions in trash */
    margin: 0;
}

.user-item:hover .delete-chat-btn {
    opacity: 1;
}

.user-item:hover .delete-chat-btn {
    opacity: 1;
}

.trash-actions {
    display: flex;
    gap: 2px;
    margin-left: auto;
}

.delete-chat-btn.restore:hover {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.delete-chat-btn.delete-forever:hover {
    background: rgba(239, 68, 68, 0.2);
    color: #b91c1c;
}

.delete-chat-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: scale(1.1);
}

@media (max-width: 950px) {
    .admin-support-panel {
        width: 100vw;
        height: 100dvh;
        border-radius: 0;
    }

    .admin-sidebar {
        width: 80px;
    }

    .sidebar-header,
    .user-info {
        display: none;
    }

    .admin-input-area {
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
}

/* --- Professional Smart Captcha (Cloudflare/Google Style) --- */
.captcha-wrapper {
    background: #f9fafb;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    max-width: 320px;
    /* Standard captcha width */
    margin-left: auto;
    margin-right: auto;
}

.dark-mode .captcha-wrapper {
    background: #222;
    border-color: #374151;
}

.captcha-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
    /* Standard height */
}

.captcha-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.captcha-checkbox-custom {
    width: 24px;
    height: 24px;
    border: 2px solid #c5c5c5;
    border-radius: 4px;
    /* Slightly rounded like ReCaptcha */
    background: white;
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
}

.captcha-checkbox-custom:hover {
    border-color: #a0a0a0;
}

.dark-mode .captcha-checkbox-custom {
    background: #333;
    border-color: #555;
}

/* Spinner State */
.captcha-checkbox-custom.loading {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}

.captcha-checkbox-custom.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 24px;
    height: 24px;
    border: 3px solid #d1d5db;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: captchaSpin 1s linear infinite;
}

@keyframes captchaSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Verified State (Green Check) */
.captcha-checkbox-custom.verified {
    border-color: transparent;
    background: transparent;
    pointer-events: none;
}

.captcha-checkbox-custom.verified::before {
    content: '✓';
    color: #10b981;
    font-size: 28px;
    font-weight: bold;
    line-height: 24px;
    position: absolute;
    top: -4px;
    left: 2px;
    animation: checkPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes checkPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

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

.captcha-text {
    font-family: 'Roboto', sans-serif;
    font-size: 14px;
    color: #1f2937;
    font-weight: 500;
}

.dark-mode .captcha-text {
    color: #e5e7eb;
}

.captcha-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.captcha-logo-img {
    width: 24px;
    height: 24px;
    opacity: 0.8;
}

.captcha-right span {
    font-size: 9px;
    color: #6b7280;
    margin-top: 2px;
}

.dark-mode .captcha-right span {
    color: #9ca3af;
}

/* Challenge Box (The Expanded Grid) */
#captcha-box {
    margin-top: 10px;
    border-top: 1px solid #e5e7eb;
    padding-top: 10px;
    animation: slideDown 0.3s ease;
}

.dark-mode #captcha-box {
    border-top-color: #374151;
}

.captcha-instruction {
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #374151;
}

.dark-mode .captcha-instruction {
    color: #d1d5db;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.symbol-item {
    background: #f3f4f6;
    border-radius: 6px;
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    border: 2px solid transparent;
}

.dark-mode .symbol-item {
    background: #374151;
}

.symbol-item:hover {
    background: #e5e7eb;
    transform: scale(1.05);
}

.dark-mode .symbol-item:hover {
    background: #4b5563;
}

.symbol-item:active {
    transform: scale(0.95);
}

/* Error Shake Animation for the Box */
@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

.error-shake {
    animation: shake 0.3s ease-in-out;
    border-color: #ef4444;
}