/*
  ============================================================================
  PROPRIETÁRIO: Mauricio Spark
  MARCA:        SparkMauricio
  PROJETO:      Sendy
  VERSÃO:       v1.0.0
  LINHAGEM:     SPARK
  ============================================================================
  Documento de Planejamento de Escopo
  COPYRIGHT: © 2026 / Mauricio Spark. Todos os direitos reservados.
  ============================================================================
*/

/* CSS Reset e Variáveis */
:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #25D366;
    --danger-color: #EA4335;
    --text-color: #333;
    --text-muted: #666;
    --border-color: #e0e0e0;
    --background-light: #f8f9fa;
    --shadow-sm: 0 4px 15px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 10px 40px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.3);
    --transition-speed: 0.3s;
    --border-radius: 10px;
    --border-radius-lg: 20px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    line-height: 1.6;
}

.container {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    max-width: 1400px;
    width: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    text-align: center;
    padding: 30px 20px;
    flex-shrink: 0;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 30px;
}

/* Split Layout */
.split-layout {
    display: flex;
    gap: 30px;
    min-height: calc(100vh - 200px);
}

.config-panel {
    flex: 1;
    display: block;
    overflow-y: auto;
    padding-right: 15px;
}

.preview-panel {
    flex: 1;
    display: block;
    overflow-y: auto;
    padding-left: 15px;
    border-left: 2px solid #e0e0e0;
}

.preview-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    text-align: center;
}

.preview-header h3 {
    margin: 0;
    font-size: 1.2em;
}

.preview-card {
    min-height: 300px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Mobile-only navigation */
.mobile-only {
    display: none;
}

/* Tab Navigation */
.tab-nav {
    display: flex;
    background: #f8f9fa;
    border-bottom: 2px solid #e0e0e0;
}

.tab-btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    background: transparent;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
    border-bottom: 3px solid transparent;
}

.tab-btn:hover {
    background: #e9ecef;
    color: #667eea;
}

.tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: white;
}

/* Panels */
.panel {
    display: none;
}

.panel.active {
    display: block;
}

/* Configuration Panel */
.config-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.config-section h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.form-group {
    margin-bottom: 15px;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

input[type="text"],
input[type="date"],
input[type="time"],
textarea,
select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1em;
    font-family: inherit;
    transition: border-color var(--transition-speed) ease, box-shadow var(--transition-speed) ease;
}

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

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

.help-text {
    font-size: 0.9em;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

.config-actions {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

/* Template Library */
.template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 15px;
}

.template-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
}

.template-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.template-image {
    width: 100%;
    height: 100px;
    object-fit: cover;
}

.template-placeholder {
    width: 100%;
    height: 100px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3em;
}

.template-info {
    padding: 10px;
    text-align: center;
}

.template-info h4 {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    color: #333;
}

.template-info p {
    margin: 0;
    font-size: 0.8em;
    color: #666;
}

.template-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.invitation-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.preview-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    transition: all 0.3s ease;
}

.preview-card:hover {
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.card-header {
    text-align: center;
    margin-bottom: 20px;
}

.card-header h2 {
    color: #667eea;
    font-size: 1.8em;
}

.card-body {
    text-align: center;
}

.greeting {
    font-size: 1.3em;
    margin-bottom: 15px;
    color: #333;
}

.guest-name {
    font-weight: bold;
    color: #764ba2;
    font-size: 1.2em;
}

.invitation-text {
    font-size: 1.1em;
    line-height: 1.6;
    color: #555;
    margin-bottom: 20px;
}

.event-details {
    background: white;
    padding: 15px;
    border-radius: 10px;
    text-align: left;
}

.event-details p {
    margin: 8px 0;
    color: #333;
}

.guest-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #e0e0e0;
}

.info-row:last-child {
    border-bottom: none;
}

.label {
    font-weight: 600;
    color: #667eea;
}

.value {
    color: #333;
    font-weight: 500;
}

.navigation {
    text-align: center;
    margin-bottom: 20px;
}

.counter {
    font-size: 1.2em;
    color: #667eea;
    font-weight: bold;
}

.actions {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
}

.btn {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

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

.btn-whatsapp:hover {
    background: #128C7E;
}

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

.btn-email:hover {
    background: #D33426;
}

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

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
}

.navigation-buttons {
    display: flex;
    gap: 15px;
}

.icon {
    font-size: 1.2em;
}

footer {
    background: #f8f9fa;
    text-align: center;
    padding: 20px;
    color: #666;
    font-size: 0.9em;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    min-width: 300px;
    padding: 15px 20px;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease;
    position: relative;
    overflow: hidden;
}

.toast::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
}

.toast.success::before {
    background: var(--success-color);
}

.toast.error::before {
    background: var(--danger-color);
}

.toast.info::before {
    background: var(--primary-color);
}

.toast.warning::before {
    background: #ffc107;
}

.toast-icon {
    font-size: 1.5em;
}

.toast.success .toast-icon {
    color: var(--success-color);
}

.toast.error .toast-icon {
    color: var(--danger-color);
}

.toast.info .toast-icon {
    color: var(--primary-color);
}

.toast.warning .toast-icon {
    color: #ffc107;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text-color);
}

.toast-message {
    font-size: 0.9em;
    color: var(--text-muted);
}

.toast-close {
    background: none;
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background var(--transition-speed);
}

.toast-close:hover {
    background: #f0f0f0;
    color: var(--text-color);
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast.removing {
    animation: slideOut 0.3s ease;
}

/* Loading States */
.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

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

@media (max-width: 900px) {
    .container {
        max-width: 100%;
        border-radius: 0;
        box-shadow: none;
    }

    .split-layout {
        flex-direction: column;
        gap: 0;
    }

    .config-panel {
        display: none;
        padding-right: 0;
    }

    .config-panel.active {
        display: block;
    }

    .preview-panel {
        display: none;
        padding-left: 0;
        border-left: none;
    }

    .preview-panel.active {
        display: block;
    }

    .mobile-only {
        display: flex;
    }

    .tab-nav {
        display: flex;
    }

    .preview-header {
        display: none;
    }

    header h1 {
        font-size: 2em;
    }

    .actions {
        flex-direction: column;
    }

    .navigation-buttons {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
        gap: 10px;
    }

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

    .tab-btn {
        padding: 12px 15px;
        font-size: 0.9em;
    }
}