/* =============================================================
   DODO MoodboardAI — Frontend CSS
   Volledig custom, thema-onafhankelijk
   ============================================================= */

/* ---- Reset & base ---- */
.ssm-app * {
    box-sizing: border-box;
}

.ssm-app {
    --ssm-dark:    #1A1A1A;
    --ssm-gold:    #C8A96E;
    --ssm-light:   #F8F5F0;
    --ssm-mid:     #E8E0D5;
    --ssm-text:    #2C2C2C;
    --ssm-muted:   #888;
    --ssm-white:   #FFFFFF;
    --ssm-radius:  12px;
    --ssm-shadow:  0 4px 24px rgba(0,0,0,0.10);

    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--ssm-text);
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
}

/* ---- Steps ---- */
.ssm-step { display: block; }
.ssm-step--hidden { display: none !important; }

/* ---- Header ---- */
.ssm-header {
    text-align: center;
    margin-bottom: 40px;
}

.ssm-header-badge {
    display: inline-block;
    background: var(--ssm-gold);
    color: var(--ssm-dark);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 5px 14px;
    border-radius: 20px;
    margin-bottom: 16px;
}

.ssm-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--ssm-dark);
    margin: 0 0 12px;
    line-height: 1.2;
}

.ssm-subtitle {
    font-size: 16px;
    color: var(--ssm-muted);
    margin: 0;
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.6;
}

/* ---- Progress bar ---- */
.ssm-progress-bar {
    background: var(--ssm-mid);
    border-radius: 999px;
    height: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}

.ssm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--ssm-gold), #E8C88A);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.ssm-progress-label {
    text-align: right;
    font-size: 13px;
    color: var(--ssm-muted);
    margin-bottom: 32px;
}

/* ---- Questions ---- */
.ssm-questions-container {
    min-height: 320px;
}

.ssm-question {
    display: none;
    animation: ssm-fadein 0.3s ease;
}

.ssm-question--active {
    display: block;
}

@keyframes ssm-fadein {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.ssm-question-title {
    font-size: 22px;
    font-weight: 600;
    margin: 0 0 24px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.ssm-q-icon { font-size: 26px; }

/* ---- Options grid ---- */
.ssm-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
}

.ssm-option {
    background: var(--ssm-white);
    border: 2px solid var(--ssm-mid);
    border-radius: var(--ssm-radius);
    padding: 20px 16px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 500;
    color: var(--ssm-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.ssm-option:hover {
    border-color: var(--ssm-gold);
    transform: translateY(-2px);
    box-shadow: var(--ssm-shadow);
}

.ssm-option--selected {
    border-color: var(--ssm-gold) !important;
    background: #FBF6EE !important;
    box-shadow: 0 0 0 3px rgba(200, 169, 110, 0.2);
}

.ssm-option-icon {
    font-size: 28px;
    line-height: 1;
}

.ssm-option-label {
    font-size: 14px;
    font-weight: 600;
}

/* Color preview */
.ssm-color-preview {
    display: flex;
    gap: 5px;
    justify-content: center;
    margin-bottom: 4px;
}

.ssm-color-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid rgba(255,255,255,0.6);
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}

/* ---- Quiz navigation ---- */
.ssm-quiz-nav {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 32px;
}

/* ---- Buttons ---- */
.ssm-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    border-radius: 999px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.ssm-btn--primary {
    background: var(--ssm-dark);
    color: var(--ssm-white);
    border-color: var(--ssm-dark);
}

.ssm-btn--primary:hover:not(:disabled) {
    background: #333;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.ssm-btn--primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.ssm-btn--outline {
    background: transparent;
    color: var(--ssm-dark);
    border-color: var(--ssm-dark);
}

.ssm-btn--outline:hover {
    background: var(--ssm-dark);
    color: var(--ssm-white);
}

.ssm-btn--ghost {
    background: transparent;
    color: var(--ssm-muted);
    border-color: transparent;
}

.ssm-btn--ghost:hover {
    color: var(--ssm-dark);
    background: var(--ssm-light);
}

/* ---- Upload zone ---- */
.ssm-upload-zone {
    border: 2px dashed var(--ssm-mid);
    border-radius: var(--ssm-radius);
    padding: 60px 40px;
    text-align: center;
    background: var(--ssm-light);
    cursor: pointer;
    transition: all 0.2s;
}

.ssm-upload-zone:hover, .ssm-upload-zone.ssm-dragover {
    border-color: var(--ssm-gold);
    background: #FBF6EE;
}

.ssm-upload-icon { font-size: 48px; margin-bottom: 12px; }
.ssm-upload-title { font-size: 18px; font-weight: 600; margin: 8px 0; }
.ssm-upload-hint  { color: var(--ssm-muted); font-size: 14px; margin-bottom: 20px; }

.ssm-upload-preview {
    border-radius: var(--ssm-radius);
    overflow: hidden;
    position: relative;
    text-align: center;
}

.ssm-upload-preview img {
    max-width: 100%;
    max-height: 300px;
    border-radius: var(--ssm-radius);
    object-fit: cover;
}

.ssm-upload-remove {
    display: inline-block;
    margin-top: 12px;
    background: none;
    border: none;
    color: #e53935;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
}

.ssm-photo-nav {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-top: 28px;
    flex-wrap: wrap;
}

/* ---- Verification ---- */
.ssm-verify-form {
    max-width: 440px;
    margin: 0 auto;
}

.ssm-field {
    margin-bottom: 24px;
}

.ssm-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 15px;
}

.ssm-field input[type="email"],
.ssm-field input[type="text"] {
    width: 100%;
    padding: 13px 16px;
    border: 2px solid var(--ssm-mid);
    border-radius: var(--ssm-radius);
    font-size: 16px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
    outline: none;
    background: var(--ssm-white);
}

.ssm-field input:focus {
    border-color: var(--ssm-gold);
}

.ssm-field--hidden { display: none; }

.ssm-field-hint {
    font-size: 14px;
    color: var(--ssm-muted);
    margin-bottom: 16px;
}

/* Code inputs */
.ssm-code-inputs {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 20px;
}

.ssm-code-char {
    width: 52px !important;
    height: 60px;
    text-align: center;
    font-size: 24px !important;
    font-weight: 700;
    border: 2px solid var(--ssm-mid) !important;
    border-radius: 10px !important;
    padding: 0 !important;
    text-transform: uppercase;
}

.ssm-code-char:focus {
    border-color: var(--ssm-gold) !important;
    outline: none;
}

.ssm-logged-in-cta {
    text-align: center;
    margin-top: 32px;
    color: var(--ssm-muted);
    font-size: 14px;
}

.ssm-logged-in-cta a {
    color: var(--ssm-dark);
    font-weight: 600;
}

/* ---- Generating animation ---- */
.ssm-generating-wrap {
    text-align: center;
    padding: 60px 20px;
}

.ssm-generating-animation {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 32px;
}

.ssm-gen-ring {
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-top-color: var(--ssm-gold);
    border-radius: 50%;
    animation: ssm-spin 1.2s linear infinite;
}

.ssm-gen-ring--2 {
    inset: 16px;
    border-top-color: var(--ssm-dark);
    animation-duration: 0.8s;
    animation-direction: reverse;
}

.ssm-gen-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: var(--ssm-gold);
    animation: ssm-pulse 2s ease-in-out infinite;
}

@keyframes ssm-spin  { to { transform: rotate(360deg); } }
@keyframes ssm-pulse { 0%,100% { opacity:1; } 50% { opacity:0.5; } }

.ssm-gen-steps {
    margin-top: 32px;
    text-align: left;
    display: inline-block;
}

.ssm-gen-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    font-size: 15px;
    color: var(--ssm-text);
    transition: all 0.3s;
}

.ssm-gen-step--pending { color: var(--ssm-muted); }
.ssm-gen-step--done .ssm-gen-step-icon::before { content: '✅'; }
.ssm-gen-step--active .ssm-gen-step-icon::before { content: '⚙️'; }

/* ---- MOODBOARD CANVAS ---- */
.ssm-moodboard {
    position: relative;
    background: var(--ssm-light);
    border-radius: 16px;
    padding: 28px;
    margin: 32px 0;
    box-shadow: 0 8px 48px rgba(0,0,0,0.12);
    overflow: hidden;
}

/* Tape decorations */
.ssm-tape {
    position: absolute;
    background: rgba(200, 169, 110, 0.35);
    height: 28px;
    border-radius: 2px;
    pointer-events: none;
}

.ssm-tape--1 {
    width: 80px;
    top: -8px;
    left: 15%;
    transform: rotate(-4deg);
}

.ssm-tape--2 {
    width: 60px;
    top: -8px;
    right: 20%;
    transform: rotate(5deg);
}

.ssm-tape--3 {
    width: 70px;
    bottom: 40px;
    right: 5%;
    transform: rotate(-3deg);
}

/* Main render image */
.ssm-mb-render {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.15);
}

.ssm-mb-render img {
    width: 100%;
    display: block;
    border-radius: 12px;
}

.ssm-mb-render-label {
    position: absolute;
    bottom: 16px;
    right: 16px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    backdrop-filter: blur(4px);
}

/* Color palette */
.ssm-mb-colors {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.ssm-mb-color {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

.ssm-mb-color-swatch {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 3px solid white;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
    transition: transform 0.2s;
}

.ssm-mb-color-swatch:hover { transform: scale(1.1); }

.ssm-mb-color-name {
    font-size: 11px;
    color: var(--ssm-muted);
    text-align: center;
    max-width: 60px;
}

/* Products */
.ssm-mb-products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px;
}

.ssm-mb-product {
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    transition: all 0.2s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.ssm-mb-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 24px rgba(0,0,0,0.14);
}

.ssm-mb-product-img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
    display: block;
    background: var(--ssm-mid);
}

.ssm-mb-product-img-placeholder {
    width: 100%;
    aspect-ratio: 4/3;
    background: var(--ssm-mid);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
}

.ssm-mb-product-info {
    padding: 10px 12px;
}

.ssm-mb-product-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--ssm-dark);
    margin: 0 0 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ssm-mb-product-price {
    font-size: 13px;
    color: var(--ssm-gold);
    font-weight: 700;
}

.ssm-mb-product-btn {
    display: block;
    text-align: center;
    background: var(--ssm-dark);
    color: white;
    font-size: 12px;
    font-weight: 600;
    padding: 7px;
    text-decoration: none;
    transition: background 0.2s;
}

.ssm-mb-product-btn:hover { background: #333; }

/* Decorative items */
.ssm-mb-decor {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.ssm-mb-decor-item {
    background: white;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 13px;
    color: var(--ssm-muted);
    box-shadow: 0 1px 6px rgba(0,0,0,0.07);
    font-style: italic;
}

.ssm-mb-decor-item strong {
    display: block;
    font-style: normal;
    color: var(--ssm-dark);
    font-size: 13px;
    margin-bottom: 2px;
}

/* ---- Result actions ---- */
.ssm-result-header {
    text-align: center;
    margin-bottom: 24px;
}

.ssm-result-summary {
    font-size: 16px;
    color: var(--ssm-muted);
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.6;
}

.ssm-result-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 12px;
}

.ssm-remaining {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--ssm-muted);
}

.ssm-email-form {
    display: flex;
    gap: 10px;
    max-width: 440px;
    margin: 16px auto 0;
}

.ssm-email-form input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--ssm-mid);
    border-radius: 999px;
    font-size: 15px;
    outline: none;
}

.ssm-email-form input:focus { border-color: var(--ssm-gold); }

/* ---- Message ---- */
.ssm-message {
    padding: 14px 20px;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 500;
    margin: 16px 0;
    text-align: center;
}

.ssm-message--success { background: #E8F5E9; color: #2E7D32; border: 1px solid #A5D6A7; }
.ssm-message--error   { background: #FEEBEE; color: #C62828; border: 1px solid #EF9A9A; }
.ssm-message--info    { background: #E3F2FD; color: #1565C0; border: 1px solid #90CAF9; }

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .ssm-title { font-size: 24px; }
    .ssm-options { grid-template-columns: repeat(2, 1fr); }
    .ssm-mb-products { grid-template-columns: repeat(2, 1fr); }
    .ssm-result-actions { flex-direction: column; align-items: center; }
    .ssm-email-form { flex-direction: column; }
    .ssm-admin-grid { grid-template-columns: 1fr; }
    .ssm-stats-grid { grid-template-columns: 1fr; }
}

/* =============================================================
   v1.1.0 — History & Modal styles
   ============================================================= */

/* ---- History page ---- */
.ssm-history {
    max-width: 960px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

.ssm-history-header {
    text-align: center;
    margin-bottom: 40px;
}

.ssm-history-loading {
    text-align: center;
    padding: 60px 20px;
    color: var(--ssm-muted, #888);
}

.ssm-history-loading .ssm-gen-ring {
    width: 48px;
    height: 48px;
    border-width: 3px;
    margin: 0 auto 16px;
}

.ssm-history-empty {
    text-align: center;
    padding: 80px 20px;
    color: var(--ssm-muted, #888);
}

.ssm-history-empty h3 {
    font-size: 20px;
    margin-bottom: 8px;
    color: #1a1a1a;
}

.ssm-history-login {
    text-align: center;
    padding: 40px;
    font-size: 16px;
    color: #666;
}

/* ---- History grid ---- */
.ssm-history-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* ---- History card ---- */
.ssm-hist-card {
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.ssm-hist-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
}

.ssm-hist-img-wrap {
    position: relative;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.ssm-hist-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s;
}

.ssm-hist-card:hover .ssm-hist-img {
    transform: scale(1.03);
}

.ssm-hist-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.ssm-hist-card:hover .ssm-hist-overlay {
    background: rgba(0,0,0,0.35);
}

.ssm-hist-view-btn {
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.2s;
}

.ssm-hist-card:hover .ssm-hist-view-btn {
    opacity: 1;
    transform: translateY(0);
}

.ssm-hist-body {
    padding: 16px;
    flex: 1;
}

.ssm-hist-date {
    font-size: 12px;
    color: var(--ssm-muted, #888);
    margin: 0 0 6px;
}

.ssm-hist-summary {
    font-size: 14px;
    color: #2C2C2C;
    margin: 0 0 12px;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ssm-hist-colors {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.ssm-hist-color {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 1px 4px rgba(0,0,0,0.15);
    display: inline-block;
}

.ssm-hist-products {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.ssm-hist-product {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #555;
    text-decoration: none;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 20px;
    max-width: 130px;
    overflow: hidden;
}

.ssm-hist-product img {
    width: 20px;
    height: 20px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

.ssm-hist-product span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ssm-hist-product-placeholder {
    font-size: 16px;
}

.ssm-hist-product:hover {
    background: #e8e8e8;
    color: #1a1a1a;
}

/* Card footer */
.ssm-hist-footer {
    padding: 10px 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    justify-content: flex-end;
}

.ssm-hist-delete-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: #bbb;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.15s;
}

.ssm-hist-delete-btn:hover {
    color: #e53935;
    background: #ffeaea;
}

/* ---- Pagination ---- */
.ssm-history-pagination {
    text-align: center;
    padding: 16px 0;
}

.ssm-hist-total {
    font-size: 14px;
    color: var(--ssm-muted, #888);
    margin-bottom: 12px;
}

.ssm-hist-pages {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.ssm-hist-page-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #e0e0e0;
    background: white;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #555;
    transition: all 0.15s;
}

.ssm-hist-page-btn:hover {
    border-color: #C8A96E;
    color: #1a1a1a;
}

.ssm-hist-page-btn--active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: white;
}

/* ---- Modal ---- */
.ssm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    z-index: 99998;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.ssm-modal {
    background: white;
    border-radius: 16px;
    max-width: 820px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 24px 80px rgba(0,0,0,0.3);
}

.ssm-modal-close {
    position: sticky;
    top: 16px;
    float: right;
    margin: 16px 16px 0 0;
    background: rgba(0,0,0,0.08);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    z-index: 1;
    transition: all 0.15s;
}

.ssm-modal-close:hover {
    background: rgba(0,0,0,0.15);
    color: #1a1a1a;
}

.ssm-modal-body {
    padding: 24px 28px 28px;
    clear: both;
}

.ssm-modal-date {
    font-size: 13px;
    color: #888;
    margin: 0 0 6px;
}

.ssm-modal-summary {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
    margin: 0 0 20px;
    line-height: 1.4;
}

.ssm-modal-render {
    width: 100%;
    border-radius: 10px;
    display: block;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.ssm-modal-colors {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.ssm-modal-products {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ssm-modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

@media (max-width: 600px) {
    .ssm-history-grid { grid-template-columns: 1fr; }
    .ssm-modal { border-radius: 12px 12px 0 0; align-self: flex-end; max-height: 85vh; }
    .ssm-modal-overlay { align-items: flex-end; padding: 0; }
}
