/* =====================================================
   Prompt Master — Gerador de Prompts para Sites
   Estilos principais
   ===================================================== */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary: #8b5cf6;
    --accent: #06b6d4;
    --bg-body: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --bg-input: #0f172a;
    --bg-hover: #334155;
    --bg-active: rgba(99, 102, 241, 0.15);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --text-placeholder: #64748b;
    --border: #334155;
    --border-focus: #6366f1;
    --success: #22c55e;
    --warning: #f59e0b;
    --error: #ef4444;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.25);
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    display: flex;
    min-height: 100vh;
}

/* =====================================================
   Sidebar / Navegação lateral
   ===================================================== */

.sidebar {
    width: 280px;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    z-index: 1000;
    transition: transform 0.35s ease;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 28px 24px;
    border-bottom: 1px solid var(--border);
}

.logo {
    width: 46px;
    height: 46px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #fff;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.35);
}

.brand-text h1 {
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1.2;
    color: var(--text-main);
}

.brand-text span {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.steps-nav {
    flex: 1;
    padding: 20px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    overflow-y: auto;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition);
    text-align: left;
    width: 100%;
}

.step-item:hover,
.step-item:focus-visible {
    background: var(--bg-hover);
    color: var(--text-main);
    outline: none;
}

.step-item.active {
    background: var(--bg-active);
    color: var(--primary-light);
    box-shadow: inset 3px 0 0 var(--primary);
}

.step-item.completed .step-number {
    background: var(--success);
    color: #fff;
}

.step-number {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-label {
    font-size: 0.92rem;
    font-weight: 500;
}

.sidebar-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--border);
    text-align: center;
}

.sidebar-footer p {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.sidebar-footer .author {
    font-size: 0.85rem;
    color: var(--text-main);
    font-weight: 600;
    margin-top: 4px;
}

/* =====================================================
   Main content / Área principal
   ===================================================== */

.main-content {
    flex: 1;
    margin-left: 280px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    position: sticky;
    top: 0;
    z-index: 900;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 18px 32px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.menu-toggle {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    width: 42px;
    height: 42px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1.1rem;
    transition: var(--transition);
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
    background: var(--bg-hover);
    outline: none;
}

.progress-wrapper {
    flex: 1;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

#step-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

#step-counter {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 999px;
    overflow: hidden;
}

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

.form-container {
    flex: 1;
    padding: 32px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

.form-step.active {
    display: block;
}

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

.step-header {
    margin-bottom: 28px;
}

.step-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.step-header h2 i {
    color: var(--primary-light);
}

.step-description {
    color: var(--text-muted);
    font-size: 0.95rem;
}

.subsection-title {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-main);
}

.required {
    color: var(--error);
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-placeholder);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    cursor: pointer;
}

select option {
    background: var(--bg-sidebar);
    color: var(--text-main);
}

/* Color inputs */
.color-input-wrapper {
    display: flex;
    gap: 10px;
    align-items: center;
}

input[type="color"] {
    width: 52px;
    height: 46px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: none;
    cursor: pointer;
    padding: 3px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border-radius: 6px;
    border: none;
}

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

.option-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 12px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-muted);
    user-select: none;
}

.option-card:hover {
    border-color: var(--primary);
    color: var(--text-main);
}

.option-card input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-card:has(input:checked) {
    background: var(--bg-active);
    border-color: var(--primary);
    color: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.option-card:has(input:focus-visible) {
    outline: 2px solid var(--primary-light);
    outline-offset: 2px;
}

.option-card i {
    font-size: 1rem;
    color: var(--primary-light);
}

.conditional-input {
    margin-top: 12px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.conditional-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Navigation buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 32px;
    border-top: 1px solid var(--border);
    position: sticky;
    bottom: 0;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(8px);
    z-index: 800;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    border: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 28px rgba(99, 102, 241, 0.45);
    outline: none;
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-outline:hover,
.btn-outline:focus-visible {
    background: var(--bg-hover);
    color: var(--text-main);
    outline: none;
}

.btn-secondary {
    background: var(--bg-hover);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    background: var(--bg-active);
    border-color: var(--primary);
    color: var(--primary-light);
    outline: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Result section */
.result-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 20px;
}

.prompt-output-wrapper {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.prompt-output {
    width: 100%;
    min-height: 500px;
    max-height: 70vh;
    overflow-y: auto;
    padding: 24px;
    background: var(--bg-card);
    color: var(--text-main);
    font-family: 'Fira Code', 'Consolas', monospace;
    font-size: 0.88rem;
    line-height: 1.65;
    white-space: pre-wrap;
    word-wrap: break-word;
    border: none;
    resize: vertical;
}

.prompt-output::-webkit-scrollbar {
    width: 8px;
}

.prompt-output::-webkit-scrollbar-track {
    background: var(--bg-input);
}

.prompt-output::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.prompt-output::-webkit-scrollbar-thumb:hover {
    background: var(--primary);
}

.credits {
    text-align: center;
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Toast notification */
.toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(120px);
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-main);
    padding: 14px 24px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: var(--shadow);
    z-index: 1100;
    transition: transform 0.35s ease, opacity 0.35s ease;
    opacity: 0;
}

.toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast i {
    color: var(--success);
    font-size: 1.2rem;
}

/* Validation error */
.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: var(--error);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.error-message {
    color: var(--error);
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* =====================================================
   Responsividade
   ===================================================== */

@media (max-width: 1024px) {
    .form-grid {
        grid-template-columns: 1fr;
    }

    .options-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .form-container {
        padding: 20px;
    }

    .top-header {
        padding: 14px 20px;
    }

    .form-navigation {
        padding: 16px 20px;
        flex-direction: column-reverse;
        gap: 12px;
    }

    .btn {
        width: 100%;
    }

    .result-actions {
        flex-direction: column;
    }

    .result-actions .btn {
        width: 100%;
    }

    .prompt-output {
        min-height: 400px;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .options-grid {
        grid-template-columns: 1fr 1fr;
    }

    .option-card {
        padding: 12px 10px;
        font-size: 0.82rem;
    }

    .step-header h2 {
        font-size: 1.25rem;
    }
}

/* Overlay para menu mobile */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.sidebar-overlay.show {
    opacity: 1;
    visibility: visible;
}
