/* filepath: styles.css */
:root {
    --primary: #3b82f6;
    --primary-dark: #2563eb;
    --secondary: #22c55e;
    --danger: #ef4444;
    --warning: #facc15;
    
    /* Default Light Mode Colors */
    --bg: #f1f5f9;
    --bg-sidebar: #1e293b;
    --bg-card: #ffffff;
    --light: #e2e8f0;
    --gray: #64748b;
    --dark: #0f172a;
    --dark-light: #334155;
    --white: #ffffff; /* Keep for button text */
    
    /* Border for light mode */
    --border: #e2e8f0;
    
    /* Enhanced shadows for light mode */
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-width: 260px;
    --sidebar-collapsed: 70px;
}

[data-theme="dark"] {
    --bg: #0f172a;
    --bg-sidebar: #0b1120;
    --bg-card: #1e293b;
    --light: #334155;
    --gray: #94a3b8;
    --dark: #f8fafc;
    --dark-light: #e2e8f0;
    --border: transparent;
    
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.18);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.15);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    transition: background 0.3s ease, color 0.3s ease;
}

/* ==================== SIDEBAR ==================== */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--bg-sidebar);
    color: var(--white);
    position: fixed;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    z-index: 100;
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar-header {
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: hidden;
}

.logo-icon {
    font-size: 1.8rem;
    min-width: 32px;
}

.logo-text {
    font-size: 1.2rem;
    font-weight: 600;
    white-space: nowrap;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
}

.sidebar.collapsed .sidebar-toggle i {
    transform: rotate(180deg);
}

.sidebar-nav {
    flex: 1;
    padding: 20px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
}

.nav-item i {
    font-size: 1.2rem;
    min-width: 20px;
    text-align: center;
}

.nav-item .nav-text {
    white-space: nowrap;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.sidebar.collapsed .nav-item .nav-text {
    opacity: 0;
    width: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

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

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer .btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.sidebar.collapsed .sidebar-footer .btn span {
    display: none;
}

/* ==================== MAIN CONTENT ==================== */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 30px;
    transition: margin-left 0.3s ease;
    min-height: 100vh;
}

.sidebar.collapsed ~ .main-content {
    margin-left: var(--sidebar-collapsed);
}

.content-section {
    display: none;
    animation: fadeSlideUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.section-header {
    margin-bottom: 30px;
}

.section-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.section-header .subtitle {
    color: var(--gray);
    font-size: 1.1rem;
}

/* ==================== TAB NAVIGATION ==================== */
.tab-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    background: var(--bg-card);
    padding: 8px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    border: none;
    background: transparent;
    color: var(--gray);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.tab-btn:hover {
    background: var(--light);
    color: var(--dark);
}

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

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

.module-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.module-header h2 {
    font-size: 1.75rem;
    font-weight: 600;
}

/* Day Filter */
.day-filter {
    display: flex;
    align-items: center;
    gap: 10px;
}

.day-filter label {
    font-weight: 500;
    color: var(--gray);
}

.day-filter select {
    padding: 10px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    background: var(--bg-card);
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.day-filter select:focus {
    outline: none;
    border-color: var(--primary);
}

/* Forms */
.add-routine-form, .form-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--border);
}

.add-routine-form h3, .form-card h3 {
    font-size: 1.25rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.form-row {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.form-row input, .form-row select {
    flex: 1;
    min-width: 120px;
    padding: 12px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

.form-row input:focus, .form-row select:focus {
    outline: none;
    border-color: var(--primary);
}

.form-row input::placeholder {
    color: var(--gray);
}

/* Checkbox */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-small {
    padding: 10px 16px;
    font-size: 0.9rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--white);
}

.btn-secondary:hover {
    background: #059669;
    transform: translateY(-2px) scale(1.02);
    box-shadow: var(--shadow-lg);
}

.btn-danger {
    background: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background: #dc2626;
}

/* Routines Grid */
.routines-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.routine-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.routine-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.routine-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.routine-header h3 {
    font-size: 1.25rem;
    text-transform: capitalize;
}

.routine-header .day-badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
}

.routine-exercises {
    padding: 16px;
}

.exercise-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
    transition: background 0.3s ease;
}

.exercise-item:hover {
    background: #e5e7eb;
}

.exercise-info {
    flex: 1;
}

.exercise-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 4px;
}

.exercise-details {
    font-size: 0.9rem;
    color: var(--gray);
}

.exercise-actions {
    display: flex;
    gap: 8px;
}

.exercise-actions button {
    padding: 6px 12px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.btn-edit {
    background: var(--warning);
    color: var(--white);
}

.btn-edit:hover {
    background: #d97706;
}

.btn-delete {
    background: var(--danger);
    color: var(--white);
}

.btn-delete:hover {
    background: #dc2626;
}

.empty-message {
    text-align: center;
    color: var(--gray);
    padding: 40px 20px;
    font-style: italic;
}

/* Calories Summary */
.calories-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.cal-card {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.3s ease;
    border: 1px solid var(--border);
}

.cal-card:hover {
    transform: translateY(-2px);
}

.cal-card.consumed {
    border-left: 4px solid var(--warning);
}

.cal-card.burned {
    border-left: 4px solid var(--secondary);
}

.cal-card.balance {
    border-left: 4px solid var(--primary);
}

.cal-card.balance.positive {
    border-left-color: var(--danger);
}

.cal-card.balance.negative {
    border-left-color: var(--secondary);
}

.cal-icon {
    font-size: 2.5rem;
}

.cal-info {
    display: flex;
    flex-direction: column;
}

.cal-label {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 4px;
}

.cal-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
}

.cal-unit {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Calories Forms */
.calories-forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

/* Calories Lists */
.calories-lists {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

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

.list-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.item-list {
    list-style: none;
    max-height: 300px;
    overflow-y: auto;
}

.item-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid var(--light);
    transition: background 0.2s ease;
}

.item-list li:hover {
    background: var(--light);
}

.item-list li:last-child {
    border-bottom: none;
}

.item-name {
    font-weight: 500;
    color: var(--dark);
}

.item-calories {
    font-weight: 600;
    color: var(--primary);
}

.item-delete {
    background: none;
    border: none;
    color: var(--danger);
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.item-delete:hover {
    background: #fee2e2;
}

/* Summary Section */
.summary-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

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

.summary-card h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.summary-list {
    max-height: 300px;
    overflow-y: auto;
}

.day-calories {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.day-cal-item {
    display: flex;
    justify-content: space-between;
    padding: 12px;
    background: var(--light);
    border-radius: var(--radius-sm);
}

.day-cal-item.total {
    background: var(--primary);
    color: var(--white);
}

/* Chart */
.chart-container {
    background: var(--bg-card);
    padding: 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}

.chart-container h3 {
    font-size: 1.1rem;
    margin-bottom: 16px;
    color: var(--dark);
}

.chart-wrapper {
    position: relative;
    height: 350px;
    width: 100%;
}

/* ==================== AI ASSISTANT ==================== */
.ai-chat-container {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
    border: 1px solid var(--border);
}

.chat-messages {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 14px;
    max-width: 85%;
}

.message.bot-message {
    align-self: flex-start;
}

.message.user-message {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.message-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.bot-message .message-avatar {
    background: var(--primary);
    color: var(--white);
}

.user-message .message-avatar {
    background: var(--secondary);
    color: var(--white);
}

.message-content {
    background: var(--light);
    padding: 16px 20px;
    border-radius: 18px;
    border-top-left-radius: 4px;
}

.user-message .message-content {
    background: var(--primary);
    color: var(--white);
    border-radius: 18px;
    border-top-right-radius: 4px;
}

.message-content p {
    margin-bottom: 10px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.message-content li {
    margin-bottom: 6px;
}

.chat-input-container {
    padding: 20px;
    border-top: 1px solid var(--light);
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 14px 20px;
    border: 2px solid var(--light);
    border-radius: 30px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
}

.chat-input-container .btn {
    padding: 14px 24px;
    border-radius: 30px;
}

.quick-actions {
    padding: 0 20px 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.quick-btn {
    padding: 10px 16px;
    background: var(--light);
    border: none;
    border-radius: 20px;
    font-size: 0.9rem;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-btn:hover {
    background: var(--primary);
    color: var(--white);
}

/* ==================== STUDIES SECTION ==================== */
.studies-categories {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.category-btn {
    padding: 10px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.category-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.studies-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.study-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--border);
}

.study-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.study-card.hidden {
    display: none;
}

.study-header {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
}

.study-icon {
    font-size: 2rem;
}

.study-header h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--dark);
}

.study-description {
    color: var(--gray);
    margin-bottom: 16px;
    line-height: 1.6;
}

.study-content {
    background: var(--light);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.study-content p {
    margin-bottom: 12px;
}

.study-content h4 {
    font-size: 1rem;
    margin: 14px 0 8px;
    color: var(--dark);
}

.study-content ul {
    padding-left: 20px;
}

.study-content li {
    margin-bottom: 6px;
    color: var(--dark-light);
}

.study-actions {
    display: flex;
    gap: 12px;
}

.btn-expand {
    flex: 1;
    padding: 10px 16px;
    background: var(--light);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-expand:hover {
    background: #e5e7eb;
}

.btn-expand i {
    transition: transform 0.3s ease;
}

.btn-expand.expanded i {
    transform: rotate(180deg);
}

.btn-apply {
    padding: 10px 16px;
    background: var(--secondary);
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.btn-apply:hover {
    background: #059669;
}

/* ==================== EJERCICIOS SECTION ==================== */
.exercises-filters {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px 16px;
    gap: 12px;
    transition: border-color 0.3s ease;
}

.search-box:focus-within {
    border-color: var(--primary);
}

.search-box i {
    color: var(--gray);
    font-size: 1.1rem;
}

.search-box input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
    font-family: inherit;
    color: var(--dark);
}

.search-box input::placeholder {
    color: var(--gray);
}

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

.filter-btn {
    padding: 10px 20px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    border-radius: 25px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.filter-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: var(--white);
}

.exercises-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.exercise-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.exercise-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.exercise-card.hidden {
    display: none;
}

.exercise-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--dark-light);
}

.exercise-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.exercise-card:hover .exercise-image img {
    transform: scale(1.08);
}

.exercise-info {
    padding: 20px;
}

.exercise-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary);
    color: var(--white);
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 12px;
}

.exercise-info h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 10px;
}

.exercise-info p {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==================== SUPLEMENTOS SECTION ==================== */
.suplementos-filters {
    margin-bottom: 24px;
}

.objective-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.disclaimer-alert {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(245, 158, 11, 0.1);
    color: #b45309;
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-top: 16px;
    font-size: 0.9rem;
    border-left: 4px solid #f59e0b;
}

.disclaimer-alert i {
    font-size: 1.2rem;
}

.suplementos-recommendation {
    background: var(--bg-card);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: var(--shadow);
    animation: fadeIn 0.4s ease;
}

.suplementos-recommendation i {
    font-size: 2rem;
    color: var(--primary);
}

.suplementos-recommendation-content h4 {
    color: var(--dark);
    margin-bottom: 4px;
    font-size: 1.1rem;
}

.suplementos-recommendation-content p {
    color: var(--gray);
    font-size: 0.95rem;
}

.suplementos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.suplemento-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
}

.suplemento-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.suplemento-card.hidden {
    display: none;
}

.suplemento-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    background: var(--dark-light);
}

.suplemento-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.suplemento-card:hover .suplemento-image img {
    transform: scale(1.08);
}

.suplemento-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.suplemento-info h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 8px;
}

.suplemento-desc {
    color: var(--gray);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 16px;
}

.suplemento-details {
    margin-top: auto;
    border-top: 1px solid var(--light);
    padding-top: 12px;
}

.suplemento-benefit, .suplemento-timing {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--dark-light);
    margin-bottom: 8px;
}

.suplemento-benefit i {
    color: var(--secondary);
    margin-top: 2px;
}

.suplemento-timing i {
    color: var(--primary);
    margin-top: 2px;
}

/* ==================== GAME SECTION ==================== */
.game-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 500px;
}

.game-card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 600px;
    padding: 30px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
}

.game-screen {
    display: none;
    animation: fadeIn 0.4s ease;
    text-align: center;
}

.game-screen.active {
    display: block;
}

.game-icon-large {
    font-size: 4rem;
    margin-bottom: 20px;
    display: inline-block;
    animation: bounce 2s infinite;
}

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

.game-stats {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

.stat-box {
    background: var(--light);
    padding: 15px 25px;
    border-radius: var(--radius-sm);
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 3px solid var(--primary);
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark);
}

.btn-large {
    font-size: 1.2rem;
    padding: 15px 30px;
    width: 100%;
}

/* Game Play Styles */
.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-weight: 600;
    color: var(--gray);
}

.score-display {
    background: var(--primary);
    color: var(--white);
    padding: 5px 12px;
    border-radius: 20px;
}

.timer-container {
    width: 100%;
    height: 8px;
    background: var(--light);
    border-radius: 4px;
    margin-bottom: 25px;
    overflow: hidden;
}

.timer-bar {
    height: 100%;
    background: var(--secondary);
    width: 100%;
    transition: width 1s linear, background-color 0.3s;
}

.timer-bar.warning {
    background: var(--warning);
}

.timer-bar.danger {
    background: var(--danger);
}

.question-container {
    margin-bottom: 30px;
}

.question-container h3 {
    font-size: 1.4rem;
    color: var(--dark);
    line-height: 1.4;
}

.options-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 20px;
}

.option-btn {
    background: var(--bg-card);
    border: 2px solid var(--light);
    padding: 15px 20px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 500;
    color: var(--dark);
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
}

.option-btn:hover:not(:disabled) {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
    transform: translateY(-2px);
}

.option-btn.correct {
    background: #ecfdf5;
    border-color: var(--secondary);
    color: #065f46;
}

.option-btn.incorrect {
    background: #fef2f2;
    border-color: var(--danger);
    color: #991b1b;
}

.option-btn:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.feedback-box {
    background: var(--light);
    padding: 20px;
    border-radius: var(--radius-sm);
    margin-top: 20px;
    animation: slideUp 0.3s ease;
}

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

.feedback-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.feedback-box.success {
    border-left: 4px solid var(--secondary);
    background: #ecfdf5;
}

.feedback-box.error {
    border-left: 4px solid var(--danger);
    background: #fef2f2;
}

#feedbackTitle {
    font-size: 1.2rem;
    margin-bottom: 5px;
}

.success #feedbackTitle { color: var(--secondary); }
.error #feedbackTitle { color: var(--danger); }

/* Result Screen Styles */
.final-score-box {
    background: var(--primary);
    color: var(--white);
    padding: 20px;
    border-radius: var(--radius);
    margin: 20px 0;
    display: inline-block;
}

.final-score-label {
    display: block;
    font-size: 0.9rem;
    opacity: 0.8;
    text-transform: uppercase;
}

.final-score-value {
    display: block;
    font-size: 3rem;
    font-weight: 700;
}

.result-message {
    font-size: 1.2rem;
    color: var(--gray);
    margin-bottom: 30px;
}

/* ==================== MOBILE HEADER & OVERLAY ==================== */
.mobile-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    background: var(--bg-card);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 90;
}

.mobile-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--dark);
}

.mobile-menu-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 95;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 1024px) {
    .sidebar {
        width: var(--sidebar-collapsed);
    }
    
    .sidebar .logo-text,
    .sidebar .nav-item .nav-text,
    .sidebar .sidebar-footer .btn span {
        display: none;
    }
    
    .main-content {
        margin-left: var(--sidebar-collapsed);
    }
}

@media (max-width: 768px) {
    .mobile-header {
        display: flex;
    }
    
    .sidebar {
        transform: translateX(-100%);
        width: 260px;
        z-index: 100;
        box-shadow: var(--shadow-lg);
    }
    
    .sidebar.mobile-open {
        transform: translateX(0);
    }
    
    .sidebar.mobile-open .logo-text,
    .sidebar.mobile-open .nav-item .nav-text,
    .sidebar.mobile-open .sidebar-footer .btn span {
        display: block;
        opacity: 1;
        width: auto;
    }
    
    .main-content {
        margin-left: 0;
        padding: 15px;
    }
    
    .section-header {
        margin-bottom: 20px;
    }

    .section-header h1 {
        font-size: 1.5rem;
    }
    
    .tab-nav {
        flex-direction: column;
        gap: 5px;
    }
    
    .module-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-row input, .form-row select {
        width: 100%;
    }
    
    /* Grids to single column */
    .routines-grid,
    .calories-summary,
    .calories-forms,
    .calories-lists,
    .summary-container,
    .studies-grid,
    .exercises-grid,
    .progress-dashboard {
        grid-template-columns: 1fr;
    }

    /* Cards spacing reduced */
    .add-routine-form, .form-card, .routine-card, .cal-card, .list-card, .summary-card, .chart-container, .study-card, .game-card {
        padding: 16px;
    }
    
    /* AI Chat Mobile */
    .ai-chat-container {
        height: calc(100vh - 160px);
        min-height: 400px;
        position: relative;
    }
    
    .chat-messages {
        padding: 15px;
        padding-bottom: 80px;
    }
    
    .chat-input-container {
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        background: var(--bg-card);
        border-radius: 0 0 var(--radius) var(--radius);
        padding: 12px;
    }
    
    /* Game Mobile */
    .game-icon-large {
        font-size: 3rem;
    }
    
    .stat-value {
        font-size: 1.4rem;
    }
    
    .option-btn {
        padding: 15px;
        min-height: 60px;
    }
}

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

::-webkit-scrollbar-track {
    background: var(--light);
    border-radius: 4px;
}

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

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-light);
}

/* ==================== PROGRESO ==================== */
.progress-dashboard {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 24px;
}

@media (max-width: 1024px) {
    .progress-dashboard {
        grid-template-columns: 1fr;
    }
}

.profile-card {
    border-top: 4px solid var(--primary);
}

.objective-help {
    font-size: 0.85rem;
    color: var(--gray);
    margin-top: 8px;
    font-style: italic;
}

.w-100 {
    width: 100%;
}

.weight-history {
    margin-top: 24px;
}

/* ==================== SKELETON LOADING ==================== */
.skeleton {
    background: #eee;
    background: linear-gradient(110deg, #ececec 8%, #f5f5f5 18%, #ececec 33%);
    border-radius: var(--radius-sm);
    background-size: 200% 100%;
    animation: 1.5s shine linear infinite;
}

.skeleton-text {
    height: 14px;
    margin-bottom: 8px;
    border-radius: 4px;
}

.skeleton-title {
    height: 24px;
    margin-bottom: 16px;
    width: 50%;
}

.skeleton-block {
    height: 200px;
    border-radius: var(--radius);
}

@keyframes shine {
    to {
        background-position-x: -200%;
    }
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    background: var(--bg-card);
    color: var(--dark);
    padding: 16px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 500;
    pointer-events: auto;
    animation: toastEnter 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    transform-origin: bottom right;
    border-left: 4px solid var(--primary);
}

.toast.success {
    border-left-color: var(--secondary);
}

.toast.error {
    border-left-color: var(--danger);
}

.toast.warning {
    border-left-color: var(--warning);
}

.toast.hide {
    animation: toastExit 0.3s forwards;
}

.toast-icon {
    font-size: 1.2rem;
}

@keyframes toastEnter {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes toastExit {
    from {
        opacity: 1;
        transform: scale(1);
    }
    to {
        opacity: 0;
        transform: scale(0.9);
    }
}

/* ==================== USER STATUS ==================== */
.user-status-container {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 15px;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
}

.sidebar.collapsed .user-status-container {
    padding: 10px 0;
    justify-content: center;
    background: transparent;
}

.user-avatar {
    font-size: 2rem;
    color: rgba(255, 255, 255, 0.8);
}

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

.sidebar.collapsed .user-info {
    display: none;
}

.user-name {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--white);
    line-height: 1.2;
}

.user-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
}

/* ==================== AUTH MODAL ==================== */
.modal {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    backdrop-filter: blur(4px);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content.auth-content {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    overflow: hidden;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.close-modal {
    position: absolute;
    right: 20px;
    top: 15px;
    color: var(--gray);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease;
}

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

.auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--light);
}

.auth-tab {
    flex: 1;
    padding: 20px 0;
    background: transparent;
    border: none;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray);
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.auth-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
    background: rgba(59, 130, 246, 0.05);
}

.auth-pane {
    display: none;
    padding: 30px;
    animation: fadeIn 0.3s ease;
}

.auth-pane.active {
    display: block;
}

.auth-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-header h2 {
    font-size: 1.5rem;
    color: var(--dark);
    margin-bottom: 5px;
}

.auth-header p {
    color: var(--gray);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 16px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--light);
    border-radius: var(--radius-sm);
    font-size: 1rem;
    background: var(--bg);
    color: var(--dark);
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.w-100 {
    width: 100%;
}

/* ==================== TEMPORIZADOR ==================== */
#temporizador .section-header {
    text-align: center;
    margin-bottom: 28px;
    max-width: 760px;
    margin-left: auto;
    margin-right: auto;
}

.timer-dashboard {
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    max-width: 1120px;
    margin: 0 auto;
    align-items: start;
    justify-items: center;
}

@media (min-width: 768px) {
    .timer-dashboard {
        grid-template-columns: 1.6fr 1fr;
        gap: 32px;
    }
}

.timer-main, .series-dashboard {
    background: var(--bg-card);
    padding: 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
    min-width: 0;
}

.timer-display-container {
    position: relative;
    width: min(320px, 100%);
    max-width: 280px;
    aspect-ratio: 1 / 1;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-ring {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-ring-bg {
    fill: none;
    stroke: var(--light);
    stroke-width: 15;
}

.timer-ring-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 15;
    stroke-linecap: round;
    stroke-dasharray: 691; /* 2 * PI * 110 */
    stroke-dashoffset: 0;
    transition: stroke-dashoffset 0.1s linear, stroke 0.3s ease;
}

.timer-ring-progress.finished {
    stroke: var(--secondary);
}

.timer-text {
    position: absolute;
    top: 55%;
    left: 45%;
    transform: translate(-50%, -50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    line-height: 1;
    font-size: clamp(3rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--dark);
    font-variant-numeric: tabular-nums;
    z-index: 2;
}

.timer-text.finished {
    color: var(--secondary);
}

.timer-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 32px;
    width: 100%;
    justify-content: center;
}

.timer-controls .btn-large {
    flex: 1 1 170px;
    min-width: 150px;
    max-width: 240px;
}

.btn-large {
    padding: 16px 28px;
    font-size: 1.1rem;
}

.timer-quick-actions {
    width: 100%;
    text-align: center;
}

.timer-quick-actions h3 {
    margin-bottom: 16px;
    font-size: 1.05rem;
    color: var(--gray);
}

.quick-times-grid {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
}

@media (min-width: 640px) {
    .quick-times-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    width: 100%;
    padding: 14px 0;
    border-radius: var(--radius-sm);
}

.btn-outline:hover, .btn-outline.active {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

.series-dashboard {
    justify-content: center;
    align-items: center;
}

.series-dashboard h3 {
    font-size: clamp(1.3rem, 2vw, 1.55rem);
    margin-bottom: 22px;
}

.series-counter-display {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 28px;
}

.series-text {
    font-size: 1.1rem;
    color: var(--gray);
    margin-bottom: 10px;
}

.series-number-wrapper {
    width: min(220px, 100%);
    max-width: 180px;
    aspect-ratio: 1 / 1;
    background: var(--light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 5px solid var(--primary);
}

.series-number {
    font-size: clamp(2.8rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--dark);
}

.series-controls {
    width: 100%;
    display: grid;
    gap: 14px;
}

@media (max-width: 767px) {
    .timer-dashboard {
        gap: 24px;
    }

    .timer-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .timer-controls .btn-large {
        max-width: none;
    }

    .timer-display-container {
        max-width: 260px;
        margin-bottom: 28px;
    }

    .timer-quick-actions {
        text-align: left;
    }

    .timer-quick-actions h3 {
        text-align: left;
    }

    .quick-times-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .series-number-wrapper {
        max-width: 200px;
    }
}

