/* RESET & VARIABLES */
* {
    box-sizing: border-box;
    padding: 0;
    margin: 0;

    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -webkit-touch-callout: none;
}

:root {
    --bg: #f7f9fc;
    --surface: #ffffff;
    --border: #e5e9f0;
    --text: #1d1c1a;
    --muted: #6b7280;
    --accent: #ff6961;
    --accent-soft: #e0e7ff;
    --gray-100: #f8fafc;
    --gray-200: #e2e8f0;
    --text-light: #64748b;

    --radius: 14px;
    --radius-sm: 8px;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

.responsive-image {
    display: none;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
        Roboto, Ubuntu, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    padding: 0;
    width: 100%;
    min-height: 100vh;
    background: var(--surface);
}

.home__header {
    width: 100%;
    height: 667px;
    background-image: url("./images/hero-image-toronto.png");
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
}

.home__filter {
    background-color: hsla(0, 0%, 0%, 0.7);
    width: 100%;
    height: 667px;
    justify-content: center;
    display: flex;
    flex-flow: column;
    align-items: center;
    gap: 2.5rem;
}

.home__maplink-logo img {
    max-width: 181px;
}

.home__hero-text {
    max-width: 226px;
    line-height: 25.6px;
    font-size: 16px;
    text-align: center;
    color: white;
}

.bold-head {
    font-weight: bold;
    font-size: 20px;
}

.red-text {
    color: var(--accent);
}

.bold-text {
    font-weight: bold;
}

.home__button-group {
    display: flex;
    align-items: center;
    flex-flow: column;
    width: 226px;
    gap: 1rem;
    margin-bottom: 0px;
}

.share-button {
    width: 100%;
    text-align: center;
    background-color: black;
    padding: 0.85rem;
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: background-color 0.5s ease;
    white-space: nowrap;
}

.share-button img {
    max-width: 24px;
    height: auto;
    display: block;
}

.explore-btn {
    background-color: #ff6961;
}

.wa-btn {
    background-color: #25D366;
}

/* FORM CONTAINER */
.fs-form {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.25rem;
    padding-bottom: 10px;
    margin-bottom: 60px;
    position: sticky;
    top: 0px;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: top 0.4s ease;
}

/* FIELDSETS */
fieldset {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem;
}

.fieldset-title {
    padding: 0 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent);
}

/* LABELS & INPUTS */
label {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
}

input,
select {
    font: inherit;
    padding: 0.6rem 0.7rem;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #fff;
    width: 100%;
    box-sizing: border-box;
}

input[type="radio"] {
    width: auto;
}

input::placeholder {
    color: var(--muted);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

/* RADIO BUTTONS */
input[type="radio"] {
    margin-right: 0.5rem;
    accent-color: var(--accent);
}

fieldset>label:has(input[type="radio"]) {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
    font-weight: 400;
}

.home__feedback {
    margin-top: 10px;
}

.course-list {
    padding: 0px 20px 20px;
    display: flex;
    flex-flow: column;
    align-items: center;
    gap: 24px;
}

.course-card {
    width: 100%;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-image {
    height: 180px;
    background: white;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

iframe {
    width: 100%;
    height: 100%;
    display: block;
}

.card-content {
    padding: 24px;
}

.category {
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.course-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
    line-height: 1.4;
}

.course-description {
    color: #666;
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-btn-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.course-btn {
    text-align: center;
    background-color: black;
    padding: 0.85rem;
    border-radius: 14px;
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    transition: background-color 0.5s ease;
    white-space: nowrap;
}

.link-btn,
.whats-app-btn {
    width: 25%;
    background-color: #0072b1;
}

.whats-app-btn {
    background-color: #25D366;
}

.overview-btn {
    width: 50%;
}

.course-btn img {
    max-width: 24px;
    height: auto;
    display: block;
}

.overview-btn {
    background-color: #ff6961;
}

.home__footer {
    text-align: center;
    padding: 24px 20px 28px;
    font-size: 0.875rem;
    color: var(--text-light);
    border-top: 1px solid var(--gray-200);
    background: var(--gray-100);
}

.heart {
    display: inline-block;
    animation: heartbeat 1s infinite;
    transform-origin: center;
}

.filter-empty-state {
    animation: heartbeat 1s infinite;
    transform-origin: center;
}

main {
    margin-bottom: 30px;
}

@keyframes heartbeat {
    0% {
        transform: scale(1);
    }

    25% {
        transform: scale(1.2);
    }

    50% {
        transform: scale(1);
    }

    75% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

#toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #323232;
    color: white;
    padding: 16px 24px;
    border-radius: 16px;
    font-size: 16px;
    line-height: 1.5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#toast img {
    max-width: 24px;
}

#toast.show {
    opacity: 1;
}

.back-to-top {
    position: fixed;
    right: 16px;
    bottom: calc(64px + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: pointer;

    /* UX polish */
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.back-to-top img {
    max-width: 24px;
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }

    100% {
        transform: translateY(0);
    }
}

/* Hover (desktop) */
@media (hover: hover) {
    .back-to-top:hover {
        transform: translateY(-2px);
    }

    .whats-app-btn:hover {
        background-color: #1fa857;
    }

    .overview-btn:hover {
        background-color: #e85a52;
    }

    .explore-btn:hover {
        background-color: #e85a52;
    }

    .wa-btn:hover {
        background-color: #1fa857;
    }

    .link-btn:hover {
        background-color: #005a8c;
    }
}

@media (min-width: 768px) {
    .home__maplink-logo img {
        max-width: 362px;
    }

    .home__hero-text {
        max-width: 300px;
        line-height: 25.6px;
        font-size: 18px;
        text-align: center;
        color: white;
    }

    .bold-head {
        font-weight: bold;
        font-size: 20px;
    }

    .red-text {
        color: var(--accent);
    }

    .bold-text {
        font-weight: bold;
    }

    .course-card {
        width: 320px;
    }

    .course-list {
        flex-flow: row;
        flex-wrap: wrap;
        width: 100%;
        justify-content: center;
        align-items: flex-start;
    }

    .home__button-group {
        width: 468px;
        gap: 1rem;
        flex-flow: row;
    }

    .back-to-top {
        width: 52px;
        height: 52px;
        right: 24px;
        bottom: 32px;
    }
}

@media (min-width: 992px) {
    .course-card:hover {
        transform: translateY(-10px);
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
        cursor: pointer;
    }

    .back-to-top {
        width: 46px;
        height: 46px;
        bottom: 24px;
    }

    fieldset {
        display: flex;
        gap: 1rem;
        align-items: flex-end;
    }

    fieldset>label {
        width: 33.33%;
        margin-bottom: 0;
    }

    #search {
        height: 38px;
        margin-bottom: 2px;
    }
}