/* Style system for Weight Tracker (Metric) */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg-main: #0b0f19;
    --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 50%, #1e1b4b 100%);
    --card-bg: rgba(17, 24, 39, 0.65);
    --card-border: rgba(255, 255, 255, 0.06);
    --card-border-hover: rgba(99, 102, 241, 0.2);
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --color-primary: #6366f1; /* Indigo */
    --color-primary-hover: #4f46e5;
    --color-secondary: #a855f7; /* Purple */
    --color-accent: #10b981; /* Emerald Green */
    --color-danger: #ef4444; /* Red */
    --color-warning: #f59e0b; /* Amber */
    --color-info: #0ea5e9; /* Sky Blue */
    --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow-premium: 0 10px 30px -10px rgba(0, 0, 0, 0.5), 0 1px 1px rgba(255, 255, 255, 0.05) inset;
}

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

body {
    font-family: var(--font-sans);
    background: var(--bg-main);
    background-image: var(--bg-gradient);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    line-height: 1.5;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: rgba(11, 15, 25, 0.5);
}
::-webkit-scrollbar-thumb {
    background: rgba(99, 102, 241, 0.3);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: rgba(99, 102, 241, 0.6);
}

/* Layout Elements */
.app-container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Header & Navigation */
header {
    background: rgba(11, 15, 25, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, #a855f7 0%, #6366f1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(99, 102, 241, 0.3);
}

.brand-icon svg {
    width: 18px;
    height: 18px;
    stroke: white;
    fill: none;
    stroke-width: 2.5;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: var(--transition-fast);
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.nav-link.active {
    color: var(--color-primary);
    background: rgba(99, 102, 241, 0.1);
    font-weight: 600;
}

.user-profile-menu {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    transition: var(--transition-fast);
}

.user-profile-menu:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--card-border-hover);
}

.avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 1.5px solid var(--color-primary);
}

.logout-btn {
    background: transparent;
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--color-danger);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: var(--transition-fast);
    text-decoration: none;
}

.logout-btn:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
}

/* Glassmorphism Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: var(--shadow-premium);
    transition: border-color var(--transition-fast), transform var(--transition-fast);
}

.card:hover {
    border-color: var(--card-border-hover);
}

/* Typography Helpers */
.title-main {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
    background: linear-gradient(to right, #ffffff, #d1d5db);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle-main {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

/* Dashboard Summary Cards Grid */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.summary-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    position: relative;
    overflow: hidden;
}

.summary-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--color-primary);
}

.summary-card.accent-emerald::before { background: var(--color-accent); }
.summary-card.accent-purple::before { background: var(--color-secondary); }
.summary-card.accent-info::before { background: var(--color-info); }

.summary-label {
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.summary-value {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.summary-value span {
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-left: 0.25rem;
}

.summary-change {
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-weight: 600;
}

.change-up { color: var(--color-danger); }
.change-down { color: var(--color-accent); }
.change-neutral { color: var(--text-muted); }

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

@media (min-width: 900px) {
    .dashboard-grid {
        grid-template-columns: 380px 1fr;
    }
}

/* Forms styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

.input-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    font-size: 1.05rem;
    color: var(--text-primary);
    font-family: var(--font-sans);
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
    background: rgba(0, 0, 0, 0.3);
}

.form-input::placeholder {
    color: var(--text-muted);
}

/* Weight Entry Form Special Details */
.weight-input-container {
    position: relative;
}

.weight-unit {
    position: absolute;
    right: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    font-weight: 700;
    color: var(--text-secondary);
    font-size: 1.1rem;
    pointer-events: none;
}

.weight-preview-tip {
    font-size: 0.85rem;
    color: var(--color-primary);
    margin-top: 0.4rem;
    font-weight: 500;
    min-height: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: var(--transition-fast);
}

.toggle-date-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 0.75rem;
    transition: var(--transition-fast);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
}

.toggle-date-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.collapsible-date-fields {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) ease-out;
}

.collapsible-date-fields.open {
    max-height: 200px;
}

/* Premium Buttons */
.btn {
    width: 100%;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0.85rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-fast);
    box-shadow: 0 4px 12px rgba(168, 85, 247, 0.2);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(168, 85, 247, 0.4);
    opacity: 0.95;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    box-shadow: none;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--card-border-hover);
    box-shadow: none;
    transform: none;
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
    border-radius: 6px;
    width: auto;
}

/* Profile Form BMI Gauge UI */
.bmi-gauge-card {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1.5rem;
}

.bmi-value-display {
    text-align: center;
    padding: 1rem;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
}

.bmi-number {
    font-size: 2.75rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
}

.bmi-category-label {
    font-weight: 600;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.bmi-slider-track {
    position: relative;
    height: 8px;
    background: linear-gradient(to right, #38bdf8 0%, #38bdf8 25%, #10b981 25%, #10b981 50%, #f59e0b 50%, #f59e0b 75%, #ef4444 75%, #ef4444 100%);
    border-radius: 4px;
    margin: 1.5rem 0 0.5rem 0;
}

.bmi-slider-pin {
    position: absolute;
    top: 50%;
    left: 0%; /* Dynamic position */
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    background: #ffffff;
    border: 3px solid var(--color-primary);
    border-radius: 50%;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: left 0.5s ease-out;
}

.bmi-scale-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
}

/* History Logs list & tables */
.history-table-container {
    overflow-x: auto;
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.history-table th {
    padding: 1rem;
    border-bottom: 1px solid var(--card-border);
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.history-table td {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
    color: var(--text-primary);
}

.history-table tr:last-child td {
    border-bottom: none;
}

.history-table tr {
    transition: var(--transition-fast);
}

.history-table tr:hover td {
    background: rgba(255, 255, 255, 0.015);
}

.actions-cell {
    display: flex;
    gap: 0.5rem;
}

.btn-action {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition-fast);
}

.btn-action:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.btn-action.btn-delete:hover {
    color: var(--color-danger);
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
}

/* Splash/Login screen */
.login-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    padding: 1.5rem;
}

.login-card {
    max-width: 420px;
    width: 100%;
    text-align: center;
    padding: 2.5rem 2rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem auto;
    box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.login-logo svg {
    width: 36px;
    height: 36px;
    stroke: white;
    fill: none;
    stroke-width: 2.5;
}

.login-title {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
    letter-spacing: -0.025em;
}

.login-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
}

.btn-google {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition-fast);
}

.btn-google:hover {
    background: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn-google svg {
    width: 18px;
    height: 18px;
}

.login-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1.5rem 0;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--card-border);
}

.login-divider:not(:empty)::before {
    margin-right: .75em;
}

.login-divider:not(:empty)::after {
    margin-left: .75em;
}

.mock-users-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mock-user-btn {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    border-radius: 10px;
    padding: 0.65rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
    text-align: left;
}

.mock-user-btn:hover {
    background: rgba(99, 102, 241, 0.08);
    border-color: var(--card-border-hover);
}

.mock-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}

.mock-user-info {
    display: flex;
    flex-direction: column;
}

.mock-user-name {
    font-size: 0.9rem;
    font-weight: 600;
}

.mock-user-email {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

/* Flash Messages */
.flash-container {
    margin-bottom: 1.5rem;
}

.flash-message {
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid transparent;
}

.flash-success {
    background: rgba(16, 185, 129, 0.1);
    border-color: var(--color-accent);
    color: #a7f3d0;
}

.flash-danger {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--color-danger);
    color: #fca5a5;
}

.flash-info {
    background: rgba(14, 165, 233, 0.1);
    border-color: var(--color-info);
    color: #bae6fd;
}

.flash-close {
    background: transparent;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition-fast);
}

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

/* Empty States */
.empty-state {
    text-align: center;
    padding: 3rem 1.5rem;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    stroke: var(--text-muted);
    margin-bottom: 1rem;
    stroke-width: 1.5;
}

/* Modal styling for editing */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-content {
    max-width: 450px;
    width: 100%;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-close {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.5rem;
    transition: var(--transition-fast);
}

.modal-close:hover {
    color: var(--text-primary);
}

/* Footer details */
footer {
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-top: 1px solid var(--card-border);
    margin-top: auto;
}

/* Chart filter buttons styling */
.chart-filter-group {
    display: flex;
    gap: 0.25rem;
    background: rgba(0, 0, 0, 0.2);
    padding: 0.25rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.chart-filter-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.chart-filter-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.chart-filter-btn.active {
    color: white;
    background: var(--color-primary);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}
