/* ============================================
   COMPONENTES REUTILIZÁVEIS
   ============================================ */

/* Cards */
.editor {
    background: var(--card);
    border-radius: var(--radius-lg);
    padding: 30px;
    box-shadow: var(--shadow);
    height: fit-content;
}

/* Títulos de Seção */
.section-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 30px 0 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title:first-of-type {
    margin-top: 0;
}

/* Formulários */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
}

input,
textarea,
select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    background: var(--card);
    transition: var(--transition);
}

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

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

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

/* Botões */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 28px;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -5px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary:hover {
    background: var(--bg-dark);
    border-color: var(--text-light);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* Lista Dinâmica */
.dynamic-list {
    margin-bottom: 15px;
}

.list-item {
    background: var(--bg);
    padding: 20px;
    border-radius: var(--radius);
    margin-bottom: 12px;
    position: relative;
    border: 1px solid var(--border);
}

.remove-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #ef4444;
    color: white;
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1) rotate(90deg);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--text);
    color: white;
    padding: 16px 24px;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    transform: translateY(100px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
    font-weight: 500;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 640px) {
    .toast {
        left: 20px;
        right: 20px;
        bottom: 20px;
    }
}

/* ============================================
   PAINEL DE PERSONALIZAÇÃO (Dia 2)
   ============================================ */

.customization-panel {
    background: linear-gradient(135deg, var(--bg) 0%, var(--card) 100%);
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 25px;
    position: relative;
}

.customization-panel .section-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1rem;
}

.select-styled {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

.theme-preview {
    margin-top: 15px;
    padding: 10px;
    background: var(--card);
    border-radius: var(--radius-sm);
    text-align: center;
    color: var(--text-light);
    font-size: 0.85rem;
    border: 1px dashed var(--border);
}

/* Transições suaves entre temas */
#preview {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#preview * {
    transition: font-family 0.3s ease, color 0.3s ease, background-color 0.3s ease;
}

@media (max-width: 767px) {
    .customization-panel {
        margin: -20px -15px 20px -15px;
        border-radius: 0;
        border-left: none;
        border-right: none;
    }
}