/* --- Step 6: Global Styles & Variables --- */

/* :root is where we define our "theme" colors and fonts for easy access */
:root {
    --primary-color: #3B82F6;  /* A calming blue */
    --secondary-color: #10B981; /* A gentle green */
    --background-color: #F9FAFB; /* Off-white */
    --text-color: #1F2937; /* Dark gray */
    --light-gray: #E5E7EB;
    --white-color: #FFFFFF;

    --font-family: 'Helvetica Neue', Arial, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Basic CSS Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-family);
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

header {
    padding: 1.5rem 2rem;
    background-color: var(--white-color);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: flex;
    align-items: center;
}

header h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
}

main {
    flex-grow: 1;
    max-width: 900px;
    width: 90%;
    margin: 2rem auto;
}

footer {
    text-align: center;
    padding: 1rem;
    font-size: 0.875rem;
    color: #6B7280;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
}

p {
    margin-bottom: 1rem;
}

.intro, .categories, #category-info {
    margin-bottom: 3rem;
}

.back-link {
    display: inline-flex;
    align-items: center;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: bold;
    margin-right: 1.5rem;
}

.back-link:hover {
    text-decoration: underline;
}

/* --- Step 7: Card Styles --- */

.card-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--white-color);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 1.5rem;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: block; /* Make the whole card a link */
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.card-content {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card .material-icons {
    font-size: 2.5rem;
    color: var(--primary-color);
}

.card h3 {
    font-size: 1.25rem;
    margin: 0;
}

.card p {
    font-size: 0.9rem;
    color: #4B5563;
    margin: 0;
}

/* For exercise cards with info button */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

/* Add this new rule */
.card-header a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 1.25rem;
    font-weight: bold;
}

.info-icon-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--light-gray);
    padding: 0.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.info-icon-btn:hover {
    background-color: var(--background-color);
    color: var(--primary-color);
}


/* --- Step 8: Exercise Page Styles --- */
.exercise-main {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.breathing-circle-container {
    position: relative;
    width: 300px;
    height: 300px;
    margin: 1rem auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

#breathing-circle {
    width: 100%;
    height: 100%;
    background-color: var(--light-gray);
    border-radius: 50%;
    transition: transform 4s ease-in-out, background-color 2s ease; /* Default transition time */
}

/* JS will add these classes to animate the circle */
.is-inhaling {
    transform: scale(1.15);
    background-color: var(--primary-color);
}
.is-exhaling {
    transform: scale(1);
    background-color: var(--light-gray);
}
.is-holding-full {
    transform: scale(1.15);
    background-color: var(--secondary-color);
}
.is-holding-empty {
    transform: scale(1);
    background-color: #B0BEC5; /* A neutral hold color */
}


#instruction-text {
    position: absolute;
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--white-color);
    text-shadow: 1px 1px 3px rgba(0,0,0,0.4);
}

#timer-display {
    font-size: 3rem;
    font-weight: bold;
    margin: 1rem 0;
    color: var(--text-color);
}

.controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
}

.cycles-control {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cycles-control button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--light-gray);
    background-color: var(--white-color);
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-color);
}

#cycles-count {
    font-size: 1.25rem;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.main-control-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--white-color);
    background-color: var(--primary-color);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    box-shadow: var(--box-shadow);
}
.main-control-btn.pause {
    background-color: var(--secondary-color);
}


/* --- Step 9: Modal (Pop-up) Styles --- */
.modal-hidden {
    display: none;
}

.modal-visible {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
}

.modal-content {
    position: relative;
    background: var(--white-color);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    width: 90%;
    max-width: 500px;
    z-index: 1001;
}

.modal-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.5rem; /* Icon size */
    padding: 0.25rem;
    color: #9CA3AF;
}
.modal-close-btn:hover {
    color: var(--text-color);
}

#modal-text-content h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

/* --- Step 10: Responsive Design --- */
@media (max-width: 768px) {
    body {
        font-size: 15px;
    }

    main {
        width: 95%;
        margin: 1.5rem auto;
    }

    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.75rem; }

    .breathing-circle-container {
        width: 250px;
        height: 250px;
    }

    .controls {
        flex-direction: column;
        gap: 1.5rem;
    }
}
