:root {
    --primary-color: #25D366; 
    --primary-dark: #128C7E;
    --bg-color: #f0f2f5;
    --text-color: #333;
    --border-color: #ddd;
    --card-bg: #fff;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: var(--primary-dark);
    margin-bottom: 20px;
}

/* Tabs */
.tabs {
    display: flex;
    justify-content: center;
    gap: 10px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
    flex-wrap: wrap;
}

.tab-btn {
    background: none;
    border: none;
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    border-radius: 4px 4px 0 0;
    transition: all 0.3s;
}
.tab-btn:hover {
    color: var(--primary-dark);
    background: #e9ecef;
}
.tab-btn.active {
    color: var(--primary-dark);
    border-bottom: 3px solid var(--primary-dark);
    margin-bottom: -12px;
}

/* Panels */
.panel {
    display: none;
    animation: fadeIn 0.3s ease;
}
.panel.active {
    display: block;
}
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

h2 {
    margin-bottom: 10px;
    color: #444;
}
p {
    margin-bottom: 20px;
    color: #666;
}
.card {
    background-color: var(--card-bg);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}
.form-group {
    margin-bottom: 15px;
}
.form-group.row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
    font-size: 14px;
}
input, textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 15px;
}
.form-group.row input {
    flex: 1;
    min-width: 150px;
}

button, .btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    color: white;
    text-decoration: none;
    display: inline-block;
}
.btn-primary { background-color: #007bff; }
.btn-primary:hover { background-color: #0056b3; }
.btn-secondary { background-color: #6c757d; }
.btn-secondary:hover { background-color: #5a6268; }
.btn-send { background-color: var(--primary-color); }
.btn-send:hover { background-color: var(--primary-dark); }
.btn-delete { background-color: #dc3545; padding: 8px 12px; font-size: 14px; }
.btn-delete:hover { background-color: #c82333; }
.actions-bar { margin-bottom: 20px; }

/* Builder Layout */
.builder-layout {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}
.builder-controls {
    flex: 1;
    min-width: 300px;
}
.builder-preview {
    flex: 1;
    min-width: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Phone Frame */
.phone-frame {
    width: 350px;
    height: 650px;
    border: 12px solid #333;
    border-radius: 36px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 15px 25px rgba(0,0,0,0.2);
    background-color: #f7f3ed;
}

/* Preview Styles (Mimics invitacion.html) */
.preview-container {
    width: 100%;
    height: 100%;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    transition: background 0.3s;
}
.invite-card {
    background: #fff;
    padding: 30px 20px;
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    width: 100%;
    border: 2px solid #e3d5c8;
    transition: all 0.3s;
}
.guest-name {
    font-size: 1rem;
    color: #8c7a6b;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}
.invite-card h1 {
    font-size: 2.2rem;
    margin: 10px 0;
    line-height: 1.2;
    transition: color 0.3s;
}
.details {
    margin: 20px 0;
    font-size: 0.95rem;
    line-height: 1.5;
}
.icon { font-size: 1.2rem; margin-bottom: 5px; }
.detail-item { margin-bottom: 15px; }
.message {
    margin-top: 20px;
    font-style: italic;
    color: #666;
    border-top: 1px solid #eee;
    padding-top: 15px;
}

.contacts-list {
    list-style: none;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
.contacts-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-wrap: wrap;
    gap: 10px;
}
.contacts-list li:last-child { border-bottom: none; }
.contact-info strong { display: block; font-size: 1.1em; color: #333; }
.contact-info span { color: #888; font-size: 0.9em; }
.empty-msg { text-align: center; color: #888; padding: 30px !important; justify-content: center; }

/* Landing & Login Styles */
.landing-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    text-align: center;
    background-color: var(--bg-color);
}
.landing-container {
    max-width: 600px;
    padding: 50px 40px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    margin: 20px;
}
.landing-features {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 30px;
    text-align: left;
}
.feature {
    background: var(--bg-color);
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: #444;
}
.login-card {
    max-width: 400px;
    width: 100%;
    margin: 0 auto;
    text-align: left;
    padding: 40px 30px;
}

/* ==================================
   FINAL INVITATION STYLES (Templates)
   ================================== */
#invite-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    transition: background 0.3s;
}

.invite-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
}

.invite-card {
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    max-width: 400px;
    width: 90%;
    border: 2px solid #e3d5c8;
    transition: all 0.3s;
    overflow: hidden;
}

/* Template: Classic */
.tpl-classic {
    padding: 40px 30px;
    text-align: center;
}
.tpl-classic #photo-container {
    margin-bottom: 20px;
}
.tpl-classic #invite-photo, .tpl-classic #live-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #eee;
    margin: 0 auto;
    display: block;
}

/* Template: Modern */
.tpl-modern {
    padding: 0;
    text-align: left;
    border: none;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}
.tpl-modern #photo-container {
    width: 100%;
    height: 250px;
    margin: 0;
}
.tpl-modern #invite-photo, .tpl-modern #live-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 0;
}
.tpl-modern .invite-content {
    padding: 30px;
}

/* Template: Ticket VIP */
.tpl-ticket {
    padding: 30px;
    text-align: center;
    border: 2px dashed #ccc;
    background: radial-gradient(circle at 0 50%, transparent 15px, var(--card-bg, #fff) 16px), 
                radial-gradient(circle at 100% 50%, transparent 15px, var(--card-bg, #fff) 16px);
    background-size: 51% 100%;
    background-repeat: no-repeat;
    background-position: left, right;
}
.tpl-ticket #photo-container {
    margin-bottom: 20px;
}
.tpl-ticket #invite-photo, .tpl-ticket #live-photo {
    width: 100%;
    height: 140px;
    object-fit: cover;
    border-radius: 8px;
}

/* Base card text elements */
.guest-name {
    font-size: 1.1rem;
    color: #8c7a6b;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.invite-card h1 {
    font-size: 3rem;
    margin: 10px 0;
    line-height: 1.2;
    transition: color 0.3s;
}
.details {
    margin: 20px 0;
    font-size: 1.05rem;
    line-height: 1.6;
}
.icon { font-size: 1.5rem; margin-bottom: 5px; }
.detail-item { margin-bottom: 15px; }
.message {
    margin-top: 25px;
    font-style: italic;
    border-top: 1px solid #eee;
    padding-top: 20px;
    opacity: 0.8;
}

/* Animations */
.anim-fade-up {
    animation: fadeUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(30px);
}
@keyframes fadeUp {
    to { opacity: 1; transform: translateY(0); }
}

.anim-zoom {
    animation: zoomIn 0.8s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: scale(0.8);
}
@keyframes zoomIn {
    to { opacity: 1; transform: scale(1); }
}

/* ==================================
   HYBRID EDITOR STYLES (Inline Toolbar)
   ================================== */
.editable-block {
    position: relative;
    border: 2px solid transparent;
    transition: all 0.2s;
    cursor: pointer;
}
.editable-block:hover {
    border: 2px dashed #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}
.editable-block.active-edit {
    border: 2px solid #007bff;
    background-color: rgba(0, 123, 255, 0.05);
}
.editable-block[contenteditable="true"] {
    outline: none;
    cursor: text;
}

.inline-toolbar {
    background: #333;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    max-width: 350px;
    gap: 10px;
    align-items: center;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    margin: 15px auto 0 auto;
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.inline-toolbar.hidden {
    display: none;
}
.inline-toolbar button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
}
.inline-toolbar button:hover {
    background: #555;
}
.inline-toolbar select, .inline-toolbar input[type="color"] {
    padding: 4px;
    border: 1px solid #555;
    background: #222;
    color: white;
    border-radius: 4px;
}
.inline-toolbar .divider {
    width: 1px;
    height: 20px;
    background: #555;
    margin: 0 4px;
}
