
/* ===== TOAST NOTIFICATIONS ===== */
#toast-container {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
    width: 90%;
    max-width: 360px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 600;
    color: white;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    animation: toastIn 0.35s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
    pointer-events: all;
    width: 100%;
    backdrop-filter: blur(10px);
}

.toast.toast-success { background: linear-gradient(135deg, #10b981, #059669); }
.toast.toast-error   { background: linear-gradient(135deg, #ef4444, #dc2626); }
.toast.toast-info    { background: linear-gradient(135deg, #4A60E4, #6366f1); }
.toast.toast-warning { background: linear-gradient(135deg, #f59e0b, #d97706); }

.toast-icon { font-size: 18px; flex-shrink: 0; }
.toast-msg  { flex: 1; line-height: 1.3; }

.toast.removing {
    animation: toastOut 0.3s ease forwards;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to   { opacity: 0; transform: translateY(10px) scale(0.95); }
}

/* ===== Base Styles & Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-color: #f1f5f9;
    --primary: #4f46e5;
    --primary-light: #6366f1;
    --primary-gradient: linear-gradient(135deg, #4f46e5 0%, #3b82f6 100%);
    --card-bg: rgba(255, 255, 255, 0.65);
    --glass-border: rgba(255, 255, 255, 0.8);
    --text-main: #0f172a;
    --text-muted: #64748b;
    --danger: #ef4444;
    --success: #10b981;
    --shadow-soft: 0 12px 36px rgba(100, 116, 139, 0.15);
    --shadow-card: 0 8px 20px rgba(100, 116, 139, 0.1);
    --border-radius-lg: 28px;
    --border-radius-md: 16px;
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* ===== DARK MODE VARIABLES ===== */
[data-theme="dark"] {
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.85);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --shadow-soft: 0 12px 36px rgba(0, 0, 0, 0.4);
    --shadow-card: 0 8px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] body {
    background-image:
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.08) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(79, 70, 229, 0.08) 0px, transparent 50%);
}

[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
    background: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-main);
}

[data-theme="dark"] .form-input,
[data-theme="dark"] input[type="date"],
[data-theme="dark"] input[type="datetime-local"] {
    background-color: rgba(30, 41, 59, 0.9);
    border-color: rgba(255, 255, 255, 0.12);
    color: var(--text-main);
}

[data-theme="dark"] .icon-button {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-main);
}

[data-theme="dark"] .ghost-btn {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(99, 102, 241, 0.3);
}

[data-theme="dark"] .metric-badge,
[data-theme="dark"] .compact-stat {
    background: rgba(30, 41, 59, 0.9);
}

[data-theme="dark"] .tab-btn {
    background: rgba(30, 41, 59, 0.7);
}

[data-theme="dark"] .list-item,
[data-theme="dark"] .log-card,
[data-theme="dark"] .glass-form,
[data-theme="dark"] .pet-card {
    background: rgba(30, 41, 59, 0.8);
    border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .ring-label {
    background: rgba(15, 23, 42, 0.9);
}

[data-theme="dark"] .activity-rings-container {
    background: rgba(30, 41, 59, 0.6);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .chat-history {
    background: #0f172a;
}

[data-theme="dark"] optgroup {
    background: #1e293b;
}

[data-theme="dark"] .nav-bar {
    background: rgba(15, 23, 42, 0.95);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-theme="dark"] .auth-box {
    background: rgba(30, 41, 59, 0.95);
}


body {
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(at 0% 0%, rgba(59, 130, 246, 0.15) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(79, 70, 229, 0.15) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    overflow-x: hidden;
}

#app-container {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    background: transparent;
    position: relative;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

/* ===== Utilities ===== */
.w-full { width: 100%; }
.danger-text { color: var(--danger) !important; }
.success-text { color: var(--success) !important; }
.primary-text { color: var(--primary) !important; }

/* ===== View Management ===== */
.view {
    width: 100%;
    min-height: 100vh;
    padding: 24px;
    position: absolute;
    top: 0;
    left: 0;
    transition: transform 0.4s ease-in-out, opacity 0.4s ease-in-out, visibility 0.4s;
    transition-behavior: allow-discrete;
}

.view.hidden {
    transform: translateX(100%);
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    z-index: -1;
}

.view.active {
    transform: none;
    opacity: 1;
    pointer-events: auto;
    position: relative;
    visibility: visible;
    z-index: 10;
}

/* ===== Typography & Headers ===== */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-top: 12px;
}

h1, h2, h3 { color: var(--text-main); line-height: 1.2; }
h1 { font-size: 28px; font-weight: 800; }
header p { color: var(--text-muted); font-size: 0.9rem; font-weight: 400; margin-top: 4px; }

.header-icon {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.form-header, .dashboard-header {
    display: flex;
    align-items: center;
    gap: 16px;
    justify-content: flex-start;
}

.dashboard-header { justify-content: space-between; margin-bottom: 16px; }
.dash-pet-info { display: flex; align-items: center; gap: 16px; flex: 1; justify-content: center; }
.dash-pet-info h2 { font-size: 24px; font-weight: 800; }

.dash-avatar-mini {
    width: 80px; height: 80px; border-radius: 50%;
    object-fit: cover; object-position: top center; overflow: hidden;
    background: rgba(255,255,255,0.8);
    border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); color: var(--primary);
    font-size: 32px;
}

.dash-photo-wrapper { position: relative; display: inline-block; }
.edit-photo-btn-mini {
    position: absolute; bottom: 0; right: -4px; width: 28px; height: 28px; border-radius: 50%;
    background: var(--primary); color: white; display: flex; align-items: center; justify-content: center;
    border: 2px solid white; font-size: 11px; cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: var(--transition);
}
.edit-photo-btn-mini:active { transform: scale(0.9); }

/* ===== Pet List & Cards ===== */
.pet-list { display: flex; flex-direction: column; gap: 20px; padding-bottom: 130px; }
.pet-card {
    background: var(--card-bg); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border); border-radius: var(--border-radius-lg);
    padding: 24px; box-shadow: var(--shadow-card); transition: var(--transition);
    position: relative; overflow: hidden; cursor: pointer;
}
.pet-card:active { transform: scale(0.98); }

.pet-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.pet-info-wrapper { display: flex; align-items: center; gap: 16px; }
.pet-avatar-mini { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; object-position: top center; overflow: hidden; }
.pet-avatar-icon {
    width: 52px; height: 52px; border-radius: 50%; background: rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: center; color: var(--primary);
}
.pet-info h3 { font-size: 20px; font-weight: 700; margin-bottom: 4px; }
.pet-info p { font-size: 13px; color: var(--text-muted); font-weight: 600; }

.pet-metrics { display: flex; gap: 16px; margin-bottom: 20px; }
.metric-badge {
    background: rgba(255, 255, 255, 0.8); padding: 6px 12px; border-radius: 20px;
    font-size: 12px; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 4px;
}

.diet-result {
    background: var(--primary-gradient); border-radius: var(--border-radius-md);
    padding: 16px; color: white; display: flex; flex-direction: column; gap: 8px;
}
.diet-total { font-size: 14px; display: flex; justify-content: space-between; align-items: center; }
.diet-total span { font-size: 24px; font-weight: 800; }
.diet-portions {
    background: rgba(255, 255, 255, 0.2); padding: 8px 12px; border-radius: 8px;
    font-size: 13px; display: flex; align-items: center; gap: 8px; font-weight: 600;
}

.diet-result-compact {
    display: flex; flex-direction: column; gap: 12px;
    background: rgba(255, 255, 255, 0.4); padding: 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, 0.6);
}

.compact-stat {
    display: flex; justify-content: space-between; align-items: center;
    background: white; padding: 12px 16px; border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.compact-stat .stat-label { font-size: 13px; color: var(--text-muted); font-weight: 600; }
.compact-stat .stat-value { font-size: 16px; font-weight: 800; color: var(--primary); }

.delete-btn {
    position: absolute; top: 12px; right: 12px; background: rgba(239, 68, 68, 0.1);
    color: var(--danger); border: none; width: 32px; height: 32px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; z-index: 5;
    cursor: pointer;
}

.horizontal-card {
    display: flex; flex-direction: row; gap: 15px; padding: 16px 16px 16px 10px; align-items: center;
}
.card-left {
    flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.pet-avatar-large {
    width: 160px; height: 240px; flex-shrink: 0; aspect-ratio: unset; border-radius: 120px; object-fit: cover; object-position: center;
    border: 4px solid white; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.pet-avatar-large-icon {
    width: 160px; height: 240px; flex-shrink: 0; aspect-ratio: unset; border-radius: 120px; background: rgba(255,255,255,0.8);
    display: flex; align-items: center; justify-content: center; font-size: 56px;
    color: var(--primary-light); border: 4px solid white; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.card-right {
    flex: 1; display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
}
.card-right .pet-info h3 { font-size: 18px; margin-bottom: 2px; }
.card-right .pet-info p { font-size: 11px; color: var(--text-muted); line-height: 1.3; font-weight: 500; }

.compact-btn {
    padding: 8px; font-size: 12px; border-radius: 10px; width: 100%;
}
.quick-actions {
    display: flex; gap: 6px; width: 100%;
}
.ghost-btn {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 4px; padding: 6px 2px; background: white; border: 1px solid rgba(79, 70, 229, 0.3);
    border-radius: 8px; color: var(--primary); font-size: 9px; font-weight: 700; cursor: pointer;
    text-transform: uppercase; transition: var(--transition); text-align: center;
}
.ghost-btn i { font-size: 14px; }
.ghost-btn:active { background: var(--primary); color: white; }

.floating-assistant-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 999;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: white;
    border: none;
    border-radius: 50px;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.4);
    cursor: pointer;
    font-size: 15px;
    font-weight: 700;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.floating-assistant-btn:active {
    transform: scale(0.9);
}
.floating-assistant-btn i.fa-dog {
    font-size: 20px;
}

/* ===== Form Styles ===== */
.glass-form {
    background: var(--card-bg); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border); border-radius: var(--border-radius-lg);
    padding: 24px; box-shadow: var(--shadow-soft); margin-top: 16px;
}

.avatar-upload-container { display: flex; flex-direction: column; align-items: center; margin-bottom: 24px; gap: 12px; }
.avatar-preview {
    width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, 0.8);
    border: 2px dashed var(--primary-light); display: flex; align-items: center; justify-content: center;
    overflow: hidden; position: relative;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.avatar-preview i { font-size: 28px; color: var(--primary-light); }
.avatar-label {
    background: var(--text-muted); color: white; padding: 8px 16px; border-radius: 20px;
    font-size: 13px; font-weight: 600; cursor: pointer; transition: var(--transition);
}
.avatar-label:active { transform: scale(0.95); }

.input-group { margin-bottom: 20px; display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; gap: 16px; }
.half { width: 50%; }

label { font-size: 13px; font-weight: 600; color: var(--text-muted); padding-left: 4px; }
input, select, textarea {
    width: 100%; padding: 14px 16px; border-radius: 12px; border: 2px solid rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.8); font-size: 15px; color: var(--text-main); font-family: 'Outfit';
    transition: var(--transition); outline: none; appearance: none;
}
.form-input, .flatpickr-input, input[type="date"] {
    width: 100%; padding: 10px 12px; border: 1px solid #D1D5DB; border-radius: 8px; font-size: 1rem; color: #374151; background-color: #fff; box-sizing: border-box; transition: border-color 0.2s, box-shadow 0.2s; margin-bottom: 12px; font-family: inherit;
}
.form-input:focus, .flatpickr-input:focus, input[type="date"]:focus {
    border-color: #4A60E4; outline: none; box-shadow: 0 0 0 3px rgba(74, 96, 228, 0.1);
}
textarea { resize: vertical; }

select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat; background-position: right 16px center; background-size: 16px;
    padding-right: 48px;
}
input:focus, select:focus, textarea:focus { border-color: var(--primary-light); background: #ffffff; box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1); }
optgroup { font-weight: 700; color: var(--primary); background: white; }

/* ===== Buttons ===== */
.primary-button {
    width: 100%; padding: 16px; border-radius: 16px; background: var(--primary-gradient);
    color: white; border: none; font-size: 16px; font-weight: 600; cursor: pointer;
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.primary-button:active { transform: scale(0.98); }

.danger-button {
    width: 100%; padding: 16px; border-radius: 16px; background: rgba(239, 68, 68, 0.1);
    color: var(--danger); border: 2px solid rgba(239, 68, 68, 0.2); font-size: 16px; font-weight: 700; cursor: pointer;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.1); display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: var(--transition);
}
.danger-button:active { transform: scale(0.98); background: rgba(239, 68, 68, 0.2); }

.secondary-button {
    width: 100%; padding: 14px; border-radius: 16px; background: transparent; color: var(--text-muted);
    border: 2px solid rgba(100, 116, 139, 0.2); font-size: 15px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
}
.secondary-button:active { background: rgba(0,0,0,0.05); transform: scale(0.98); }

.icon-button {
    width: 40px; height: 40px; border-radius: 50%; background: white; border: none;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05); color: var(--text-main); display: flex; align-items: center;
    justify-content: center; cursor: pointer;
}

.fab-button {
    position: fixed; bottom: 32px; right: max(24px, calc(50vw - 216px));
    width: 64px; height: 64px; border-radius: 24px; background: var(--primary-gradient); color: white;
    font-size: 24px; box-shadow: 0 12px 24px rgba(79, 70, 229, 0.4); border: none; cursor: pointer; z-index: 9999;
}

/* ===== TABS & DASHBOARD ===== */
.tabs-nav {
    display: flex; gap: 8px; margin-bottom: 24px; overflow-x: auto; padding-bottom: 8px;
    white-space: nowrap;
    scrollbar-width: thin; /* Soporte Firefox */
    scrollbar-color: var(--primary-light) transparent;
}
.tabs-nav::-webkit-scrollbar { 
    height: 6px; 
}
.tabs-nav::-webkit-scrollbar-track { 
    background: rgba(100, 116, 139, 0.1); 
    border-radius: 10px; 
}
.tabs-nav::-webkit-scrollbar-thumb { 
    background: var(--primary-light); 
    border-radius: 10px; 
}
.tab-btn {
    padding: 10px 16px; border-radius: 20px; border: none; background: rgba(255,255,255,0.5);
    color: var(--text-muted); font-size: 14px; font-weight: 600; cursor: pointer;
    display: flex; align-items: center; gap: 6px; transition: var(--transition); white-space: nowrap;
    flex-shrink: 0;
}
.tab-btn.active {
    background: var(--text-main); color: white; box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.tab-pane { display: none; animation: fadeIn 0.4s ease-out; flex-direction: column; gap: 16px; }
.tab-pane.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.tab-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }

.form-section-title {
    font-size: 16px; font-weight: 700; color: var(--primary);
    margin-bottom: 16px; margin-top: 8px; border-bottom: 1px solid rgba(100, 116, 139, 0.2);
    padding-bottom: 8px; display: flex; align-items: center; gap: 8px;
}

/* Clinics */
.clinic-card { padding: 20px; margin-top: 0; }
.badge-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin-bottom: 16px; }
.badge-list li {
    background: rgba(239, 68, 68, 0.1); color: var(--danger); padding: 4px 12px;
    border-radius: 12px; font-size: 12px; font-weight: 600; display:flex; align-items:center; gap: 6px;
}
.badge-list li button {
    background: none; border: none; color: inherit; cursor: pointer; opacity: 0.6;
}

.add-mini-form { display: flex; gap: 8px; }
.add-mini-form.col { flex-direction: column; }
.add-mini-form input { padding: 10px; font-size: 13px; }
.add-mini-form button {
    padding: 10px 16px; background: rgba(79, 70, 229, 0.1); color: var(--primary);
    border: none; border-radius: 12px; font-weight: 700; cursor: pointer;
}

.list-container { display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; }
.list-item {
    background: rgba(255,255,255,0.6); padding: 12px; border-radius: 12px; border: 1px solid rgba(255,255,255,0.8);
    display: flex; justify-content: space-between; align-items: center;
}
.list-item h4 { font-size: 14px; font-weight: 700; }
.list-item small { color: var(--text-muted); font-size: 12px; }

.task-completed h4, .task-completed small {
    opacity: 0.6;
    text-decoration: line-through;
    transition: opacity 0.3s ease;
}

/* Logs */
.custom-file-upload {
    border: 2px dashed var(--primary-light);
    background: rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--primary);
    font-weight: 600;
    transition: var(--transition);
}
.custom-file-upload:active {
    transform: scale(0.98);
}
.custom-file-upload i {
    font-size: 24px;
}

.log-card {
    background: rgba(255,255,255,0.8); border-radius: var(--border-radius-md); overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
.log-card img { width: 100%; height: 200px; object-fit: cover; }
.log-content { padding: 16px; }
.log-content p { font-size: 14px; font-weight: 500; margin-bottom: 8px; }
.log-date { font-size: 11px; color: var(--text-muted); font-weight: 600; }

/* Chat Bot (Gemini) */
.chat-container { height: calc(100vh - 180px); background: white; border-radius: 24px; overflow: hidden; box-shadow: var(--shadow-soft); flex-direction: column; }
.chat-header { background: var(--text-main); color: white; padding: 16px; font-weight: 700; display:flex; gap: 8px; align-items:center;}
.chat-history { flex: 1; overflow-y: auto; padding: 16px 16px 60px 16px; display: flex; flex-direction: column; gap: 12px; background: #f8fafc; scroll-behavior: smooth;}
.chat-history::-webkit-scrollbar { width: 6px; }
.chat-history::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }

.chat-msg { max-width: 85%; padding: 12px 16px; border-radius: 20px; font-size: 14px; line-height: 1.5; position: relative; }
.chat-msg p { margin-bottom: 8px; } /* Support for markdown paragraphs */
.chat-msg p:last-child { margin-bottom: 0; }
.user-msg { background: var(--primary); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg { background: #e2e8f0; color: var(--text-main); align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-msg strong { color: var(--primary); }

.chat-input-area { padding: 16px; background: white; border-top: 1px solid #e2e8f0; display: flex; gap: 8px; }
.chat-input-area input { flex: 1; border-radius: 24px; background: #f1f5f9; border:none; padding: 12px 20px; }
.chat-input-area button { 
    width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: white; 
    border: none; cursor: pointer; display:flex; justify-content:center; align-items:center;
}
.chat-input-area button:disabled { background: #cbd5e1; cursor: not-allowed; }

.empty-state { text-align: center; padding: 40px 20px; opacity: 0.6; }
.empty-state i { font-size: 48px; margin-bottom: 16px; color: var(--text-muted); }

/* Result View Styling */
.result-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(79, 70, 229, 0.2);
    border: 4px solid white;
}

.result-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.result-avatar i {
    font-size: 42px;
    color: var(--primary-light);
}

/* ===== Auth UI Styles ===== */
#auth-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 100;
}

.auth-box {
    width: 100%;
    max-width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 24px;
    background: rgba(255, 255, 255, 0.85);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 20px 40px rgba(74, 96, 228, 0.15);
    border: 1px solid rgba(255, 255, 255, 1);
}

.auth-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #4A60E4 0%, #3b82f6 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    margin-bottom: 24px;
    box-shadow: 0 10px 20px rgba(74, 96, 228, 0.3);
}

.auth-box h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: 8px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin-bottom: 32px;
    font-weight: 500;
}

#login-form, #register-form {
    width: 100%;
    text-align: left;
}

#login-form .input-group, #register-form .input-group {
    margin-bottom: 20px;
}

#login-form label, #register-form label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
}

#login-form input, #register-form input {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid rgba(0,0,0,0.05);
    background: rgba(255,255,255,0.9);
    font-size: 15px;
    transition: var(--transition);
}

#login-form input:focus, #register-form input:focus {
    border-color: #4A60E4;
    box-shadow: 0 0 0 4px rgba(74, 96, 228, 0.1);
}

#btn-temp-login {
    margin-top: 12px;
    background: linear-gradient(135deg, #4A60E4 0%, #3b82f6 100%);
    box-shadow: 0 8px 20px rgba(74, 96, 228, 0.3);
}

.auth-footer {
    margin-top: 24px;
    width: 100%;
}

.ghost-btn-text {
    background: none;
    border: none;
    color: #4A60E4;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* Google Sign-In */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0 16px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 600;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(100, 116, 139, 0.2);
}

.google-signin-btn {
    width: 100%;
    padding: 14px 16px;
    border-radius: 16px;
    border: 2px solid rgba(100, 116, 139, 0.2);
    background: white;
    color: #3c4043;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: var(--transition);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    font-family: 'Outfit', sans-serif;
}
.google-signin-btn:active {
    transform: scale(0.98);
    background: #f8f9fa;
}
.google-signin-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

[data-theme="dark"] .google-signin-btn {
    background: rgba(30, 41, 59, 0.9);
    color: var(--text-main);
    border-color: rgba(255, 255, 255, 0.1);
}

.password-hint {
    color: #757575;
    font-size: 0.8rem;
    margin-top: 4px;
    display: block;
}

/* Legal Disclaimers */
.legal-disclaimer {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    line-height: 1.4;
    margin-bottom: 20px;
    padding: 0 4px;
}

.ai-disclaimer-banner {
    background-color: #fffbeb;
    color: #b45309;
    padding: 10px 16px;
    font-size: 12px;
    font-weight: 600;
    text-align: center;
    border-bottom: 1px solid #fde68a;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

/* ==========================================
   MÓDULO DE ACTIVIDAD (GRID & MODAL)
   ========================================== */

/* --- Cuadrícula de Botones Estilo Glassmorphism --- */
.activity-grid {
    display: grid;
    /* Grid automático y responsivo para dispositivos pequeños */
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.activity-item {
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-md);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
}

/* Efecto hover vibrante y micro-animación */
.activity-item:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--primary-light);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.15);
}

/* Efecto al presionar (click / active) */
.activity-item:active {
    transform: translateY(2px) scale(0.96);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.1);
    background: rgba(255, 255, 255, 0.95);
}

/* Placeholder Espacio del Icono Vectorial SVG */
.activity-icon-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    /* Un gradiente tenue inicial */
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.1) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), background 0.3s, color 0.3s;
}

.activity-item:hover .activity-icon-placeholder {
    background: var(--primary-gradient);
    color: white;
    transform: scale(1.15) rotate(5deg);
}

.activity-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
    text-align: center;
    transition: color 0.3s;
}

.activity-item:hover .activity-title {
    color: var(--primary);
}

/* --- Modal Estético --- */
.activity-modal-card {
    /* Animación atractiva de entrada tipo iOS */
    animation: modalSlidePop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

@keyframes modalSlidePop {
    0% { opacity: 0; transform: translateY(40px) scale(0.95); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-muted);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 14px;
    transition: var(--transition);
}

.modal-close-btn:hover, .modal-close-btn:active {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    transform: scale(0.9);
}

/* Espacio grande para el perro animado en el Modal */
.activity-hero-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 24px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    border: 3px dashed var(--primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 56px;
    color: var(--primary);
    box-shadow: inset 0 8px 24px rgba(79, 70, 229, 0.1);
    animation: floatingIcon 3s ease-in-out infinite;
}

@keyframes floatingIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

/* Consejo "Sabías que..." */
.activity-tip {
    background: rgba(245, 158, 11, 0.1);
    border-left: 3px solid #f59e0b;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
}

/* --- Control de Slider (Barrita Deslizante) Premium --- */
.slider-value-display {
    font-size: 14px;
    font-weight: 800;
    color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
    padding: 6px 14px;
    border-radius: 12px;
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
}

.slider-value-display span {
    font-size: 26px;
}

/* Reset visual del nativo <input type="range"> */
.premium-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 8px;
    background: rgba(100, 116, 139, 0.15);
    border-radius: 8px;
    outline: none;
    margin: 0;
    padding: 0;
    border: none;
    /* Efecto para "llenar" visualmente la barra a la izquierda */
    background-image: var(--primary-gradient);
    background-size: 50% 100%; /* Este 50% se debe actualizar via JS después */
    background-repeat: no-repeat;
}

.premium-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-slider::-webkit-slider-thumb:active {
    transform: scale(1.25);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.5);
}

.premium-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
    border: 4px solid white;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
    transition: transform 0.1s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.premium-slider::-moz-range-thumb:active {
    transform: scale(1.25);
}

/* --- Aviso Legal al final --- */
.ethical-disclaimer {
    font-size: 11px;
    color: var(--text-muted);
    text-align: center;
    background: rgba(100, 116, 139, 0.05);
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    line-height: 1.4;
}

/* --- Selector de Intensidad --- */
.intensity-btn {
    flex: 1;
    padding: 10px 4px;
    border-radius: 12px;
    border: 2px solid rgba(100, 116, 139, 0.2);
    background: rgba(255, 255, 255, 0.5);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
}

.intensity-btn:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: var(--primary-light);
}

.intensity-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

/* --- Anillos de Desgaste (Activity Rings) --- */
.activity-rings-container {
    display: flex;
    justify-content: space-evenly;
    align-items: center;
    background: rgba(255, 255, 255, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--border-radius-md);
    padding: 16px;
    margin-bottom: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}

.ring-wrapper {
    position: relative;
    width: 100px;
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.ring-svg {
    width: 100px;
    height: 100px;
    transform: rotate(-90deg); /* Para que empiece arriba a las 12 */
    position: absolute;
    top: 0;
    left: 0;
}

.ring-bg {
    fill: none;
    stroke: rgba(100, 116, 139, 0.15); /* text-muted sutil */
    stroke-width: 8;
}

.ring-progress {
    fill: none;
    stroke-width: 8;
    stroke-linecap: round;
    /* Circumferencia aproximada de radio 40 -> 2 * 3.1416 * 40 = ~251.3 */
    stroke-dasharray: 251.3;
    stroke-dashoffset: 251.3; /* Inicio al 0% visual */
    transition: stroke-dashoffset 1.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ring-physical {
    stroke: var(--primary); /* Azul/Púrpura */
    filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.3));
}

.ring-mental {
    stroke: var(--success); /* Verde/Turquesa */
    filter: drop-shadow(0 2px 4px rgba(16, 185, 129, 0.3));
}

.ring-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(4px);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ring-label i {
    font-size: 16px;
    margin-bottom: 2px;
}

.ring-label span {
    font-size: 10px;
    font-weight: 800;
    color: var(--text-main);
}
