/* ================= RESET & BASE ================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    height: 100%;
    font-family: "Inter", "Segoe UI", Roboto, system-ui, -apple-system, "Helvetica Neue", Arial;
    background: linear-gradient(180deg, #0f172a 0%, #071124 100%);
    color: #e6eef8;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================= APP ================= */
.app {
    width: 100%;
    max-width: 1100px;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(2, 8, 23, 0.7);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    margin: auto;
}

/* ---------- HEADER ---------- */
.app-header {
    padding: 28px 36px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    text-align: center;
}

.app-header h1 {
    font-size: 1.6rem;
    margin-bottom: 6px;
}

.tagline {
    font-size: 0.95rem;
    color: rgba(230, 238, 248, 0.7);
}

/* ================= SENTIMENT INPUT ================= */
.sentiment-input {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 12px 0;
    flex-wrap: wrap;
}

.sentiment-input input {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 200px;
    background: rgba(255, 255, 255, 0.05);
    color: #e6eef8;
}

.sentiment-input input::placeholder {
    color: rgba(230, 238, 248, 0.5);
}

.sentiment-input button {
    padding: 6px 12px;
    border-radius: 6px;
    background: #4facfe;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: transform .2s ease;
}

.sentiment-input button:hover {
    transform: scale(1.05);
}

/* ================= MOOD SELECTOR ================= */
.mood-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 18px 36px;
    justify-content: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.01), rgba(255, 255, 255, 0.005));
}

.mood-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.04);
    font-weight: 600;
    cursor: pointer;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.mood-btn span {
    font-size: 0.95rem;
    color: #dbeafc;
}

.mood-btn:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(2, 8, 23, 0.5);
}

.mood-btn[aria-pressed="true"] {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02));
    border-color: rgba(255, 255, 255, 0.09);
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 14px 40px rgba(2, 8, 23, 0.6);
}

/* ================= RESULT PANEL ================= */
.result-panel {
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: 24px;
    padding: 28px 36px;
}

.left-col {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.right-col {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ================= MOOD CARD ================= */
.mood-card {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0.01));
    padding: 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.03);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mood-card h2,
.mood-card h3 {
    font-size: 1.25rem;
}

.mood-card p {
    color: rgba(230, 238, 248, 0.75);
}

/* ================= SPOTIFY PLAYER ================= */
.spotify-player {
    width: 100%;
    height: 80px;
    border-radius: 8px;
    border: none;
    overflow: hidden;
}

/* ================= META ================= */
.meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#mood-emoji {
    font-size: 32px;
}

.chip {
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.03);
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.02);
}

/* ================= SUGGESTIONS ================= */
.suggestions {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

.suggestion-card {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border-radius: 10px;
    background: linear-gradient(270deg, #ff9a9e, #fad0c4, #fbc2eb, #a6c1ee);
    background-size: 400% 400%;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
    animation: gradientShiftSuggestion 12s ease infinite;
}

.suggestion-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(2, 8, 23, 0.4);
}

/* ---------- SUGGESTION CARD BASE ---------- */
.suggestion-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: 12px;
    color: #fff;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    animation: cardFadeIn 0.8s forwards;
    background: linear-gradient(135deg, rgba(79, 172, 254, 0.3), rgba(255, 255, 255, 0.05));
    /* frosted glass base + gradient */
    backdrop-filter: blur(6px);
    /* frosted effect */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: transform 0.3s ease, background 1s ease, border-color 0.5s ease;
    position: relative;
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.1); /* default border */
}

/* ---------- GRADIENT ANIMATION OVERLAY ---------- */
.suggestion-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.1));
    background-size: 200% 200%;
    animation: gradientShift 6s ease infinite;
    border-radius: 12px;
    z-index: 0;
}

/* ---------- THUMBNAIL ---------- */
.suggestion-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
    z-index: 1;
}

/* ---------- CARD BODY ---------- */
.suggestion-body {
    display: flex;
    flex-direction: column;
    z-index: 1;
}

.suggestion-title {
    font-weight: 600;
    font-size: 14px;
    /* Animated gradient text */
    background: linear-gradient(90deg, #ffd700, #ff7f50, #00ffff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: textGradient 3s ease infinite;
    text-shadow: 1px 1px 4px rgba(0, 0, 0, 0.7); /* enhance readability */
}

.suggestion-sub {
    font-size: 12px;
    color: #ddd;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}

/* ---------- CARD ANIMATION ---------- */
@keyframes cardFadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ---------- GRADIENT SHIFT ---------- */
@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- ANIMATED GRADIENT TEXT ---------- */
@keyframes textGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ---------- HOVER EFFECT ---------- */
.suggestion-card:hover {
    transform: translateY(-3px);
    background: rgba(255, 255, 255, 0.08);
}

/* ---------- MOOD-BASED BORDER COLORS ---------- */
.mood-happy .suggestion-card { border-color: #FFD700; } /* Sunny/Happy */
.mood-chill .suggestion-card { border-color: #00CED1; } /* Ocean/Chill */
.mood-adventure .suggestion-card { border-color: #FF4500; } /* Mountains/Adventure */
.mood-calm .suggestion-card { border-color: #FFB6C1; } /* Lake/Calm */
.mood-lonely .suggestion-card { border-color: #9370DB; } /* Night sky/Lonely */



/* ================= IMAGE FRAME ================= */
.image-frame {
    width: 100%;
    max-width: 420px;
    height: 360px;
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.03);
    box-shadow: 0 12px 40px rgba(2, 8, 23, 0.6);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: fadeIn .8s ease;
}

.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.35));
    border-radius: 12px;
}

/* ---------- IMAGE PANEL SMOOTH FADE ---------- */
#image-frame {
    transition: opacity 0.8s ease-in-out, background-image 0.8s ease-in-out;
    opacity: 1;
}

#image-frame.fade-out {
    opacity: 0;
}

/* ================= MOOD JOURNAL ================= */
.mood-journal {
    margin-top: 18px;
    background: rgba(255, 255, 255, 0.02);
    padding: 12px;
    border-radius: 10px;
}

.mood-journal h3 {
    margin-bottom: 6px;
    font-size: 1rem;
}

/* ================= FOOTER ================= */
.app-footer {
    padding: 12px 18px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.02);
    font-size: 0.9rem;
    color: rgba(230, 238, 248, 0.6);
}

/* ================= ANIMATED GRADIENTS ================= */
@keyframes gradientShiftSuggestion {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ================= FADE-IN ================= */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* ================= RESPONSIVE ================= */
@media (max-width:1000px) {
    .result-panel {
        grid-template-columns: 1fr;
    }

    .image-frame {
        width: 100%;
        height: 260px;
    }
}

@media (max-width:600px) {
    .app-header h1 {
        font-size: 1.2rem;
    }

    .tagline {
        font-size: 0.85rem;
    }

    .sentiment-input {
        flex-direction: column;
        gap: 10px;
    }

    .sentiment-input input {
        width: 100%;
    }

    .mood-btn {
        flex: 1 1 45%;
        justify-content: center;
    }

    .spotify-player {
        height: 100px;
    }

    .result-panel {
        padding: 16px;
        gap: 16px;
    }
}