/* ========================================
   CSS VARIABLES
   ======================================== */
:root {
    /* Colors */
    --primary: #345fd8;
    --primary-light: #859fe7;
    --primary-dark: #244297;
    --secondary: #ff8100;
    --text-light: #ffffff;
    --text-dark: #333333;
    --background: #f5f5f7;
    --error: #ff5252;
    
    /* Layout */
    --border-radius: 8px;
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
    
    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 15px;
    --spacing-lg: 20px;
    --spacing-xl: 30px;
}

/* ========================================
   RESET & BASE STYLES
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Poppins", sans-serif;
    background: #e0e0e0;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: var(--spacing-lg);
}

/* ========================================
   LAYOUT COMPONENTS
   ======================================== */
.container {
    background-color: rgba(255, 255, 255, 0.95);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    width: 100%;
    max-width: 600px;
    overflow: hidden;
}

.content {
    padding: var(--spacing-xl);
}

/* ========================================
   HEADER COMPONENT
   ======================================== */
.header {
    background-color: var(--primary);
    color: var(--text-light);
    padding: var(--spacing-lg) var(--spacing-xl);
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 40px;
    height: 40px;
    margin-right: var(--spacing-md);
}

.logo-container h1 {
    margin-left: auto;
    margin-right: auto;
}

h1 {
    font-size: 20px;
    font-weight: 600;
}

/* ========================================
   FORM COMPONENTS
   ======================================== */
.form-group {
    margin-bottom: 25px;
}

label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

input,
select {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: 1px solid #e0e0e0;
    border-radius: var(--border-radius);
    font-size: 14px;
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(110, 43, 119, 0.2);
}

[data-tip] {
	position:relative;
    top: 6px;

}
[data-tip]:after {
	  display:none;
    content:attr(data-tip);
    position:absolute;
    top: -10px;
    left:25px;
    padding:5px 8px;
    background:#666666f0;
    color:#fff;
    z-index:9;
    font-size: 0.75em;
    line-height: 1.4em;
    width: 200px;
    word-wrap: break-word;
    -webkit-border-radius: 3px;
    -moz-border-radius: 3px;
    border-radius: 3px;
    word-wrap:normal;
}

[data-tip]:hover:after {
	display:block;
}

/* ========================================
   SECTION COMPONENTS
   ======================================== */
.section {
    margin-bottom: var(--spacing-xl);
}

h2 {
    font-size: 18px;
    margin-bottom: 10px;
    color: var(--primary);
}

.description {
    font-size: 14px;
    color: #666;
    margin-bottom: var(--spacing-lg);
}

/* ========================================
   CUSTOM FIELDS COMPONENT
   ======================================== */
.custom-fields {
    margin-bottom: var(--spacing-lg);
}

.custom-field-row {
    display: flex;
    gap: 10px;
    margin-bottom: var(--spacing-md);
    align-items: center;
    background-color: #f9f9f9;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    animation: fadeIn 0.3s ease-out;
}

.custom-field-row:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.custom-field-row select {
    flex: 2;
}

.custom-field-row input {
    flex: 1;
}

.empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: #666;
    font-style: italic;
}

/* ========================================
   BUTTON COMPONENTS
   ======================================== */
.btn-add {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    background-color: transparent;
    color: var(--primary);
    border: 2px dashed var(--primary);
    padding: var(--spacing-sm) var(--spacing-lg);
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    width: 100%;
    transition: var(--transition);
}

.btn-add:hover {
    background-color: rgba(110, 43, 119, 0.05);
}

.plus-icon {
    font-size: 18px;
    font-weight: bold;
}

.btn-remove {
    background-color: var(--error);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    transition: var(--transition);
    flex-shrink: 0;
}

.btn-remove:hover {
    background-color: #ff0000;
    transform: scale(1.05);
}

.btn-primary,
.btn-secondary {
    padding: var(--spacing-sm) 24px;
    border-radius: var(--border-radius);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-dark);
    border: 1px solid #e0e0e0;
}

.btn-secondary:hover {
    background-color: #eeeeee;
}

/* ========================================
   WHATSAPP PREVIEW COMPONENT
   ======================================== */
.whatsapp-preview {
    background: #ECE5DD;
    border-radius: 10px;
    padding: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.whatsapp-message {
    background: #ffffff;
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    margin: 0 auto;
    position: relative;
}

.message-content {
    white-space: pre-line;
    line-height: 1.5;
    font-size: 14px;
    color: #333;
}

.no-template {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: var(--spacing-lg);
}

.preview-note {
    text-align: center;
    margin-top: var(--spacing-md);
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* ========================================
   PROGRESS INDICATOR COMPONENT
   ======================================== */
.progress-indicator {
    display: flex;
    gap: var(--spacing-xs);
}

.step {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
}

.step.active {
    background-color: var(--secondary);
}

/* ========================================
   FOOTER COMPONENT
   ======================================== */
.footer {
    padding: var(--spacing-lg) var(--spacing-xl);
    background-color: var(--background);
    display: flex;
    justify-content: flex-end;
    gap: var(--spacing-md);
    border-top: 1px solid #e0e0e0;
}

/* ========================================
   ALERT COMPONENT
   ======================================== */
.alert {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--border-radius);
    margin-bottom: var(--spacing-lg);
    font-size: 14px;
    color: var(--error);
}

/* ========================================
   ANIMATIONS
   ======================================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */
@media (max-width: 600px) {
    .header {
        flex-direction: column;
        gap: var(--spacing-md);
        text-align: center;
    }

    .custom-field-row {
        flex-direction: column;
        align-items: stretch;
    }

    .btn-remove {
        align-self: flex-end;
    }

    .footer {
        flex-direction: column;
    }

    .content {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .container {
        max-width: 100%;
    }
    
    .content {
        padding: var(--spacing-md);
    }
}
