/* ===== Base & Reset ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Fredoka', sans-serif;
    background: #d0eafa;
    min-height: 100vh;
    padding: 20px;
    color: #2c3e50;
    position: relative;
    overflow-x: hidden;
}

/* ===== Floating Background Shapes ===== */
.floating-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.15;
    animation: float 8s ease-in-out infinite;
}

.shape-1 {
    width: 120px;
    height: 120px;
    background: #ff6b9d;
    top: 10%;
    left: 5%;
    animation-delay: 0s;
}

.shape-2 {
    width: 80px;
    height: 80px;
    background: #ffd93d;
    top: 30%;
    right: 8%;
    animation-delay: 1.5s;
}

.shape-3 {
    width: 150px;
    height: 150px;
    background: #6bcf7f;
    bottom: 20%;
    left: 10%;
    animation-delay: 3s;
}

.shape-4 {
    width: 60px;
    height: 60px;
    background: #a78bfa;
    top: 60%;
    right: 15%;
    animation-delay: 2s;
}

.shape-5 {
    width: 100px;
    height: 100px;
    background: #9cd9ff;
    bottom: 10%;
    right: 5%;
    animation-delay: 4s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(5deg); }
    66% { transform: translateY(10px) rotate(-3deg); }
}

/* ===== Container ===== */
.container {
    max-width: 780px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ===== Header ===== */
header {
    text-align: center;
    padding: 44px 28px;
    background: white;
    border-radius: 28px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 3px solid #9cd9ff;
}

.header-badge {
    display: inline-block;
    background: linear-gradient(135deg, #ff6b9d, #a78bfa);
    color: white;
    padding: 6px 18px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 2px;
    margin-bottom: 14px;
}

header h1 {
    font-family: 'Fredoka', sans-serif;
    font-size: 2.2rem;
    font-weight: 700;
    color: #1a5276;
    line-height: 1.2;
    margin-bottom: 12px;
}

header .subtitle {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.2rem;
    color: #5f6368;
    line-height: 1.5;
}

/* ===== Stepper Bar ===== */
.stepper-bar {
    background: white;
    border-radius: 20px;
    padding: 24px 28px 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    position: sticky;
    top: 12px;
    z-index: 10;
}

.stepper-track {
    height: 6px;
    background: #e8f4fd;
    border-radius: 3px;
    position: relative;
    margin-bottom: 14px;
}

.stepper-fill {
    height: 100%;
    background: linear-gradient(90deg, #1a73e8, #4a9af5);
    border-radius: 3px;
    transition: width 0.4s ease;
    width: 0%;
}

.stepper-steps {
    display: flex;
    justify-content: space-between;
}

.step-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.step-dot:hover {
    transform: scale(1.05);
}

.step-dot span {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e8f4fd;
    color: #9cb3c4;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 3px solid transparent;
}

.step-dot p {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.8rem;
    color: #9cb3c4;
    transition: color 0.3s ease;
}

.step-dot.active span {
    background: linear-gradient(135deg, #1a73e8, #4a9af5);
    color: white;
    border-color: #9cd9ff;
    box-shadow: 0 2px 10px rgba(26, 115, 232, 0.3);
}

.step-dot.active p {
    color: #1a73e8;
    font-weight: 500;
}

.step-dot.done span {
    background: #6bcf7f;
    color: white;
    border-color: #a5e6b4;
}

.step-dot.done p {
    color: #2e7d32;
}

/* ===== Form Sections / Step Panels ===== */
.form-section {
    background: white;
    border-radius: 24px;
    padding: 28px;
    margin-bottom: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
    border: 2px solid transparent;
    animation: fadeInUp 0.4s ease forwards;
}

.form-section:hover {
    border-color: #9cd9ff;
    box-shadow: 0 8px 30px rgba(156, 217, 255, 0.2);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    padding-bottom: 14px;
    border-bottom: 3px dashed #d0eafa;
}

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

.section-header h2 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    color: #1a5276;
}

.section-desc {
    font-family: 'Patrick Hand', cursive;
    color: #5f6368;
    margin-bottom: 16px;
    font-size: 1.1rem;
    line-height: 1.5;
}

/* ===== Criteria Box (inside step 1) ===== */
.criteria-box {
    margin-top: 24px;
    padding-top: 10px;
}

.criteria-box .section-header {
    border-bottom-color: #ffe082;
}

/* ===== Form Groups ===== */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 8px;
    color: #333;
    font-size: 0.95rem;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: 2.5px solid #d0eafa;
    border-radius: 14px;
    font-size: 1rem;
    font-family: 'Patrick Hand', cursive;
    transition: all 0.3s ease;
    outline: none;
    background: #fafeff;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    border-color: #9cd9ff;
    box-shadow: 0 0 0 4px rgba(156, 217, 255, 0.25);
    background: white;
}

.form-group input[type="text"]::placeholder {
    color: #b0c4d4;
    font-family: 'Patrick Hand', cursive;
}

/* ===== Criteria Section ===== */
.criteria-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.criteria-bubble {
    text-align: center;
    padding: 16px 12px;
    background: linear-gradient(135deg, #fff9e6, #fffdf5);
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    border: 2px solid #ffe082;
}

.bubble-icon {
    font-size: 1.6rem;
    display: block;
    margin-bottom: 6px;
}

.criteria-bubble strong {
    font-size: 0.85rem;
    color: #1a5276;
    display: block;
    margin-bottom: 4px;
}

.criteria-bubble p {
    font-family: 'Patrick Hand', cursive;
    color: #666;
    font-size: 0.85rem;
    line-height: 1.3;
}

/* ===== Theme Cards ===== */
.theme-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.theme-card {
    cursor: pointer;
    display: block;
}

.theme-card input[type="radio"] {
    display: none;
}

.theme-content {
    text-align: center;
    padding: 16px 12px;
    border: 3px solid #e8f4fd;
    border-radius: 20px;
    transition: all 0.3s ease;
    background: #fafeff;
}

.theme-content:hover {
    border-color: #9cd9ff;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(156, 217, 255, 0.3);
}

.theme-card input[type="radio"]:checked + .theme-content {
    border-color: #1a73e8;
    background: linear-gradient(135deg, #e8f4fd, #d0eafa);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.2);
    transform: translateY(-3px) scale(1.02);
}

.theme-img-wrap {
    width: 100%;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #e8f4fd;
}

.theme-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.theme-content h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: #1a5276;
    margin-bottom: 4px;
}

.theme-content p {
    font-family: 'Patrick Hand', cursive;
    color: #5f6368;
    font-size: 0.88rem;
    line-height: 1.3;
}

/* ===== Scene Cards ===== */
.scene-card {
    background: linear-gradient(135deg, #f8fcff 0%, #eef7ff 100%);
    border: 2.5px solid #d0eafa;
    border-radius: 20px;
    padding: 22px;
    margin-bottom: 16px;
    position: relative;
}

.scene-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: linear-gradient(135deg, #1a73e8, #4a9af5);
    color: white;
    padding: 4px 16px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.delete-scene-btn {
    position: absolute;
    top: -12px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #ffcdd2;
    background: white;
    color: #e53935;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 2;
}

.delete-scene-btn:hover {
    background: #e53935;
    color: white;
    border-color: #e53935;
    transform: scale(1.15);
}

/* ===== Add Scene Button ===== */
.add-scene-btn {
    width: 100%;
    text-align: center;
    padding: 16px;
    font-size: 1rem;
    margin-top: 4px;
}

/* ===== Dynamic List Items ===== */
.dynamic-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dynamic-item {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
}

.dynamic-item > input {
    flex: 1;
    padding: 12px 14px;
    border: 2.5px solid #d0eafa;
    border-radius: 12px;
    font-size: 0.95rem;
    font-family: 'Patrick Hand', cursive;
    outline: none;
    transition: all 0.3s ease;
    background: white;
}

.dynamic-item > input:focus {
    border-color: #9cd9ff;
    box-shadow: 0 0 0 3px rgba(156, 217, 255, 0.25);
}

.dynamic-item > input::placeholder {
    color: #b0c4d4;
}

/* ===== Add Button ===== */
.add-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 18px;
    background: linear-gradient(135deg, #e8f4fd, #d0eafa);
    border: 2.5px dashed #9cd9ff;
    border-radius: 12px;
    font-family: 'Fredoka', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1a73e8;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: linear-gradient(135deg, #d0eafa, #9cd9ff);
    border-style: solid;
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(156, 217, 255, 0.3);
}

.add-btn.shake {
    animation: shake 0.4s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-4px); }
    75% { transform: translateX(4px); }
}

/* ===== Delete Button ===== */
.delete-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffcdd2;
    background: white;
    color: #e53935;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.delete-btn:hover {
    background: #e53935;
    color: white;
    border-color: #e53935;
    transform: scale(1.1);
}

.delete-btn-magic {
    position: absolute;
    top: 10px;
    right: 10px;
}

/* ===== Interaction Bubble ===== */
.interaction-bubble {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    background: white;
    padding: 14px;
    border-radius: 14px;
    border: 2px dashed #9cd9ff;
}

.interaction-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 1rem;
    color: #1a5276;
    font-weight: 500;
    white-space: nowrap;
}

.interaction-bubble input {
    flex: 1;
    min-width: 100px;
    padding: 10px 14px;
    border: 2.5px solid #d0eafa;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'Patrick Hand', cursive;
    outline: none;
    transition: all 0.3s ease;
}

.interaction-bubble input:focus {
    border-color: #9cd9ff;
    box-shadow: 0 0 0 3px rgba(156, 217, 255, 0.25);
}

.interaction-bubble input::placeholder {
    color: #b0c4d4;
}

/* Interaction bubble inside dynamic item */
.dynamic-item .interaction-bubble {
    flex: 1;
}

/* ===== Mood Options ===== */
.mood-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mood-card {
    cursor: pointer;
}

.mood-card input[type="radio"] {
    display: none;
}

.mood-content {
    text-align: center;
    padding: 16px 10px;
    border: 2.5px solid #e8f4fd;
    border-radius: 16px;
    transition: all 0.3s ease;
    background: #fafeff;
}

.mood-content span {
    font-size: 2rem;
    display: block;
    margin-bottom: 6px;
}

.mood-content p {
    font-size: 0.85rem;
    font-weight: 500;
    color: #1a5276;
}

.mood-content:hover {
    border-color: #9cd9ff;
    background: #f0f9ff;
}

.mood-card input[type="radio"]:checked + .mood-content {
    background: linear-gradient(135deg, #1a73e8, #4a9af5);
    border-color: #1a73e8;
    transform: scale(1.03);
}

.mood-card input[type="radio"]:checked + .mood-content span {
    transform: scale(1.2);
}

.mood-card input[type="radio"]:checked + .mood-content p {
    color: white;
}

/* ===== Sketch Notice ===== */
.sketch-notice {
    display: flex;
    align-items: center;
    gap: 14px;
    background: linear-gradient(135deg, #fff8e1, #ffecb3);
    border: 2.5px solid #ffb74d;
    border-radius: 16px;
    padding: 18px;
    margin-top: 10px;
}

.sketch-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.sketch-notice strong {
    display: block;
    color: #e65100;
    margin-bottom: 2px;
}

.sketch-notice p {
    font-family: 'Patrick Hand', cursive;
    color: #5f6368;
    font-size: 1rem;
    line-height: 1.4;
}

/* ===== Magic Cards ===== */
.magic-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: linear-gradient(135deg, #f8fcff, #eef7ff);
    border: 2.5px solid #d0eafa;
    border-radius: 18px;
    padding: 20px;
    position: relative;
    flex: 1;
}

.magic-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #1a73e8, #4a9af5);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.magic-body {
    flex: 1;
}

.dynamic-item:has(.magic-card) {
    position: relative;
}

.dynamic-item + .dynamic-item:has(.magic-card) {
    margin-top: 10px;
}

/* ===== Step Navigation ===== */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding: 0 4px;
}

.nav-btn {
    font-family: 'Fredoka', sans-serif;
    padding: 14px 32px;
    font-size: 1.05rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
}

.nav-back {
    background: white;
    color: #1a73e8;
    border: 2.5px solid #d0eafa;
}

.nav-back:hover {
    background: #e8f4fd;
    border-color: #9cd9ff;
    transform: translateX(-3px);
}

.nav-next {
    background: linear-gradient(135deg, #1a73e8, #4a9af5);
    color: white;
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.3);
}

.nav-next:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(26, 115, 232, 0.4);
}

.nav-submit {
    background: linear-gradient(135deg, #6bcf7f, #2e7d32);
    color: white;
    box-shadow: 0 4px 16px rgba(46, 125, 50, 0.3);
    padding: 16px 40px;
    font-size: 1.15rem;
}

.nav-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(46, 125, 50, 0.4);
}

.nav-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Validation shake on nav-next */
.nav-next.shake {
    animation: shake 0.4s ease;
}

/* ===== Success Message ===== */
.success-message {
    text-align: center;
    padding: 60px 30px;
    background: white;
    border-radius: 28px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    border: 3px solid #9cd9ff;
}

.success-icon {
    font-size: 5rem;
    display: block;
    margin-bottom: 16px;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.success-content h2 {
    font-family: 'Fredoka', sans-serif;
    color: #1a5276;
    margin-bottom: 12px;
    font-size: 1.8rem;
}

.success-content p {
    font-family: 'Patrick Hand', cursive;
    color: #5f6368;
    font-size: 1.15rem;
    margin-bottom: 28px;
    line-height: 1.5;
}

.reset-btn {
    font-family: 'Fredoka', sans-serif;
    background: white;
    color: #1a73e8;
    border: 3px solid #1a73e8;
    padding: 14px 36px;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.reset-btn:hover {
    background: #1a73e8;
    color: white;
    transform: scale(1.03);
}

/* ===== Footer ===== */
footer {
    text-align: center;
    padding: 28px;
    font-family: 'Patrick Hand', cursive;
    color: #1a5276;
    font-size: 1.1rem;
}

/* ===== Responsive ===== */
@media (max-width: 650px) {
    body {
        padding: 12px;
    }

    header {
        padding: 30px 20px;
    }

    header h1 {
        font-size: 1.6rem;
    }

    .stepper-bar {
        padding: 18px 16px 14px;
    }

    .step-dot span {
        width: 30px;
        height: 30px;
        font-size: 0.8rem;
    }

    .step-dot p {
        font-size: 0.7rem;
    }

    .form-section {
        padding: 20px 16px;
    }

    .criteria-grid {
        grid-template-columns: 1fr;
    }

    .theme-options {
        grid-template-columns: 1fr;
    }

    .theme-img-wrap {
        height: 150px;
    }

    .interaction-bubble {
        flex-direction: column;
        align-items: stretch;
    }

    .mood-options {
        grid-template-columns: 1fr;
    }

    .magic-card {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .step-nav {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .nav-btn {
        width: 100%;
        text-align: center;
    }
}

/* ===== Animations ===== */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}


/* ===== AI Analysis Section ===== */
.ai-loading {
    text-align: center;
    padding: 40px 20px;
}

.ai-loader {
    width: 50px;
    height: 50px;
    border: 5px solid #e8f4fd;
    border-top-color: #1a73e8;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 18px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.ai-loading p {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.1rem;
    color: #1a5276;
    font-weight: 500;
}

.ai-loading span {
    font-family: 'Patrick Hand', cursive;
    color: #5f6368;
    font-size: 1rem;
}

/* AI Error */
.ai-error {
    text-align: center;
    padding: 30px 20px;
}

.ai-error-icon {
    font-size: 3rem;
    margin-bottom: 12px;
}

.ai-error p {
    font-family: 'Patrick Hand', cursive;
    color: #5f6368;
    font-size: 1.1rem;
    margin-bottom: 16px;
}

/* AI Result */
.ai-result {
    padding: 4px 0;
}

.ai-result-content {
    font-family: 'Patrick Hand', cursive;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #333;
}

.ai-result-content h3 {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.15rem;
    color: #1a73e8;
    margin: 20px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px dashed #d0eafa;
}

.ai-result-content h3:first-child {
    margin-top: 0;
}

.ai-result-content p {
    margin-bottom: 10px;
}

.ai-result-content ul, .ai-result-content ol {
    margin: 8px 0 14px 20px;
}

.ai-result-content li {
    margin-bottom: 6px;
}

.ai-result-content strong {
    color: #1a5276;
}

/* Score cards in AI result */
.ai-scores {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 20px;
}

.ai-score-card {
    text-align: center;
    padding: 16px 10px;
    background: linear-gradient(135deg, #f8fcff, #eef7ff);
    border: 2px solid #d0eafa;
    border-radius: 14px;
}

.ai-score-card .score-value {
    font-family: 'Fredoka', sans-serif;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a73e8;
    display: block;
}

.ai-score-card .score-label {
    font-family: 'Patrick Hand', cursive;
    font-size: 0.9rem;
    color: #5f6368;
}

@media (max-width: 650px) {
    .ai-scores {
        grid-template-columns: 1fr;
    }
}


/* ===== Nav Right Group ===== */
.nav-right {
    display: flex;
    gap: 10px;
    align-items: center;
}

/* ===== Skip AI Button ===== */
.nav-skip {
    background: white;
    color: #5f6368;
    border: 2.5px solid #d0eafa;
    font-size: 0.95rem;
    padding: 12px 20px;
}

.nav-skip:hover {
    background: #f8fcff;
    border-color: #9cd9ff;
    color: #1a5276;
}

@media (max-width: 650px) {
    .nav-right {
        flex-direction: column;
        width: 100%;
    }

    .nav-skip {
        width: 100%;
        text-align: center;
    }
}
