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

:root {
    --primary-color: #ff6b35;
    --secondary-color: #004e89;
    --success-color: #06d6a0;
    --warning-color: #ffd23f;
    --danger-color: #ef476f;
    --dark: #1a1a2e;
    --light: #f8f9fa;
    --gray: #6c757d;
    --border-radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.15);
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
}

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

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: var(--shadow-lg);
}

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* Navigation Tabs */
.nav-tabs {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    margin-bottom: 2rem;
}

.nav-tabs .container {
    display: flex;
    gap: 0;
    padding: 0;
    overflow-x: auto;
}

.nav-btn {
    flex: 1;
    min-width: 150px;
    padding: 1rem 1.5rem;
    border: none;
    background: white;
    color: var(--gray);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.nav-btn:hover {
    background: var(--light);
    color: var(--primary-color);
}

.nav-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: var(--light);
}

.nav-btn i {
    margin-right: 0.5rem;
}

/* Main Content */
main {
    padding: 2rem 0;
}

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

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

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

/* Hero Card */
.hero-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    margin-bottom: 2rem;
}

.hero-card h2 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 2rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--light) 0%, white 100%);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid var(--light);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.stat-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.stat-card h3 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.stat-card .big-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* Info Section */
.info-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.info-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.info-section h3 i {
    margin-right: 0.5rem;
    color: var(--warning-color);
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.info-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.info-card .highlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.info-card .small {
    font-size: 0.9rem;
    color: var(--gray);
}

/* Warning Box */
.warning-box {
    background: #fff3cd;
    border: 2px solid var(--warning-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.warning-box i {
    color: #856404;
    font-size: 1.5rem;
}

.warning-box h4 {
    color: #856404;
    margin-bottom: 0.5rem;
}

.warning-box p {
    color: #856404;
    margin: 0;
}

/* Workout Schedule */
.workout-schedule {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.workout-schedule h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
}

.day-card {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

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

.day-card.rest-day {
    background: linear-gradient(135deg, var(--success-color) 0%, #059669 100%);
}

.day-card h4 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.day-card .workout-type {
    font-size: 0.9rem;
    margin-bottom: 1rem;
    opacity: 0.9;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

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

.btn-primary:hover {
    background: #e55a2b;
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-secondary {
    background: white;
    color: var(--secondary-color);
    border: 2px solid white;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s ease;
}

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

.modal-content {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    max-width: 800px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1rem;
    font-size: 2rem;
    color: var(--gray);
    cursor: pointer;
    transition: color 0.3s ease;
}

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

/* Workout Tips */
.workout-tips {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.workout-tips h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.workout-tips ul {
    list-style: none;
}

.workout-tips li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light);
}

.workout-tips li:last-child {
    border-bottom: none;
}

/* Nutrition */
.nutrition-overview {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.macro-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.macro-card {
    background: linear-gradient(135deg, var(--light) 0%, white 100%);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    border: 2px solid var(--light);
    transition: all 0.3s ease;
}

.macro-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.macro-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.macro-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.macro-amount {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

.macro-calories {
    color: var(--gray);
    font-size: 0.9rem;
}

/* Meal Plan */
.meal-plan {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.meal-plan h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.meal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.meal-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.meal-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.meal-card h4 i {
    color: var(--primary-color);
}

.meal-calories {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 1rem;
}

.meal-card ul {
    list-style: none;
}

.meal-card li {
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.meal-card li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

.nutrition-tips {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.nutrition-tips h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.nutrition-tips ul {
    list-style: none;
}

.nutrition-tips li {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--light);
}

.nutrition-tips li:last-child {
    border-bottom: none;
}

/* Progress */
.progress-input {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

.progress-input h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea {
    padding: 0.75rem;
    border: 2px solid var(--light);
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    transition: border-color 0.3s ease;
}

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

.chart-container {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
}

/* Progress Table */
.progress-table {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
}

.progress-table h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

#progressTableContainer {
    overflow-x: auto;
}

#progressTable {
    width: 100%;
    border-collapse: collapse;
}

#progressTable th,
#progressTable td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light);
}

#progressTable th {
    background: var(--light);
    color: var(--secondary-color);
    font-weight: 600;
}

#progressTable tr:hover {
    background: var(--light);
}

.no-data {
    text-align: center !important;
    color: var(--gray);
    padding: 2rem !important;
}

.delete-btn {
    background: var(--danger-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

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

/* Milestones */
.timeline {
    position: relative;
    padding: 2rem 0;
}

.milestone-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-bottom: 2rem;
    border-left: 5px solid var(--primary-color);
    transition: all 0.3s ease;
}

.milestone-card:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
}

.milestone-card.final {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, white 0%, #f0fdf4 100%);
}

.milestone-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.milestone-header h3 {
    color: var(--secondary-color);
    font-size: 1.5rem;
}

.target-weight {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
}

.milestone-content h4 {
    color: var(--secondary-color);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.milestone-content ul {
    list-style: none;
    padding-left: 0;
}

.milestone-content li {
    padding: 0.3rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.milestone-content li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: var(--primary-color);
    font-weight: bold;
}

.milestone-checkbox {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--light);
}

.milestone-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    cursor: pointer;
}

.milestone-checkbox label {
    font-weight: 600;
    cursor: pointer;
}

/* Motivation Section */
.motivation-section {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    margin-top: 2rem;
}

.motivation-section h3 {
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
}

.motivation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.motivation-card {
    background: var(--light);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    text-align: center;
    transition: all 0.3s ease;
}

.motivation-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.motivation-card i {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.motivation-card h4 {
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

/* Footer */
footer {
    background: var(--dark);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 4rem;
}

footer i {
    color: var(--danger-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.8rem;
    }

    header .subtitle {
        font-size: 1rem;
    }

    .nav-tabs .container {
        justify-content: flex-start;
    }

    .nav-btn {
        min-width: 120px;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
    }

    .stats-grid,
    .info-grid,
    .macro-grid,
    .meal-grid,
    .week-grid,
    .motivation-grid {
        grid-template-columns: 1fr;
    }

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

    .milestone-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .stat-card .big-number {
        font-size: 2rem;
    }

    .nav-btn {
        min-width: 100px;
        padding: 0.6rem 0.8rem;
        font-size: 0.85rem;
    }
}

/* Workout Detail Styles */
.workout-detail {
    padding: 1rem 0;
}

.workout-detail h3 {
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

.exercise-list {
    list-style: none;
    padding: 0;
}

.exercise-item {
    background: var(--light);
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
}

.exercise-item strong {
    color: var(--secondary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.exercise-item p {
    margin: 0.25rem 0;
    color: var(--gray);
}

.positive-change {
    color: var(--success-color);
    font-weight: 600;
}

.negative-change {
    color: var(--danger-color);
    font-weight: 600;
}