/* =========================================
   MOOD-FAN — style.css
   Cute pastel / vintage illustration style
   Works with the index.html we made together
   ========================================= */


/* ---------- BASIC RESET ---------- */

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

:root {
    --crimson: #4a0e18;
    --crimson-dark: #350A12;

    --grey: #d1cbc5;
    --grey-dark: #928b86;

    --yellow: #e5b94f;
    --yellow-dark: #9a7020;
    --yellow-light: #f4d77a;

    --butter: #e7ca91;
    --blue: #a9bbc1;

    --caramel: #b98255;
    --brown: #9b735c;

    --lavender: #b6a8bf;

    --ink: #5d514b;
    --soft-shadow: rgba(91, 69, 55, 0.16);
}


/* ---------- BODY ---------- */

body {
    min-height: 100vh;

    background: var(--crimson);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;

    color: var(--grey);

    font-family: "Trebuchet MS", "Arial Rounded MT Bold", Arial, sans-serif;

    overflow-x: hidden;

    transition: background 0.5s ease;
}



/* =========================================
   OPENING SCREEN
   ========================================= */

#loading-screen {
    position: fixed;
    inset: 0;
    z-index: 1000;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        radial-gradient(circle at 20% 20%, rgba(217, 165, 165, 0.15), transparent 25%),
        radial-gradient(circle at 80% 70%, rgba(174, 185, 155, 0.18), transparent 28%),
        var(--crimson-dark);

    animation: openingFade 2s ease 4s forwards;
}


/* Main content inside opening */

.loading-content {
    position: relative;

    display: flex;
    flex-direction: column;
    align-items: center;

    animation: openingPop 1s ease forwards;
}


/* Little sparkle above the logo */

.sparkle {
    color: var(--yellow);
    font-size: 2.2rem;
    margin-bottom: 5px;

    animation:
        sparkleFloat 2s ease-in-out infinite,
        sparkleAppear 0.8s ease forwards;
}


/* ---------- BUBBLE LOGO ---------- */

#logo {
    display: flex;
    align-items: center;
    justify-content: center;

    font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
    font-size: clamp(3rem, 10vw, 7rem);
    font-weight: 900;
    letter-spacing: 0.04em;

    color: var(--pink);

    /* soft raised / candy-like shadow */
    text-shadow:
        0 3px 0 rgba(255, 255, 255, 0.75),
        0 6px 0 rgba(126, 91, 76, 0.12),
        0 12px 20px rgba(126, 91, 76, 0.14);

    animation: logoPop 1s cubic-bezier(.17, .67, .3, 1.3) forwards;
}


/* Glossy highlight feeling */

#logo::before {
    content: "";
    position: absolute;
    width: 55%;
    height: 12px;

    top: 43%;
    left: 23%;

    background: rgba(255, 255, 255, 0.28);
    border-radius: 50%;

    transform: rotate(-4deg);
    pointer-events: none;
}


.tagline {
    margin-top: 10px;

    font-size: clamp(0.9rem, 3vw, 1.2rem);
    letter-spacing: 0.12em;

    color: var(--grey);

    opacity: 0.85;
    animation: fadeUp 0.8s ease 0.7s forwards;
}


/* ---------- LOADING DOTS ---------- */

.loading-animation {
    display: flex;
    gap: 8px;
    margin-top: 28px;
}

.loading-animation span {
    display: block;

    width: 8px;
    height: 8px;

    border-radius: 50%;
    background: var(--pink);

    animation: loadingDots 1.2s ease-in-out infinite;
}

.loading-animation span:nth-child(2) {
    background: var(--sage);
    animation-delay: 0.15s;
}

.loading-animation span:nth-child(3) {
    background: var(--butter);
    animation-delay: 0.3s;
}


.loading-text {
    margin-top: 12px;

    font-size: 0.8rem;
    letter-spacing: 0.1em;

    color: var(--brown);
    opacity: 0.75;
}


/* =========================================
   MAIN PAGE
   ========================================= */

#main-page {
    position: relative;

    min-height: 100vh;
    width: 100%;

    padding: 60px 20px 30px;

    text-align: center;

    opacity: 0;
    pointer-events: none;

    animation: mainPageAppear 0.9s ease 2.6s forwards;
}


/* ---------- HEADER ---------- */

.header {
    position: relative;
    z-index: 2;

    margin-bottom: 30px;
}

.small-title {
    font-size: 0.85rem;
    letter-spacing: 0.18em;
    text-transform: lowercase;

    color: var(--brown);
    opacity: 0.7;
}


.header h1 {
    margin: 6px 0 8px;

    font-family: "Arial Rounded MT Bold", "Trebuchet MS", sans-serif;
    font-size: clamp(2.6rem, 10vw, 5rem);
    font-weight: 900;

    color: var(--pink);

    text-shadow:
        0 3px 0 rgba(255, 255, 255, 0.75),
        0 6px 0 rgba(126, 91, 76, 0.13),
        0 10px 18px rgba(126, 91, 76, 0.12);
}


.question {
    font-size: 1rem;
    color: var(--brown);
}


/* =========================================
   DECORATIONS
   ========================================= */

.decoration {
    position: fixed;
    z-index: 0;

    user-select: none;
    pointer-events: none;

    font-size: 2rem;
    opacity: 0.45;

    animation: decorationFloat 4s ease-in-out infinite;
}

.decoration-one {
    top: 13%;
    left: 8%;
    color: var(--sage);
}

.decoration-two {
    top: 28%;
    right: 9%;
    color: var(--pink);
    animation-delay: 1s;
}

.decoration-three {
    bottom: 14%;
    left: 12%;
    color: var(--butter);
    animation-delay: 2s;
}


/* =========================================
   MOOD BUTTONS
   ========================================= */

.mood-section {
    position: relative;
    z-index: 5;
}


.mood-buttons {
    display: grid;
    grid-template-columns: repeat(4, minmax(100px, 150px));
    justify-content: center;
    gap: 16px;

    margin: 0 auto;
}


.mood-button {
    min-height: 145px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: 2px solid rgba(93, 81, 75, 0.08);
    border-radius: 28px;

    background: rgba(255, 252, 246, 0.85);

    color: var(--ink);

    box-shadow:
        0 7px 0 rgba(126, 91, 76, 0.08),
        0 12px 25px var(--soft-shadow);

    cursor: pointer;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}


.mood-button:hover {
    transform: translateY(-7px) rotate(-1deg);

    box-shadow:
        0 11px 0 rgba(126, 91, 76, 0.08),
        0 18px 30px var(--soft-shadow);
}


.mood-button:active {
    transform: translateY(2px);
}


.mood-image {
    width: 75px;
    height: 75px;
    
    object-fit: contain;
    display: block;

    transition: transform 0.25s ease;
}

.mood-button:hover.mood-image {
    transform: scale(1.08) rotate(-2deg);
}

.mood-name {
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
}


/* Small pastel accent for each card */

.mood-button.happy {
    border-bottom: 6px solid var(--butter);
}

.mood-button.sad {
    border-bottom: 6px solid var(--blue);
}

.mood-button.angry {
    border-bottom: 6px solid var(--pink);
}

.mood-button.confused {
    border-bottom: 6px solid var(--lavender);
}
/* =========================================
   BLANK MIND BUTTON
   ========================================= */

.blank-mind-button {
    margin-top: 18px;

    padding: 12px 24px;

    border: 2px solid rgba(93, 81, 75, 0.08);
    border-radius: 30px;

    background: rgba(255, 252, 246, 0.85);

    color: var(--ink);

    box-shadow:
        0 6px 0 rgba(126, 91, 76, 0.08),
        0 10px 20px var(--soft-shadow);

    cursor: pointer;

    font-family: inherit;
    font-weight: 700;

    transition:
        transform 0.25s ease,
        box-shadow 0.25s ease;
}

.blank-mind-button:hover {
    transform: translateY(-4px);

    box-shadow:
        0 9px 0 rgba(126, 91, 76, 0.08),
        0 15px 25px var(--soft-shadow);
}

.blank-mind-button:active {
    transform: translateY(2px);
}

/* =========================================
   FAN
   ========================================= */

.fan-section {
    position: relative;
    z-index: 2;

    display: flex;
    justify-content: center;

    margin-top: 45px;
}


.fan-container {
    position: relative;

    width: 300px;
    height: 330px;
}


/* ---------- FAN OUTER CAGE ---------- */

.fan-container::before {
    content: "";

    position: absolute;

    width: 235px;
    height: 235px;

    top: 8px;
    left: 50%;

    transform: translateX(-50%);

    border: 5px solid var(--pink);

    border-radius: 50%;

    opacity: 0.8;

    box-shadow:
        inset 0 0 0 4px rgba(217, 165, 165, 0.16),
        0 5px 0 rgba(126, 91, 76, 0.08);
}


/* Inner cage circle */

.fan-container::after {
    content: "";

    position: absolute;

    width: 195px;
    height: 195px;

    top: 28px;
    left: 50%;

    transform: translateX(-50%);

    background: transparent;

    border: 3px solid var(--pink);

    border-radius: 50%;

    opacity: 0.95;
    z-index: 0;
}


/* ---------- ROTATING BLADES ---------- */

.fan-blades {
    position: absolute;

    width: 185px;
    height: 185px;

    top: 35px;
    left: 50%;

    transform: translateX(-50%);

    transform-origin: center;

    animation: fanSpin 1.5s linear infinite;
}

/*BLANK MIND = fan completely stopped*/
.fan-blades.stopped{
    animation: none;
}

/* Individual blades */

.blade {
    position: absolute;

    width: 68px;
    height: 92px;

    left: 50%;
    top: 50%;

    transform-origin: 50% 12%;

    background: #8B0000;
    z-index: 2;

    border-radius: 70% 35% 70% 25%;

    opacity: 0.85;

    box-shadow:
        inset 8px 7px 0 rgba(255, 255, 255, 0.18),
        3px 5px 0 rgba(93, 81, 75, 0.08);
}


/* Four blades */

.blade-one {
    transform: translate(-50%, -15%) rotate(0deg);
}

.blade-two {
    transform: translate(-50%, -15%) rotate(90deg);
}

.blade-three {
    transform: translate(-50%, -15%) rotate(180deg);
}

.blade-four {
    transform: translate(-50%, -15%) rotate(270deg);
}


/* ---------- FAN CENTER ---------- */

.fan-center {
    position: absolute;

    width: 48px;
    height: 48px;

    top: 103px;
    left: 50%;

    transform: translateX(-50%);

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: var(--pink);

    border: 3px solid rgba(93, 81, 75, 0.12);

    color: white;
    font-size: 1.3rem;

    box-shadow:
        0 4px 0 rgba(126, 91, 76, 0.12),
        inset 4px 4px 0 rgba(255, 255, 255, 0.2);

    z-index: 4;
}


/* ---------- FAN NECK ---------- */

.fan-neck {
    position: absolute;

    width: 32px;
    height: 72px;

    top: 220px;
    left: 50%;

    transform: translateX(-50%);

    background: var(--blue);

    border: 3px solid rgba(93, 81, 75, 0.16);
    border-radius: 8px;

    z-index: 1;
}


/* ---------- FAN BASE ---------- */

.fan-base {
    position: absolute;

    width: 190px;
    height: 35px;

    bottom: 10px;
    left: 50%;

    transform: translateX(-50%);

    background: var(--blue);

    border: 3px solid rgba(93, 81, 75, 0.16);

    border-radius: 50% 50% 35% 35%;

    box-shadow:
        0 6px 0 rgba(126, 91, 76, 0.1),
        inset 0 5px 0 rgba(255, 255, 255, 0.18);

    z-index: 2;
}


/* =========================================
   MOOD MESSAGE
   ========================================= */

.message-section {
    position: relative;
    z-index: 4;

    display: flex;
    justify-content: center;

    margin-top: 10px;
}


#mood-card {
    max-width: 420px;

    padding: 15px 24px;

    border-radius: 50px;

    background: #5c1823;

    border: 2px solid #e0b84c;

    box-shadow:
        0 8px 20px var(--soft-shadow);
}


#mood-message {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #d8d2cc;
}


/* =========================================
   FOOTER
   ========================================= */

footer {
    position: relative;
    z-index: 5;

    margin-top: 35px;

    color: var(--brown);
    opacity: 0.7;

    font-size: 0.78rem;
}


.footer-small {
    margin-top: 5px;
    opacity: 0.65;
}


/* =========================================
   ANIMATIONS
   ========================================= */


/* Opening logo */

@keyframes logoPop {

    0% {
        opacity: 0;
        transform: scale(0.55) translateY(20px);
    }

    70% {
        transform: scale(1.08);
    }

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


/* Opening content */

@keyframes openingPop {

    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Opening disappears */

@keyframes openingFade {

    to {
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
    }
}


/* Main page appears */

@keyframes mainPageAppear {

    to {
        opacity: 1;
        pointer-events: auto;
    }
}


/* Small sparkle */

@keyframes sparkleFloat {

    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-8px) rotate(12deg);
    }
}


@keyframes sparkleAppear {

    from {
        opacity: 0;
        transform: scale(0);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Tagline */

@keyframes fadeUp {

    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* Loading dots */

@keyframes loadingDots {

    0%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    50% {
        transform: translateY(-7px);
        opacity: 1;
    }
}


/* Fan rotation */

@keyframes fanSpin {

    from {
        transform: translateX(-50%) rotate(0deg);
    }

    to {
        transform: translateX(-50%) rotate(360deg);
    }
}


/* Decorations */

@keyframes decorationFloat {

    0%, 100% {
        transform: translateY(0) rotate(-5deg);
    }

    50% {
        transform: translateY(-15px) rotate(8deg);
    }
}


/* =========================================
   MOBILE
   ========================================= */

@media (max-width: 650px) {

    #main-page {
        padding-top: 45px;
    }

    #logo {
        font-size: clamp(2.5rem, 13vw, 4rem);
    }

    .mood-buttons {
        grid-template-columns: repeat(2, 125px);
        gap: 13px;
    }

    .mood-button {
        min-height: 110px;
    }

    .fan-container {
        transform: scale(0.88);
        margin-top: -10px;
        margin-bottom: -20px;
    }

    .decoration {
        font-size: 1.5rem;
    }
}


/* Very small screens */

@media (max-width: 380px) {

    .mood-buttons {
        grid-template-columns: repeat(2, 110px);
    }

    .mood-button {
        min-height: 100px;
    }

    .mood-emoji {
        font-size: 2rem;
    }

    .fan-container {
        transform: scale(0.78);
        margin-top: -25px;
        margin-bottom: -50px;
    }
}


/* Accessibility: reduce movement if requested */

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
    }

}
