/* DOOH Generator Frontend */

:root {
    --dooh-primary: #2563eb;
    --dooh-primary-dark: #1d4ed8;
    --dooh-bg: #ffffff;
    --dooh-card: #f8fafc;
    --dooh-card-light: #e2e8f0;
    --dooh-text: #1e293b;
    --dooh-text-muted: #64748b;
    --dooh-accent: #7c3aed;
    --dooh-success: #059669;
    --dooh-error-bg: #fef2f2;
    --dooh-error-border: #fca5a5;
    --dooh-error-text: #991b1b;
}

.dooh-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 2rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--dooh-bg);
    color: var(--dooh-text);
    border-radius: 16px;
}

.dooh-title {
    font-size: 2.2rem;
    margin-bottom: 0.25rem;
    background: linear-gradient(135deg, var(--dooh-primary), var(--dooh-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dooh-subtitle {
    color: var(--dooh-text-muted);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Tabs */
.dooh-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid var(--dooh-card-light);
}

.dooh-tab {
    padding: 0.75rem 1.5rem;
    border: none;
    background: none;
    font-size: 1rem;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    color: var(--dooh-text-muted);
    transition: all 0.2s;
}

.dooh-tab:hover {
    color: var(--dooh-text);
}

.dooh-tab.active {
    color: var(--dooh-primary);
    border-bottom-color: var(--dooh-primary);
    font-weight: 600;
}

/* Upload Zone */
.dooh-upload-zone {
    border: 2px dashed var(--dooh-card-light);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: var(--dooh-card);
    position: relative;
}

.dooh-upload-zone:hover,
.dooh-upload-zone.dragover {
    border-color: var(--dooh-primary);
    background: rgba(37, 99, 235, 0.1);
}

.dooh-upload-zone input[type="file"] {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    opacity: 0;
    cursor: pointer;
}

.dooh-upload-icon {
    font-size: 3.5rem;
    margin-bottom: 0.5rem;
}

.dooh-upload-zone p {
    color: var(--dooh-text-muted);
}

.dooh-file-preview {
    margin-top: 1rem;
    font-weight: 600;
    color: var(--dooh-primary);
}

/* Manual Mode Fields */
.dooh-field {
    margin-bottom: 1rem;
}

.dooh-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
    color: var(--dooh-text-muted);
}

.dooh-field input[type="text"],
.dooh-field textarea {
    width: 100%;
    padding: 0.7rem 1rem;
    border: 1px solid var(--dooh-card-light);
    border-radius: 10px;
    font-size: 1rem;
    box-sizing: border-box;
    background: var(--dooh-card);
    color: var(--dooh-text);
    transition: border-color 0.2s;
}

.dooh-field input[type="text"]::placeholder,
.dooh-field textarea::placeholder {
    color: #94a3b8;
}

.dooh-field input[type="text"]:focus,
.dooh-field textarea:focus {
    outline: none;
    border-color: var(--dooh-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.dooh-field textarea {
    resize: vertical;
}

/* Options */
.dooh-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--dooh-card);
    border-radius: 14px;
}

.dooh-option-group > label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.dooh-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.dooh-radio-group label {
    cursor: pointer;
    font-size: 0.9rem;
    color: var(--dooh-text-muted);
    transition: color 0.2s;
}

.dooh-radio-group label:hover {
    color: var(--dooh-text);
}

.dooh-radio-group input[type="radio"] {
    accent-color: var(--dooh-primary);
}

.dooh-option-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Submit Button */
.dooh-submit {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--dooh-primary), var(--dooh-accent));
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1.15rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: 0.02em;
}

.dooh-submit:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.dooh-submit:active {
    transform: translateY(0);
}

.dooh-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Loading */
.dooh-loading {
    text-align: center;
    padding: 3rem;
}

.dooh-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--dooh-card-light);
    border-top-color: var(--dooh-primary);
    border-radius: 50%;
    animation: dooh-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

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

/* Progress Bar */
.dooh-progress-wrap {
    width: 100%;
    max-width: 400px;
    margin: 1rem auto;
}

.dooh-progress-track {
    width: 100%;
    height: 10px;
    background: var(--dooh-card-light);
    border-radius: 5px;
    overflow: hidden;
}

.dooh-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--dooh-primary), var(--dooh-accent));
    border-radius: 5px;
    width: 0%;
    transition: width 0.5s ease;
}

.dooh-progress-text {
    text-align: center;
    margin-top: 0.5rem;
    font-size: 0.9rem;
    color: var(--dooh-text-muted);
}

/* Debug Log */
.dooh-debug-log {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #1e293b;
    color: #4ade80;
    font-family: 'JetBrains Mono', 'Fira Code', 'Courier New', monospace;
    font-size: 0.78rem;
    border-radius: 10px;
    max-height: 220px;
    overflow-y: auto;
    line-height: 1.6;
    border: 1px solid #334155;
}

.dooh-debug-log div {
    padding: 1px 0;
}

/* Results */
.dooh-results {
    margin-top: 2rem;
}

.dooh-results h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--dooh-primary), var(--dooh-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.dooh-colors {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.dooh-color-swatch {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    border: 2px solid var(--dooh-card-light);
    transition: transform 0.2s;
}

.dooh-color-swatch:hover {
    transform: scale(1.15);
}

.dooh-proposals {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.dooh-proposal {
    background: var(--dooh-card);
    border-radius: 14px;
    padding: 1.5rem;
}

.dooh-proposal h4 {
    margin: 0 0 1rem;
    font-size: 1.1rem;
    color: var(--dooh-text);
}

.dooh-slides {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.dooh-slide {
    position: relative;
}

.dooh-slide-label {
    text-align: center;
    font-size: 0.85rem;
    color: var(--dooh-text-muted);
    margin-top: 0.5rem;
}

.dooh-model-tag {
    display: inline-block;
    background: #ede9fe;
    color: #6d28d9;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-left: 0.25rem;
}

/* Screen Mockup */
.dooh-mockup {
    position: relative;
    background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 50%, #e2e8f0 100%);
    border-radius: 12px;
    padding: 2rem 2rem 2.5rem;
    text-align: center;
}

.dooh-mockup-frame {
    display: inline-block;
    position: relative;
    background: #1e293b;
    border-radius: 8px;
    padding: 8px;
    box-shadow: 
        0 0 20px rgba(37, 99, 235, 0.1),
        0 10px 30px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 100%;
}

.dooh-mockup-frame img {
    width: 100%;
    display: block;
    border-radius: 4px;
}

.dooh-mockup-stand {
    width: 60px;
    height: 30px;
    background: linear-gradient(180deg, #1e293b, #334155);
    margin: 0 auto;
    border-radius: 0 0 4px 4px;
}

.dooh-mockup-base {
    width: 120px;
    height: 8px;
    background: #1e293b;
    margin: 0 auto;
    border-radius: 4px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Download */
.dooh-download-btn {
    display: inline-block;
    margin-top: 0.75rem;
    padding: 0.5rem 1.25rem;
    background: var(--dooh-success);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.9rem;
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.dooh-download-btn:hover {
    opacity: 0.85;
    color: white;
    text-decoration: none;
}

/* Error */
.dooh-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 1rem;
    border-radius: 10px;
    margin-top: 1rem;
}

/* Powered by footer */
.dooh-footer {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--dooh-card-light);
    color: var(--dooh-text-muted);
    font-size: 0.8rem;
}

/* Responsive */
@media (max-width: 600px) {
    .dooh-wrap {
        padding: 1rem;
    }
    .dooh-slides {
        grid-template-columns: 1fr;
    }
    .dooh-options {
        grid-template-columns: 1fr;
    }
    .dooh-tabs {
        flex-direction: column;
    }
    .dooh-tab {
        text-align: left;
    }
}
