/* Moodboard Module Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Inter, Arial, sans-serif;
    background: #f5f7fb;
    color: #333;
    line-height: 1.6;
}

.app {
    min-height: 100vh;
    position: relative;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
    padding: 20px;
}

.screen.active {
    display: block;
}

.subscription-banner {
    max-width: 900px;
    margin: 0 auto 14px;
    padding: 10px 12px;
    border: 1px solid #f0c36d;
    border-radius: 10px;
    background: #fff6e6;
    color: #7a5a1e;
    font-size: 14px;
}

/* Header */
.header {
    max-width: 800px;
    margin: 0 auto 40px;
    text-align: center;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 0;
    padding: 10px 20px;
    background: #fff;
    color: #333;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.back-btn:hover {
    border-color: #7dbf2d;
    background: #f8fbf2;
}

.back-home-btn {
    background: #fff;
    border: 1px solid #d8dde6;
    border-radius: 10px;
    padding: 12px 20px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: #333;
}

.back-home-btn:hover {
    border-color: #7dbf2d;
    background: #f8fbf2;
}

.option-card,
.choice-card,
.question-container,
.photo-preview,
.moodboard-sections,
.edit-section,
.visual-result,
.moodboard-image-container,
.progress-indicator {
    border: 1px solid #e2e7ef;
    border-radius: 12px;
    box-shadow: none;
}

.option-btn,
.choice-btn,
.continue-btn,
#select-photo-btn,
.action-btn,
.add-btn,
.save-btn {
    border: 1px solid #d8dde6;
    border-radius: 10px;
}

.premium-locked {
    opacity: 0.55;
    cursor: not-allowed;
}

.header h1 {
    font-size: 28px;
    color: #333;
    margin-top: 10px;
}

.header-home {
    max-width: 900px;
    margin: 0 auto 40px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    align-items: start;
    column-gap: 30px;
    row-gap: 10px;
    text-align: left;
}

.header-home .back-home-btn {
    position: static;
    grid-column: 1;
    justify-self: start;
    align-self: start;
}

.home-title {
    margin: 0;
    line-height: 1.25;
    grid-column: 2 / -1;
    align-self: start;
}

.home-title span {
    display: block;
}

/* Options Container (Screen 1) */
.options-container {
    max-width: 900px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

.option-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 3px solid transparent;
}

.option-card.active {
    border-color: #7dbf2d;
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.option-card.disabled {
    opacity: 0.6;
    background: #f5f5f5;
}

.option-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.option-card h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #333;
}

.option-card p {
    color: #666;
    margin-bottom: 15px;
}

.option-desc {
    font-size: 14px;
    color: #888;
}

.disabled-text {
    color: #999;
    font-style: italic;
}

.option-btn {
    padding: 12px 24px;
    background: #7dbf2d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.option-btn:hover:not(:disabled) {
    background: #6ba025;
}

.option-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Choice Container (Screen 2) */
.choice-container {
    max-width: 600px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.choice-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.choice-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(0,0,0,0.15);
}

.choice-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.choice-btn {
    padding: 12px 24px;
    background: #7dbf2d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: background 0.2s;
}

.choice-btn:hover {
    background: #6ba025;
}

/* Game Container (Screen 3) */
.game-container {
    max-width: 700px;
    margin: 0 auto;
    text-align: center;
}

.mentor-intro {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 24px;
}

.mentor-intro-copy {
    text-align: left;
    max-width: 460px;
}

.mentor-intro-title {
    font-size: 24px;
    line-height: 1.35;
    color: #333;
    font-weight: 600;
    margin: 0 0 6px;
}

.mentor-intro-text {
    font-size: 16px;
    line-height: 1.4;
    color: #333;
    margin: 0;
}

.mentor-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 0;
}

.mentor-avatar-image {
    width: 128px;
    height: 128px;
    object-fit: contain;
    display: block;
}

.question-container {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.question {
    font-size: 24px;
    color: #333;
    font-weight: 500;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.option-item {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
    display: grid;
    gap: 8px;
    align-content: center;
    min-height: 108px;
}

.option-item strong {
    font-size: 18px;
    line-height: 1;
}

.option-item span {
    font-size: 15px;
    line-height: 1.35;
}

.option-item:hover {
    border-color: #7dbf2d;
    transform: translateY(-2px);
}

.option-item.selected {
    border-color: #7dbf2d;
    background: #f8fff4;
}

.option-item-custom {
    grid-column: 1 / -1;
}

.option-item-custom-editor {
    grid-column: 1 / -1;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 20px;
}

.option-item-custom-editor textarea {
    width: 100%;
    min-height: 72px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 12px 14px;
    font-family: inherit;
    font-size: 16px;
    resize: vertical;
}

.option-item-custom-editor textarea:focus {
    outline: none;
    border-color: #7dbf2d;
}

.game-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.continue-btn {
    padding: 15px 30px;
    background: #7dbf2d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
}

.progress-indicator {
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    font-weight: 500;
}

/* Photo Container (Screen 4) */
.photo-container {
    max-width: 600px;
    margin: 0 auto;
}

.upload-zone {
    background: white;
    border: 3px dashed #ddd;
    border-radius: 20px;
    padding: 60px 30px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s;
}

.upload-zone:hover {
    border-color: #7dbf2d;
}

.upload-zone.dragover {
    border-color: #7dbf2d;
    background: #f8fff4;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 20px;
}

.upload-zone p {
    font-size: 18px;
    color: #666;
    margin-bottom: 20px;
}

#select-photo-btn {
    padding: 12px 24px;
    background: #7dbf2d;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.photo-preview {
    background: white;
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.photo-preview img {
    max-width: 100%;
    max-height: 400px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.analysis-status {
    margin: 20px 0;
}

/* Moodboard Container (Screen 5) */
.moodboard-container {
    max-width: 800px;
    margin: 0 auto;
}

.moodboard-sections {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.moodboard-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.moodboard-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.moodboard-section h3 {
    color: #7dbf2d;
    font-size: 18px;
    margin-bottom: 10px;
}

.colors-display {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.color-item {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #ddd;
    display: inline-block;
}

.moodboard-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 20px;
}

.action-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.2s;
}

.action-btn.primary {
    background: #7dbf2d;
    color: white;
}

.action-btn.primary:hover {
    background: #6ba025;
}

.action-btn.secondary {
    background: white;
    color: #7dbf2d;
    border: 2px solid #7dbf2d;
}

.action-btn.secondary:hover {
    background: #f8fff4;
}

.save-section {
    text-align: center;
}

.save-btn {
    padding: 12px 24px;
    background: #333;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
}

/* Edit Container (Screen 6) */
.edit-container {
    max-width: 800px;
    margin: 0 auto;
}

.edit-section {
    background: white;
    border-radius: 20px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.edit-section h3 {
    color: #7dbf2d;
    font-size: 18px;
    margin-bottom: 15px;
}

.edit-items {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.edit-item {
    background: #f5f5f5;
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 14px;
    position: relative;
    cursor: pointer;
}

.edit-item .remove-btn {
    margin-left: 8px;
    color: #999;
    cursor: pointer;
}

.edit-item .remove-btn:hover {
    color: #e74c3c;
}

.add-btn {
    background: #7dbf2d;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
}

.edit-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
}

/* Visual Container (Screen 7) */
.visual-container {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.loading-state {
    background: white;
    border-radius: 20px;
    padding: 60px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.loading-detail {
    color: #666;
    font-size: 14px;
    margin-top: 10px;
}

.visual-result {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.moodboard-image-container {
    margin-bottom: 30px;
}

.moodboard-image-container img {
    max-width: 100%;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.visual-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

/* Spinner */
.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #7dbf2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.spinner.large {
    width: 60px;
    height: 60px;
    border-width: 6px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    color: white;
}

.loading-overlay .spinner {
    border-color: #f3f3f3;
    border-top-color: white;
}

/* Responsive Design */
@media (max-width: 768px) {
    .screen {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .options-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .choice-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .options-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    
    .moodboard-actions,
    .visual-actions,
    .edit-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .game-controls {
        flex-direction: column;
        gap: 15px;
    }
}

@media (max-width: 480px) {
    .back-btn {
        position: static;
        margin-bottom: 20px;
        display: inline-block;
    }
    
    .header {
        text-align: left;
    }

    .header-home {
        grid-template-columns: 1fr;
        row-gap: 10px;
    }

    .home-title {
        grid-column: 1;
    }
    
    .option-card,
    .choice-card {
        padding: 20px;
    }
    
    .question {
        font-size: 20px;
    }

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

.back-brandmark-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
    margin-right: 6px;
    object-fit: contain;
}

@media (max-width: 640px) {
    .header-home {
        grid-template-columns: 1fr;
    }

    .home-title {
        grid-column: 1;
    }
}