/* AI Landscape Designer - Frontend Styles v8 */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700&family=DM+Sans:wght@400;500;600&display=swap');

.ld-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px 16px;
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #2d2417;
}
.ld-container *, .ld-container *::before, .ld-container *::after { box-sizing: border-box; }

.ld-header {
    text-align: center;
    margin-bottom: 28px;
}
.ld-header h2 {
    font-family: 'Playfair Display', serif;
    font-size: 26px;
    font-weight: 700;
    color: #2d4a1a;
    margin: 8px 0 4px;
    line-height: 1.2;
}
.ld-header p { color: #6b5e4f; font-size: 14px; margin: 4px 0 0; }

.ld-brand {
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: #6b5e4f;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: -2px;
}

.ld-section { margin-bottom: 24px; }
.ld-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
    color: #2d4a1a;
    margin-bottom: 10px;
}

/* Yard type checkboxes */
.ld-yard-types {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}
.ld-yard-types label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
}

/* Per-yard sections */
.ld-yard-section {
    border: 1px solid #e0d6c8;
    border-radius: 12px;
    padding: 20px 16px;
    margin-bottom: 20px;
    background: rgba(250, 248, 244, 0.5);
}
.ld-yard-section-title {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    color: #2d4a1a;
    margin: 0 0 14px 0;
    padding-bottom: 8px;
    border-bottom: 1px solid #e0d6c8;
}

/* Upload area */
.ld-upload-area {
    border: 2px dashed #c5b89a;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
    background: rgba(245,240,230,0.3);
    min-height: 160px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    margin-bottom: 16px;
}
.ld-upload-area:hover, .ld-upload-area.drag-over { border-color: #4a7c2e; background: rgba(245,240,230,0.6); }
.ld-upload-area.has-image { border-style: solid; border-color: #4a7c2e; padding: 0; cursor: default; }
.ld-upload-area img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; }
.ld-upload-icon-svg { margin-bottom: 8px; opacity: 0.7; }
.ld-upload-text { font-size: 13px; color: #6b5e4f; }
.ld-remove-img {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e53e3e;
    color: white;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    cursor: pointer;
    font-size: 14px;
    line-height: 28px;
    z-index: 2;
}

/* Per-yard preferences */
.ld-yard-prefs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
.ld-pref-group {}
.ld-pref-title {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #4a7c2e;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}
.ld-pref-list { display: flex; flex-direction: column; gap: 4px; }
.ld-pref-list label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.15s;
}
.ld-pref-list label:hover { background: rgba(74,124,46,0.08); }
.ld-pref-list input[type="radio"] { accent-color: #4a7c2e; width: 14px; height: 14px; }
.ld-pref-list input[type="checkbox"] { accent-color: #4a7c2e; width: 14px; height: 14px; }

/* Registration */
.ld-reg-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.ld-reg-grid .ld-full-width { grid-column: 1 / -1; }
.ld-reg-grid label { font-size: 13px; font-weight: 500; display: block; margin-bottom: 4px; }
.ld-reg-grid input, #ld-free-prompt {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c5b89a;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: #faf8f4;
    transition: border-color 0.2s;
}
.ld-reg-grid input:focus, #ld-free-prompt:focus {
    outline: none;
    border-color: #4a7c2e;
    box-shadow: 0 0 0 3px rgba(74,124,46,0.15);
}

/* Submit */
.ld-submit-section { text-align: center; margin-top: 8px; }
.ld-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    background: linear-gradient(135deg, #4a7c2e, #2d4a1a);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    min-width: 200px;
    justify-content: center;
}
.ld-btn:hover { opacity: 0.9; }
.ld-btn:active { transform: scale(0.98); }
.ld-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Loading */
#ld-loading { text-align: center; padding: 48px 16px; }
#ld-loading-message p { color: #2d4a1a; font-size: 16px; font-weight: 500; }

.ld-progress-container { max-width: 400px; margin: 0 auto; }
.ld-progress-bar {
    width: 100%;
    height: 12px;
    background: #e8e0d0;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 12px;
}
.ld-progress-bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #4a7c2e, #6da544);
    border-radius: 6px;
    transition: width 0.1s linear;
}
.ld-progress-container p { color: #6b5e4f; font-size: 14px; }

.ld-spinner {
    width: 44px; height: 44px;
    border: 4px solid #e8e0d0;
    border-top-color: #4a7c2e;
    border-radius: 50%;
    animation: ld-spin 0.8s linear infinite;
    margin: 0 auto 16px;
}
@keyframes ld-spin { to { transform: rotate(360deg); } }
#ld-loading-spinner-phase p { color: #6b5e4f; font-size: 15px; }

/* Results */
#ld-results { text-align: center; }
#ld-results h2 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    color: #2d4a1a;
    margin-bottom: 20px;
}
.ld-result-images { display: grid; gap: 16px; margin-bottom: 24px; }
.ld-result-images img {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e8e0d0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* CTA */
.ld-result-cta {
    background: linear-gradient(135deg, #f0ebe3 0%, #faf8f4 100%);
    border: 2px solid #d4c9b0;
    border-radius: 14px;
    padding: 28px 20px;
    margin-bottom: 24px;
    text-align: center;
}
.ld-cta-message {
    font-family: 'Playfair Display', serif;
    font-size: 18px;
    font-weight: 600;
    color: #2d4a1a;
    margin: 0 0 16px 0;
    line-height: 1.4;
}
.ld-cta-link {
    text-decoration: none !important;
}
.ld-cta-link:hover {
    text-decoration: none !important;
}
.ld-btn-outline {
    background: transparent;
    border: 2px solid #4a7c2e;
    color: #4a7c2e;
}

/* Toast */
.ld-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    z-index: 10000;
    animation: ld-toast-in 0.3s ease;
    max-width: 340px;
}
.ld-toast-error { background: #e53e3e; color: white; }
.ld-toast-success { background: #4a7c2e; color: white; }
@keyframes ld-toast-in { from { opacity:0; transform: translateY(10px); } to { opacity:1; transform:translateY(0); } }

/* Error */
.ld-error-box {
    text-align: center;
    padding: 40px 20px;
    max-width: 480px;
    margin: 0 auto;
}
.ld-error-icon-img { margin-bottom: 16px; }
.ld-error-icon-img svg { display: inline-block; }
.ld-error-msg {
    font-size: 15px;
    color: #c0392b;
    font-weight: 600;
    margin-bottom: 8px;
}
.ld-error-encourage {
    font-size: 14px;
    color: #6b5e4f;
    margin-bottom: 20px;
    line-height: 1.5;
}
.ld-retry-btn { min-width: 180px; }

/* Before/After Slider */
.ld-compare-container { margin-bottom: 24px; }
.ld-compare-wrapper {
    position: relative;
    width: 100%;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e8e0d0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    cursor: col-resize;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}
.ld-compare-after { display: block; width: 100%; height: auto; }
.ld-compare-before {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    clip-path: inset(0 50% 0 0);
}
.ld-compare-before img { width: 100%; height: 100%; object-fit: cover; }
.ld-compare-slider {
    position: absolute; top: 0; left: 50%; width: 4px; height: 100%;
    background: #fff; transform: translateX(-50%); z-index: 10;
    pointer-events: none; box-shadow: 0 0 6px rgba(0,0,0,0.3);
}
.ld-compare-handle {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 40px; height: 40px; background: #fff; border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
    display: flex; align-items: center; justify-content: center;
}
.ld-handle-arrows { font-size: 11px; color: #2d4a1a; letter-spacing: 4px; font-weight: 700; }
.ld-compare-label {
    position: absolute; bottom: 10px; padding: 3px 12px;
    background: rgba(0,0,0,0.55); color: #fff; font-size: 12px; font-weight: 600;
    border-radius: 16px; z-index: 5; pointer-events: none;
    font-family: 'DM Sans', sans-serif;
}
.ld-label-before { left: 10px; }
.ld-label-after { right: 10px; }

/* ── MOBILE ── */
@media (max-width: 600px) {
    .ld-container { padding: 16px 12px; }
    .ld-header h2 { font-size: 22px; }
    .ld-yard-prefs { grid-template-columns: 1fr; gap: 12px; }
    .ld-reg-grid { grid-template-columns: 1fr; }
    .ld-yard-section { padding: 16px 12px; }
    .ld-upload-area { min-height: 140px; padding: 20px; }
    .ld-upload-area img { height: 160px; }
    .ld-btn { padding: 12px 28px; font-size: 15px; min-width: 160px; }
    .ld-cta-btn { padding: 12px 28px; font-size: 15px; }
    .ld-compare-handle { width: 36px; height: 36px; }
    .ld-pref-list label { font-size: 13px; padding: 5px 6px; }
    .ld-result-cta { padding: 20px 16px; }
    .ld-cta-message { font-size: 16px; }
    .ld-error-box { padding: 32px 16px; }
}

@media (max-width: 400px) {
    .ld-header h2 { font-size: 20px; }
    .ld-yard-types { gap: 10px; }
    .ld-yard-types label { font-size: 13px; }
}

/* Download button */
.ld-download-wrap {
    text-align: center;
    margin-top: 12px;
}
.ld-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.ld-download-btn svg {
    flex-shrink: 0;
}

/* Single upload zone */
#ld-upload-zone { cursor: pointer; }
#ld-upload-zone.has-image { cursor: default; }
#ld-upload-preview { position: relative; }
#ld-upload-preview img { width: 100%; height: 200px; object-fit: cover; border-radius: 8px; }
.ld-download-wrap { text-align: center; margin: 10px 0 20px; }

/* CTA Book Now button - blue with white text */
.ld-cta-link.ld-btn {
    background: linear-gradient(135deg, #2563eb, #1d4ed8) !important;
    color: #ffffff !important;
    border: none !important;
}
.ld-cta-link.ld-btn:hover {
    background: linear-gradient(135deg, #1d4ed8, #1e40af) !important;
}

/* Refine / Adjust Design */
.ld-refine-section {
    background: linear-gradient(135deg, #f0ebe3 0%, #faf8f4 100%);
    border: 2px solid #d4c9b0;
    border-radius: 14px;
    padding: 24px 20px;
    margin: 24px 0;
    text-align: center;
}
.ld-refine-header {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    font-weight: 600;
    color: #2d4a1a;
    margin-bottom: 12px;
}
.ld-refine-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #4a3f2f;
    margin-bottom: 8px;
    text-align: left;
}
.ld-refine-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #c5b89a;
    border-radius: 8px;
    font-size: 14px;
    font-family: 'DM Sans', sans-serif;
    background: #faf8f4;
    resize: vertical;
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.ld-refine-textarea:focus {
    outline: none;
    border-color: #4a7c2e;
    box-shadow: 0 0 0 3px rgba(74,124,46,0.15);
}

/* ── Share Buttons ── */
.ld-share-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin: 12px 0 4px;
}
.ld-share-label {
    font-size: 13px;
    color: #6b5e4f;
    font-weight: 500;
}
.ld-share-btn {
    padding: 8px 16px !important;
    font-size: 13px !important;
    min-width: auto !important;
    gap: 6px !important;
}
.ld-share-btn svg {
    flex-shrink: 0;
}
