/* Import Google Fonts at the top of the file */
@import url('https://fonts.googleapis.com/css2?family=Oswald:wght@500;700&family=Roboto:wght@400;700&display=swap');

/* Basic styles for the fitness app */
body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f7f6;
    margin: 0;
    padding: 20px;
    color: #333;
    -webkit-tap-highlight-color: transparent;
}

.app-container {
    max-width: 700px;
    margin: 0 auto;
    background-color: transparent;
    padding: 0;
}

/* Logo Styling */
.app-logo {
    display: block;
    max-width: 250px;
    margin: 0 auto 30px auto;
}

/* Section Headings */
h2, h3 {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    text-align: left;
    margin-top: 20px;
    margin-bottom: 15px;
    color: #34495e;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
    margin-top: 30px;
}


/* Quote box styling */
.quote-box {
    position: relative;
    text-align: center;
    padding: 25px 40px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    border-radius: 12px;
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    display: none; /* Initially hidden */
}
.quote-box p { margin: 0; }

/* Tabs navigation */
.tabs {
    display: flex;
    margin-bottom: 20px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.tab-button {
    font-family: 'Oswald', sans-serif;
    flex: 1;
    padding: 15px 10px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 18px;
    color: #86909a;
    outline: none;
    transition: all 0.3s ease;
}

/* Add margin to the right of tab icons */
.tab-button i {
    margin-right: 8px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.tab-button.active {
    color: #2193b0;
    background-color: #f8f9fa;
    border-bottom: 3px solid #2193b0;
}

/* Tab content panels */
.tab-content.active { display: block; }
.tab-content { display: none; }

/* List styling */
ul {
    list-style: none;
    padding-left: 0;
}

li {
    background-color: #ffffff;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

li:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}

/* Styles for expandable details */
.exercise-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 15px 20px;
}

.exercise-name {
    font-family: 'Oswald', sans-serif;
    font-weight: 500;
    font-size: 18px;
    color: #2c3e50;
}

.expand-icon {
    font-size: 20px;
    font-weight: bold;
    color: #2193b0;
    transition: transform 0.3s ease;
}

/* Rotating the icon when expanded */
.exercise-header.expanded .expand-icon {
    transform: rotate(90deg);
}

.details {
    padding: 0 20px;
    font-size: 15px;
    color: #555;
    border-top: 1px solid #f0f0f0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, padding 0.3s ease-out;
}

/* New rule to add padding only when expanded */
.exercise-header.expanded + .details {
    padding-top: 10px;
    padding-bottom: 15px;
}

.details p {
    margin: 0 0 10px;
}

/* Styling for a single exercise photo */
.exercise-photo {
    width: 100%;
    max-width: 300px;
    height: auto;
    display: block;
    margin: 15px auto 0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Styling for a grid of multiple exercise photos */
.exercise-images {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.exercise-images img {
    width: 100%;
    max-width: 300px; /* This now matches the single photo size */
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- Styles for Fullscreen Image Viewer --- */

/* Add a pointer cursor to all exercise photos to show they are clickable */
.exercise-photo, .exercise-images img {
    cursor: zoom-in;
    transition: transform 0.2s ease;
}

/* A subtle hover effect for desktop users */
.exercise-photo:hover, .exercise-images img:hover {
    transform: scale(1.03);
}

/* The dark overlay behind the image */
.fullscreen-overlay {
    position: fixed; /* Sits on top of all other content */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85); /* Semi-transparent black */
    display: flex; /* Uses flexbox to center the image */
    justify-content: center;
    align-items: center;
    z-index: 1000; /* Ensures it's on top */
    cursor: zoom-out; /* Indicates it can be closed */
    opacity: 0; /* Starts as invisible */
    visibility: hidden; /* Starts as hidden and non-interactable */
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* A class to make the overlay visible */
.fullscreen-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* The actual image when it "explodes out" */
.fullscreen-overlay img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain; /* Ensures image aspect ratio is maintained */
    border-radius: 8px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    transform: scale(0.8); /* Starts slightly smaller */
    transition: transform 0.3s ease; /* Smooth animation */
}

/* Animate the image to its full size when the overlay becomes active */
.fullscreen-overlay.active img {
    transform: scale(1);
}

/* --- STYLES FOR NUTRITION TAB --- */

/* Header Banner */
.nutrition-header {
    background: linear-gradient(135deg, #6dd5ed, #2193b0);
    color: white;
    padding: 25px 20px;
    border-radius: 12px;
    margin-bottom: 30px;
}
.nutrition-header h2 {
    color: white;
    margin-top: 0;
    margin-bottom: 10px;
}
.nutrition-header p {
    margin-bottom: 0;
    font-size: 16px;
    line-height: 1.5;
}


/* Heuristics Cards */
.heuristics-container {
    display: grid;
    gap: 15px;
}
.heuristic-card {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    padding: 15px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.heuristic-icon {
    font-size: 24px;
    color: #2193b0;
    margin-right: 15px;
    width: 30px;
    text-align: center;
}
.heuristic-text {
    flex: 1;
    font-size: 16px;
    line-height: 1.5;
}


/* Visualized Macro Stats */
.macro-stats {
    display: flex;
    justify-content: space-around;
    text-align: center;
    margin-top: 15px;
    padding: 10px 0;
}
.stat {
    padding: 0 10px;
}
.stat-value {
    display: block;
    font-size: 22px;
    font-weight: 700;
    color: #2c3e50;
    font-family: 'Oswald', sans-serif;
}
.stat-label {
    display: block;
    font-size: 13px;
    color: #86909a;
    margin-top: 4px;
}

/* Remove default list styles inside the nutrition tab */
#nutrition ul {
    list-style: none;
    padding-left: 0;
}

/* Override h3 margin for better spacing */
#nutrition h3 {
    margin-top: 40px;
    padding-bottom: 5px;
    border-bottom: 2px solid #e0e0e0;
}

.disclaimer {
    font-size: 12px;
    font-style: italic;
    color: #777;
    margin: 30px 20px 10px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    line-height: 1.6;
}


/* --- Mobile Optimization --- */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .app-logo {
        max-width: 200px;
        margin-bottom: 25px;
    }

    .quote-box {
        padding: 20px 25px;
        font-size: 16px;
    }

    /* Stack tabs vertically on mobile */
    .tabs {
        flex-direction: column;
        border-radius: 12px;
    }

    .tab-button {
        border-bottom: 1px solid #eee;
    }

    .tab-button.active {
        border-bottom: 1px solid #eee; /* Remove bottom border */
        border-left: 4px solid #2193b0; /* Use left border for active state */
    }

    li {
        font-size: 15px;
    }
}
