/* === DESIGN TOKENS === */
:root {
    --bg:           #fff8fc;
    --surface:      #ffffff;
    --surface-2:    #fef2f8;
    --accent:       #e8177c;
    --accent-alt:   #ff6ec7;
    --accent-soft:  rgba(232, 23, 124, 0.09);
    --accent-glow:  rgba(232, 23, 124, 0.20);
    --text-1:       #180c15;
    --text-2:       #7d4e6c;
    --text-3:       #b898ae;
    --border:       rgba(232, 23, 124, 0.15);
    --border-focus: rgba(232, 23, 124, 0.52);
    --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md:    0 4px 24px rgba(232, 23, 124, 0.09);
    --shadow-lg:    0 12px 60px rgba(232, 23, 124, 0.13);
    --radius:       20px;
    --radius-sm:    13px;
    --radius-xs:    9px;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg:           #0c0810;
        --surface:      #1d1028;
        --surface-2:    #261437;
        --accent:       #ff2da0;
        --accent-alt:   #ff85d3;
        --accent-soft:  rgba(255, 45, 160, 0.11);
        --accent-glow:  rgba(255, 45, 160, 0.26);
        --text-1:       #f7eaff;
        --text-2:       #c5a2da;
        --text-3:       #8a6898;
        --border:       rgba(255, 45, 160, 0.18);
        --border-focus: rgba(255, 45, 160, 0.62);
        --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.35);
        --shadow-md:    0 4px 24px rgba(0, 0, 0, 0.45);
        --shadow-lg:    0 12px 60px rgba(255, 45, 160, 0.12);
    }
}

:root[data-theme="dark"] {
    --bg:           #0c0810;
    --surface:      #1d1028;
    --surface-2:    #261437;
    --accent:       #ff2da0;
    --accent-alt:   #ff85d3;
    --accent-soft:  rgba(255, 45, 160, 0.11);
    --accent-glow:  rgba(255, 45, 160, 0.26);
    --text-1:       #f7eaff;
    --text-2:       #c5a2da;
    --text-3:       #8a6898;
    --border:       rgba(255, 45, 160, 0.18);
    --border-focus: rgba(255, 45, 160, 0.62);
    --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-md:    0 4px 24px rgba(0, 0, 0, 0.45);
    --shadow-lg:    0 12px 60px rgba(255, 45, 160, 0.12);
}

/* === RESET + BASE === */
*, *::before, *::after { box-sizing: border-box; }

body {
    background-color: var(--bg);
    background-image: radial-gradient(ellipse 90% 50% at 50% -5%, var(--accent-glow) 0%, transparent 68%);
    margin: 0;
    font-family: 'DM Sans', 'Fredoka', sans-serif;
    color: var(--text-1);
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

p {
    margin-bottom: 5px;
    margin-top: 5px;
}

/* === LAYOUT === */
.main-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    align-items: center;
}

.container-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 940px;
    padding: 0 20px 64px;
}

/* === LOGO === */
.top {
    margin-top: 44px;
    margin-bottom: 4px;
}

.logo {
    max-width: 290px;
    width: 100%;
    height: auto;
    object-fit: contain;
    margin-top: 0;
    filter: drop-shadow(0 6px 28px var(--accent-glow));
    transition: filter 0.3s ease;
}

.logo:hover {
    filter: drop-shadow(0 8px 36px var(--accent-glow)) drop-shadow(0 0 14px var(--accent-soft));
}

/* === INPUT SECTION === */
.user-input-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
    width: 100%;
}

.user-input-section input {
    font-family: 'DM Sans', 'Fredoka', sans-serif;
    padding: 12px 22px;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-1);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 50px;
    margin-bottom: 12px;
    width: 300px;
    max-width: 90%;
    text-align: center;
    box-shadow: var(--shadow-sm);
    outline: none;
    transition: border-color 0.22s ease, box-shadow 0.22s ease;
    letter-spacing: 0.01em;
}

.user-input-section input::placeholder {
    color: var(--text-3);
    font-weight: 400;
}

.user-input-section input:focus {
    border-color: var(--border-focus);
    box-shadow: var(--shadow-sm), 0 0 0 4px var(--accent-soft);
}

/* === GENERATE BUTTON === */
#generate-button {
    width: 128px;
    height: 43.33px;
    background-image: url('button.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    background-color: transparent;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 14px var(--accent-glow));
    transition: transform 0.18s ease, filter 0.18s ease;
}

#generate-button:hover {
    filter: drop-shadow(0 6px 20px var(--accent-glow)) brightness(1.07);
    transform: translateY(-2px);
}

#generate-button:active {
    transform: scale(0.95);
    filter: brightness(0.9) drop-shadow(0 2px 8px var(--accent-glow));
}

/* === BROWSE LABEL === */
section {
    margin-bottom: 6px;
    width: 100%;
    max-width: 700px;
    padding: 0 16px;
}

section p {
    font-family: 'Outfit', 'DM Sans', sans-serif;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--text-2);
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 14px;
}

section p::before,
section p::after {
    content: '';
    flex: 1;
    max-width: 56px;
    height: 1px;
    background: var(--border);
}

/* === WARNING === */
#warning-message {
    font-family: 'DM Sans', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    color: #d43535;
    background: rgba(212, 53, 53, 0.08);
    border: 1px solid rgba(212, 53, 53, 0.2);
    border-radius: 8px;
    padding: 6px 18px;
    margin-bottom: 10px;
}

/* === TABS (kept in DOM for script, hidden visually) === */
.tabs { display: none; }

.tab { display: none; }

/* === OPEN CONTENT GRID === */
.scrollable-content {
    position: static;
    width: 100%;
    height: auto;
    overflow: visible;
    padding: 0;
    box-sizing: border-box;
}

/* Category blocks */
.cat-block {
    width: 100%;
    margin-bottom: 40px;
}

.cat-heading {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 14px;
    padding-left: 2px;
}

/* Open item grid */
.open-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    padding: 0;
}

/* All card image types unified in open grid */
.open-grid .grid-image,
.open-grid .grid-image-large,
.open-grid .tab3-grid-image,
.open-grid .grid-image-pose {
    width: 100%;
    height: auto;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, filter 0.2s ease;
    display: block;
}

.open-grid .grid-image:hover,
.open-grid .grid-image-large:hover,
.open-grid .tab3-grid-image:hover,
.open-grid .grid-image-pose:hover {
    transform: scale(1.05);
    filter: brightness(1.06) drop-shadow(0 4px 16px var(--accent-glow));
}

/* === TAB SECTIONS (padding stripped — open grid handles spacing) === */
#tab1, #tab2, #tab3, #tab4 { padding: 0; }

/* === SEQUENCE MODAL === */
#sequence-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg), 0 0 56px var(--accent-glow);
    padding: 24px 28px;
    text-align: center;
    max-width: 400px;
    width: 88%;
    height: auto;
    z-index: 1000;
    overflow: hidden;
    align-items: center;
    display: flex;
    justify-content: flex-start;
    flex-direction: column;
}

/* === STEPS === */
.step img {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    margin-top: 32px;
    filter: drop-shadow(0 4px 14px var(--accent-glow));
}

.step-image2 {
    margin-top: 15px !important;
    margin-bottom: 0px !important;
}

.step p {
    font-size: 1.1rem;
    color: var(--text-1);
    margin: 10px 0 36px;
    font-family: 'Outfit', 'Fredoka', sans-serif;
    font-weight: 500;
}

/* === STEP 3: PLATFORM === */
#step-3 {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

#step-3 h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 24px;
    margin-top: 0;
    letter-spacing: -0.01em;
}

#step-3-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    justify-content: center;
    align-items: center;
    max-width: 280px;
    margin: 0 auto;
}

.btn {
    font-size: 26px;
    cursor: pointer;
    border-radius: 14px;
    height: 66px;
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    color: var(--text-2);
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.18s ease, box-shadow 0.2s ease;
}

.btn:hover {
    transform: scale(1.05);
    border-color: var(--border-focus);
    background: var(--accent-soft);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.wide {
    grid-column: span 2;
    height: 42px;
    font-size: 0.88rem;
    font-family: 'DM Sans', sans-serif;
    font-weight: 500;
    letter-spacing: 0.03em;
    color: var(--text-2);
}

button.selected {
    background: linear-gradient(135deg, rgba(232, 23, 124, 0.14), rgba(255, 110, 199, 0.14));
    color: var(--accent);
    border: 2px solid var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}

/* === STEPS 4–10 === */
#step-4, #step-5, #step-6, #step-7, #step-8, #step-9 {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px;
}

#step-5-text  { margin-bottom: 20px !important; }
#step-4-text  { margin-bottom: 20px !important; }
#step-10-text { margin-bottom: 10px !important; }

/* === LOADING BAR === */
#loading-bar-container {
    width: 80%;
    height: 6px;
    background: var(--surface-2);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

#loading-bar {
    width: 0%;
    height: 100%;
    background: linear-gradient(to right, var(--accent), var(--accent-alt));
    transition: width 3s linear;
    border-radius: 99px;
}

/* === ROTATING COG === */
@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.rotating-cog {
    animation: spin 3s linear infinite;
    width: 72px !important;
    height: 72px !important;
    margin-bottom: 12px !important;
    margin-top: 32px !important;
    filter: drop-shadow(0 4px 16px var(--accent-glow)) !important;
}

/* === VERIFY + CONTINUE BUTTONS === */
.verify {
    margin-bottom: 30px;
    margin-top: 15px;
}

.verify-button {
    width: 100px;
    height: 33px;
    background-image: url('verify.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    background-color: transparent;
    margin-top: 5px;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 12px var(--accent-glow));
    transition: transform 0.18s ease, filter 0.18s ease;
}

.verify-button:hover {
    transform: translateY(-2px);
    filter: drop-shadow(0 6px 18px var(--accent-glow)) brightness(1.07);
}

.continue-button {
    width: 160px;
    height: 52px;
    background-image: url('continue.png');
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    border: none;
    cursor: pointer;
    background-color: transparent;
    margin-top: 20px;
    filter: drop-shadow(0 4px 12px var(--accent-glow));
    transition: transform 0.18s ease, filter 0.18s ease;
}

.continue-button:hover {
    transform: translateY(-2px) scale(1.04);
    filter: drop-shadow(0 6px 22px var(--accent-glow)) brightness(1.07);
}

/* === POPUP NOTIFICATIONS === */
#popup-container {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 1000;
    max-width: min(320px, 85vw);
}

.popup-card {
    display: none;
    position: relative;
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    padding: 12px 14px;
    margin-bottom: 10px;
    max-width: 100%;
    transition: opacity 0.5s ease;
    opacity: 0;
}

.popup-card img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    margin-right: 10px;
    vertical-align: middle;
    object-fit: cover;
}

.popup-card-content {
    display: flex;
    align-items: center;
}

.popup-card-content div {
    margin-left: 10px;
}

.popup-card h4 {
    margin: 0 0 2px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-1);
    font-family: 'Outfit', 'DM Sans', sans-serif;
}

.popup-card p {
    margin: 0;
    font-size: 0.8rem;
    color: var(--text-2);
    font-family: 'DM Sans', sans-serif;
}

.popup-text {
    font-size: 0.88rem;
    color: var(--text-2);
    margin-top: 0.4em;
    font-family: 'DM Sans', sans-serif;
}

/* === NOTIFICATION CONTAINER === */
#notification-container {
    position: relative;
    margin-top: 10px;
    margin-bottom: 20px;
    width: 80%;
    height: 280px;
    overflow-y: auto;
    background: transparent;
    padding: 10px;
    border-radius: 12px;
    color: var(--text-1);
    scrollbar-width: none;
}

#notification-container::-webkit-scrollbar { display: none; }

.notification-card {
    color: var(--text-1);
    position: relative;
    background-color: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: var(--shadow-sm);
    padding: 10px 12px;
    margin-bottom: 8px;
    transition: opacity 0.5s ease-in-out;
}

.notification img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
}

.profile-pic {
    border-radius: 50%;
    width: 38px;
    height: 38px;
    margin-right: 10px;
    object-fit: cover;
}

/* === STEP 10 (VERIFY) === */
.step10before img,
.step10after img {
    width: 72px;
    height: 72px;
    margin-bottom: 12px;
    margin-top: 32px;
    filter: drop-shadow(0 4px 14px var(--accent-glow));
}

.step10before p,
.step10after p {
    font-size: 1.1rem;
    color: var(--text-1);
    margin: 10px 0 36px;
    font-family: 'Outfit', 'Fredoka', sans-serif;
    font-weight: 500;
}

.step10before { margin-bottom: 20px; }
.step10after  { margin-bottom: 0; }

/* === ANIMATIONS === */
@keyframes slide-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

@keyframes slide-out {
    from { transform: translateY(0); }
    to   { transform: translateY(100%); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.04); }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

@keyframes bounceIn {
    0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
    65%  { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); }
}

@keyframes bounceOut {
    0%   { transform: scale(1); opacity: 1; }
    50%  { transform: scale(0.92); opacity: 0.5; }
    100% { transform: scale(0); opacity: 0; }
}

@keyframes bounceIn2 {
    0%   { transform: scale(0.6); opacity: 0; }
    65%  { transform: scale(1.06); opacity: 1; }
    100% { transform: scale(1); }
}

.bounce-in  { animation: bounceIn 0.7s ease-out; }
.bounce-out { animation: bounceOut 0.55s ease forwards; }
.bounce-in2 { animation: bounceIn2 0.7s ease-out; }
.hidden     { display: none !important; }

body.fade-out {
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

#step-1 {
    animation: pulse 1.2s infinite;
    flex-direction: column;
    align-items: center;
    transform: translate(50%, -50%);
}

#step-2 {
    animation: pulse 1.2s infinite;
    flex-direction: column;
    align-items: center;
}

/* === RESPONSIVE === */
@media (max-width: 600px) {
    .open-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 8px;
    }
}

@media (max-width: 400px) {
    .open-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

@media screen and (max-width: 768px) {
    .loading-text { font-size: 22px; }
}
