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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    direction: ltr;
}

body.rtl {
    direction: rtl;
    font-family: 'Amiri', 'Arial', sans-serif;
}

/* Toast Messages */
.toast-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 12px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    z-index: 10000;
    font-weight: 500;
    max-width: 350px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease;
}

.toast-message.show {
    opacity: 1;
    transform: translateX(0);
}

.toast-message.error {
    background: #f44336;
}

.toast-message.warning {
    background: #ff9800;
}

.toast-message.info {
    background: #2196f3;
}

/* Image Block Styles */
.image-upload-container {
    transition: all 0.3s ease;
}

.image-upload-container:hover {
    border-color: #667eea !important;
    background-color: #f0f0ff !important;
}

.image-block-input {
    cursor: pointer;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
    border-radius: 4px;
    border: none;
    cursor: pointer;
    margin: 2px;
}

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

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

.btn-danger {
    background-color: #dc3545;
    color: white;
}

.btn-danger:hover {
    background-color: #c82333;
}

.btn-primary {
    background-color: #007bff;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
}

.btn-primary:hover {
    background-color: #0056b3;
}

/* Image Resize Handles */
.resizable-image-container {
    position: relative;
    display: inline-block;
    max-width: 100%;
}

.resizable-image-container.resizing {
    user-select: none;
}

.resizable-image-container .resize-handle {
    position: absolute;
    background: #007bff;
    border: 1px solid #fff;
    border-radius: 3px;
    width: 8px;
    height: 8px;
    opacity: 0;
    transition: opacity 0.2s ease;
    z-index: 100;
}

.resizable-image-container:hover .resize-handle,
.resizable-image-container.resizing .resize-handle {
    opacity: 1;
}

.resize-handle.nw {
    top: -4px;
    left: -4px;
    cursor: nw-resize;
}

.resize-handle.ne {
    top: -4px;
    right: -4px;
    cursor: ne-resize;
}

.resize-handle.sw {
    bottom: -4px;
    left: -4px;
    cursor: sw-resize;
}

.resize-handle.se {
    bottom: -4px;
    right: -4px;
    cursor: se-resize;
}

.resize-handle.n {
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    cursor: n-resize;
}

.resize-handle.s {
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    cursor: s-resize;
}

.resize-handle.e {
    right: -4px;
    top: 50%;
    transform: translateY(-50%);
    cursor: e-resize;
}

.resize-handle.w {
    left: -4px;
    top: 50%;
    transform: translateY(-50%);
    cursor: w-resize;
}

.resizable-image-container img {
    max-width: none;
    display: block;
}

.resizable-image-container.resizing img {
    pointer-events: none;
}

.resizable-image-container.resizing::after {
    content: attr(data-dimensions);
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 101;
}

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

.screen-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

.form-container {
    background: white;
    padding: 40px;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    width: 100%;
    max-width: 500px;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
    margin-bottom: 30px;
    background: rgba(255,255,255,0.1);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
}

.header h1 {
    font-size: 2rem;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.language-toggle {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.3s ease;
}

.language-toggle:hover {
    background: rgba(255,255,255,0.3);
}

.nav-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.nav-tab {
    background: rgba(255,255,255,0.1);
    color: white;
    border: none;
    padding: 12px 24px;
    margin: 5px;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    font-size: 14px;
}

.nav-tab:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-2px);
}

.nav-tab.active {
    background: rgba(255,255,255,0.3);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.tab-content {
    display: none;
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

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

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    color: #555;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    margin: 5px;
}

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

.btn-secondary { background: #6c757d; }
.btn-success { background: #28a745; }
.btn-danger { background: #dc3545; }
.btn-warning { background: #ffc107; color: #212529; }
.btn-info { background: #17a2b8; }

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.client-card, .guest-card, .vendor-card {
    position: relative;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
}

.client-card:hover, .guest-card:hover, .vendor-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.client-card-delete-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #ff4d4f;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.client-card-delete-btn:hover {
    background: #ff1a1a;
}

.status-badge {
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
}

.status-paid { background: #e8f5e8; color: #2e7d32; }
.status-unpaid { background: #ffebee; color: #c62828; }
.status-active { background: #e3f2fd; color: #1976d2; }

.guest-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.guest-table th,
.guest-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.guest-table th {
    background-color: #f8f9fa;
    font-weight: 600;
}

.guest-table tr:hover {
    background-color: #f5f5f5;
}

.rsvp-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.rsvp-attending { background: #e8f5e8; color: #2e7d32; }
.rsvp-pending { background: #e0e0e0; color: #424242; }

.countdown-display {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    margin: 20px 0;
}

.logout-btn {
    background: rgba(255,255,255,0.2);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background: rgba(255,255,255,0.3);
}

.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 15px;
    width: 80%;
    max-width: 600px;
    max-height: 80vh;
    overflow-y: auto;
}

.large-modal .modal-content {
    max-width: 1200px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: black;
}

.qr-code-container {
    text-align: center;
    margin: 20px 0;
}

.qr-code-container canvas, .qr-code-container img {
    margin: 0 auto;
}

.template-item {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid #667eea;
}

.template-preview {
    background: #e9ecef;
    padding: 10px;
    border-radius: 5px;
    font-style: italic;
    margin: 10px 0;
}

@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        text-align: center;
    }
    .nav-tabs {
        flex-wrap: wrap;
    }
    .nav-tab {
        font-size: 12px;
        padding: 8px 16px;
    }
    .modal-content {
        width: 95%;
        margin: 2% auto;
    }
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.drop-zone {
    min-height: 50px;
    border: 2px dashed #ccc;
    border-radius: 5px;
    margin: 5px 0;
    transition: all 0.3s ease;
}

.drop-zone.drag-over {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.1);
}

/* --- NEW INVITATION BUILDER STYLES --- */
.invitation-builder-grid { 
    display: grid; 
    grid-template-columns: var(--sidebar-width, 400px) 1fr 380px; 
    gap: 20px; 
    position: relative;
}

.builder-column { 
    background-color: #f8f9fa; 
    border-radius: 10px; 
    padding: 20px; 
    height: 1000px; 
    overflow-y: auto; 
    border: 1px solid #e9ecef; 
}

/* Resizable sidebar */
.builder-column:first-child {
    position: relative;
    min-width: 320px;
    max-width: 600px;
}

.sidebar-resize-handle {
    position: absolute;
    top: 0;
    right: -10px;
    width: 20px;
    height: 100%;
    cursor: col-resize;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-resize-handle::before {
    content: '';
    width: 4px;
    height: 40px;
    background: #cbd5e1;
    border-radius: 2px;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sidebar-resize-handle:hover::before {
    background: #667eea;
}

.sidebar-resize-handle:active::before {
    background: #5a67d8;
}

/* Visual feedback during resize */
.invitation-builder-grid.resizing {
    user-select: none;
}

.invitation-builder-grid.resizing .builder-column:not(:first-child) {
    pointer-events: none;
}

/* Responsive adjustments for sidebar */
@media (max-width: 1200px) {
    .invitation-builder-grid {
        grid-template-columns: var(--sidebar-width, 350px) 1fr 320px;
    }
    
    .builder-column:first-child {
        min-width: 300px;
        max-width: 500px;
    }
}

@media (max-width: 768px) {
    .invitation-builder-grid {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
        gap: 15px;
    }
    
    .sidebar-resize-handle {
        display: none;
    }
    
    .builder-column:first-child {
        min-width: unset;
        max-width: unset;
    }
    
    .builder-column {
        height: 400px;
    }
}
#builder-sidebar h4 { margin-top: 20px; margin-bottom: 15px; }
#builder-sidebar .form-group input[type="color"] { padding: 0; height: 40px; }
#builder-component-palette .component-item { background: #fff; border: 1px solid #ccc; border-radius: 8px; padding: 12px; margin-bottom: 10px; cursor: grab; display: flex; align-items: center; gap: 10px; }
#builder-canvas { background-color: #e9ecef; padding: 10px; }
.canvas-placeholder { text-align: center; color: #888; margin-top: 50px; }
.canvas-slide-item { background: #fff; border: 1px solid #ddd; border-radius: 8px; padding: 15px; margin-bottom: 10px; cursor: move; position: relative; }
.slide-item-header { font-weight: bold; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid #eee; }

/* Drag & Drop Visual Indicator */
.drop-indicator {
    height: 4px;
    background-color: #4f46e5;
    border-radius: 2px;
    margin: 4px 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* For Guest Import Hint */
.import-hint {
    background-color: #eef2f7;
    border: 1px solid #d1dce5;
    border-left: 4px solid #667eea;
    padding: 15px;
    margin: 20px 0;
    border-radius: 8px;
    font-size: 0.9em;
}

.import-hint p {
    margin: 5px 0;
    color: #444;
}

.import-hint code {
    background-color: #dbe1e8;
    padding: 2px 6px;
    border-radius: 4px;
    color: #2d3748;
}

/* ========================================================================= */
/* Device Preview & Swiper Styling                                           */
/* ========================================================================= */
#builder-preview-container { 
    background-color: #333; /* This was the "dark mode" background */
    padding: 20px; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    overflow: hidden;
}
#builder-preview-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 0;
}
/* ========================================================================= */
/* FIX: Builder Preview Controls Visibility & Style                        */
/* ========================================================================= */

/* This new container style creates the semi-transparent "pill" background */
.preview-controls {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    padding: 8px 12px;
    border-radius: 25px;
}

/* Make the counter text white to contrast with the new dark background */
.preview-controls #preview-slide-counter {
    color: #fff;
    font-weight: bold;
}

/* Style the buttons to look good on the new dark background */
.preview-controls .btn {
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    box-shadow: none;
    width: 32px; /* Make buttons circular */
    height: 32px;
    padding: 0;
    line-height: 32px;
    text-align: center;
}

.preview-controls .btn:hover {
    background: #fff;
    transform: none; /* Disable hover transform for these specific buttons */
}
#device-selector {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-bottom: 15px;
}
.device-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    padding: 6px 12px;
    font-size: 1.2em;
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.device-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}
.device-btn.active {
    background-color: #fff;
    color: #333;
}
#builder-preview {
    flex-shrink: 0;
    transition: all 0.4s ease;
    transform-origin: center center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #fff; /* Fixes "dark mode" flash by setting a default bg */
    position: relative;
    overflow: hidden;
}

/* iPhone Preset */
#builder-preview.device-iphone {
    width: 393px;
    height: 852px;
    border: 12px solid #111;
    border-radius: 50px;
    transform: scale(0.64);
}
#builder-preview.device-iphone::before {
    content: '';
    position: absolute;
    top: -2px; left: 50%;
    transform: translateX(-50%);
    width: 140px; height: 28px;
    background-color: #111;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
    z-index: 10;
}

/* Samsung Preset */
#builder-preview.device-samsung {
    width: 412px;
    height: 892px;
    border: 10px solid #111;
    border-radius: 24px;
    transform: scale(0.61);
}
#builder-preview.device-samsung::before {
    content: '';
    position: absolute;
    top: 8px; left: 50%;
    transform: translateX(-50%);
    width: 6px; height: 6px;
    background-color: #2b2b2b;
    border-radius: 50%;
    z-index: 10;
}

/* Desktop Preset - FIX: Corrected scaling and background */
#builder-preview.device-desktop {
    width: 900px;
    height: 540px; /* Adjusted for better aspect ratio */
    border: 1px solid #555;
    border-radius: 8px;
    transform: scale(0.60); /* Adjusted for better fit */
}
#builder-preview.device-desktop::before {
    content: none;
}

/* Swiper Styling */
#invitation-wrapper, #invitation-wrapper body {
    height: 100%;
    overflow: hidden;
}

/* Desktop: let container be positioned by flexbox */
@media (min-width: 769px) {
    #invitation-wrapper .swiper-container {
        position: relative;
    }
}

/* Mobile: fixed positioning for full screen */
@media (max-width: 768px) {
    #invitation-wrapper .swiper-container {
        position: fixed;
        top: 0;
        left: 0;
    }
}

@media (max-width: 768px) {
    html, body {
        position: relative;
        height: 100%;
        overflow: hidden;
    }

    .swiper-container {
        position: fixed;
        top: 0;
        left: 0;
    }
}

.swiper-container {
    width: 100%;
    height: 100%;
}
.swiper-slide {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    box-sizing: border-box;
    padding: 40px;
    overflow: hidden;
}
.swiper-slide.has-bg-image {
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.6);
}
/* ========================================================================= */
/* FIX: Device Preview & Invitation Layout Corrections                     */
/* ========================================================================= */

/* Fixes the "dark mode" flash by changing the container background */
#builder-preview-container { 
    background-color: #f0f2f5; /* Changed from #333 to a light gray */
}

/* Base style for the preview frame */
#builder-preview {
    flex-shrink: 0;
    transition: all 0.4s ease;
    transform-origin: center center;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    background: #fff;
    position: relative;
    overflow: hidden;
}

/* Ensure swiper containers in preview take full space */
#builder-preview .swiper-container {
    width: 100% !important;
    height: 100% !important;
}

#builder-preview .swiper-wrapper {
    width: 100% !important;
    height: 100% !important;
}

#builder-preview .swiper-slide {
    width: 100% !important;
    height: 100% !important;
}

/* FIX: Corrected styles for the desktop/web preview */
#builder-preview.device-desktop {
    width: 900px;
    height: 540px;
    border: 1px solid #555;
    border-radius: 8px;
    transform: scale(0.60);
}
#builder-preview.device-desktop::before {
    content: none;
}

.slide-content-title h2, .slide-content-title p, .slide-content-title h1,
.slide-content-story h3, .slide-content-story p,
.slide-content-events h3, .slide-content-events p, .slide-content-events strong,
.slide-content-text p {
    line-height: 1.6 !important;
}
.bg-dark-shadow::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,var(--shadow-intensity, 0.45));
    z-index: 1;
    pointer-events: none;
    border-radius: inherit;
}

/* Ensure content blocks are rendered above the shadow overlay */
.bg-dark-shadow .preview-block {
    z-index: 3;
}



/* Icon Picker Modal */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    max-height: 400px;
    overflow-y: auto;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    margin: 20px 0;
}

.icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    font-size: 2em;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    margin: 0 auto;
}

.icon-option:hover {
    border-color: #667eea;
    background: #f0f4ff;
    transform: scale(1.05);
}

.icon-option.selected {
    border-color: #667eea;
    background: #667eea;
    color: white;
}

/* Icon Display in Builder */
.slide-content-icon .icon-display {
    transition: all 0.2s ease;
}

.slide-content-icon .icon-display:hover {
    transform: scale(1.1);
}

/* Responsive Icon Grid */
@media (max-width: 768px) {
    .icon-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 10px;
    }
    
    .icon-option {
        width: 50px;
        height: 50px;
        font-size: 1.5em;
    }
}
.mute-button {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1001; /* Ensures it's above other content */
    background-color: rgba(0, 0, 0, 0.4);
    color: white;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.mute-button:hover {
    background-color: rgba(0, 0, 0, 0.6);
}

.mute-button:active {
    transform: scale(0.95);
}
/* Find this rule and change align-items to flex-start and add overflow-y */
#builder-preview-wrapper {
    flex-grow: 1;
    display: flex;
    align-items: flex-start; /* Changed from 'center' to 'flex-start' */
    justify-content: center;
    width: 100%;
    min-height: 0;
    overflow-y: auto; /* Added */
}

/* You can add this to the end of your file for better scrollbar styling */
#builder-preview-wrapper::-webkit-scrollbar {
    width: 10px;
}

#builder-preview-wrapper::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 5px;
}

#builder-preview-wrapper::-webkit-scrollbar-thumb {
    background-color: #bdc3c7;
    border-radius: 5px;
}

/* ========================================
   PROFESSIONAL INVITATION BUILDER STYLES
   ======================================== */

/* Builder Header */
.builder-header {
    text-align: center;
    margin-bottom: 30px;
    padding: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.builder-header h2 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 8px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.builder-header p {
    font-size: 1rem;
    opacity: 0.9;
    margin: 0;
    font-weight: 300;
}

/* Settings Cards */
.settings-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    margin-bottom: 20px;
    overflow: hidden;
    border: 1px solid rgba(102, 126, 234, 0.1);
    transition: all 0.3s ease;
    min-width: 0; /* Prevents overflow */
}

.settings-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    transform: translateY(-2px);
}

.primary-card {
    border-left: 4px solid #667eea;
}

.collapsible-card {
    border-left: 4px solid #95a5a6;
}

/* Card Headers */
.card-header {
    padding: 20px 25px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    position: relative;
}

.clickable {
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.clickable:hover {
    background: #e9ecef;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

.card-icon {
    font-size: 1.3em;
    display: inline-block;
    width: 24px;
    text-align: center;
}

/* Card Content */
.card-content {
    padding: 25px;
    min-width: 0; /* Prevents overflow */
}

/* Ensure form controls have proper spacing in customizer */
.customizer-controls .form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

.customizer-controls .form-group {
    min-width: 0; /* Prevents overflow */
}

/* Collapse Functionality */
.collapse-indicator {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
}

.collapse-indicator .chevron {
    font-size: 1.2em;
    color: #6c757d;
    transition: transform 0.3s ease;
}

.collapsed .collapse-indicator .chevron {
    transform: rotate(-90deg);
}

/* Form Elements */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

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

.form-group.half-width {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 8px;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 1.1em;
    opacity: 0.7;
}

/* Modern Form Controls */
.modern-input, .modern-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
    font-family: inherit;
}

.modern-input:focus, .modern-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.modern-input:hover, .modern-select:hover {
    border-color: #bdc3c7;
}

/* Color Picker */
.color-picker {
    height: 50px;
    padding: 5px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.color-picker:hover, .color-picker:focus {
    border-color: #667eea;
}

/* Modern Slider */
.modern-slider {
    width: 100%;
    height: 6px;
    border-radius: 5px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
    margin: 15px 0;
}

.modern-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
}

.modern-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: -10px;
}

/* File Upload Modern */
.file-upload-modern {
    position: relative;
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f8f9fa;
    cursor: pointer;
}

.file-upload-modern:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    top: 0;
    left: 0;
}

.file-upload-text {
    pointer-events: none;
    color: #6c757d;
    font-weight: 500;
}

/* Modern Buttons */
.btn-modern {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-modern:before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.3s, height 0.3s;
}

.btn-modern:hover:before {
    width: 300px;
    height: 300px;
}

.btn-modern.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-modern.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-modern.btn-secondary {
    background: #6c757d;
    color: white;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.btn-modern.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Content Sections */
.content-section {
    padding: 20px 0;
    border-bottom: 1px solid #f1f3f4;
    margin-bottom: 20px;
}

.content-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.content-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-icon {
    font-size: 1.2em;
    opacity: 0.8;
}

.section-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Toggle Switches */
.toggle-option {
    padding: 20px 0;
    border-bottom: 1px solid #f1f3f4;
}

.toggle-option:last-child {
    border-bottom: none;
}

.toggle-header {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    margin-bottom: 15px;
}

.toggle-switch {
    flex-shrink: 0;
    margin-top: 5px;
}

.toggle-input {
    display: none;
}

.toggle-label {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    background: #ccc;
    border-radius: 24px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.toggle-label:after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-input:checked + .toggle-label {
    background: #667eea;
}

.toggle-input:checked + .toggle-label:after {
    transform: translateX(26px);
}

.toggle-info h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.toggle-info p {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.4;
}

/* Form Hints */
.form-hint {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
    margin-top: 5px;
    line-height: 1.4;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .builder-header {
        padding: 20px;
        margin-bottom: 20px;
    }
    
    .builder-header h2 {
        font-size: 1.5rem;
    }
    
    .card-content {
        padding: 20px;
    }
    
    .settings-card {
        margin-bottom: 15px;
    }
}

/* Animation Classes */
.fade-in {
    animation: fadeIn 0.3s ease;
}

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

.slide-down {
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 1000px;
    }
}

/* Enhanced Select Dropdown */
.modern-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

/* ====================================
   BASIC DESIGN IMPROVEMENTS
   ==================================== */
.basic-design-content {
    padding: 20px !important;
}

.design-section {
    margin-bottom: 25px;
    padding: 15px;
    background: #fafbfc;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.design-section:last-child {
    margin-bottom: 0;
}

.section-title {
    margin: 0 0 15px 0;
    font-size: 0.9em;
    font-weight: 600;
    color: #2d3748;
    display: flex;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.section-icon {
    margin-right: 8px;
    font-size: 1.1em;
}

.design-section .form-row {
    margin-bottom: 15px;
}

.design-section .form-row:last-child {
    margin-bottom: 0;
}

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

.design-section .form-group:last-child {
    margin-bottom: 0;
}

/* Better spacing for form elements in basic design */
.basic-design-content .form-control {
    margin-bottom: 0;
}

.basic-design-content .color-picker {
    width: 100%;
    max-width: 200px;
    height: 40px;
    border-radius: 6px;
    border: 2px solid #e2e8f0;
    cursor: pointer;
}

.basic-design-content .color-picker:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* ====================================
   SETTINGS LIST STYLE
   ==================================== */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.setting-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.setting-item:last-child {
    border-bottom: none;
}

.setting-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-right: 15px;
}

.setting-label {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.9em;
    margin-bottom: 2px;
}

.setting-description {
    font-size: 0.8em;
    color: #718096;
    line-height: 1.2;
}

.setting-control {
    min-width: 140px;
    flex-shrink: 0;
}

.compact-select,
.compact-input {
    width: 100%;
    min-width: 140px;
    height: 36px;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 0.9em;
    background: white;
    transition: all 0.2s ease;
}

.compact-select:focus,
.compact-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.compact-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 8px center;
    background-repeat: no-repeat;
    background-size: 14px;
    padding-right: 32px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    cursor: pointer;
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .setting-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .setting-info {
        margin-right: 0;
        margin-bottom: 5px;
    }
    
    .setting-control {
        width: 100%;
        min-width: auto;
    }
    
    .compact-select,
    .compact-input {
        min-width: auto;
    }
}

/* ====================================
   COMPACT BACKGROUND CONTROLS
   ==================================== */
.color-picker-compact {
    width: 60px;
    height: 36px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    padding: 2px;
    background: white;
    transition: all 0.2s ease;
}

.color-picker-compact:hover {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.file-upload-compact {
    position: relative;
    display: inline-block;
}

.file-input-compact {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.file-label-compact {
    display: inline-block;
    padding: 8px 16px;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9em;
    color: #4a5568;
    transition: all 0.2s ease;
    min-width: 100px;
    text-align: center;
}

.file-label-compact:hover {
    background: #edf2f7;
    border-color: #667eea;
    color: #667eea;
}

.file-input-compact:focus + .file-label-compact {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Video tips styling */
.video-tips {
    margin-top: 10px;
    padding: 12px;
    background: #f8f9fa;
    border-left: 3px solid #17a2b8;
    border-radius: 4px;
}

.video-tips .form-hint {
    color: #495057;
    line-height: 1.4;
}

.video-tips a {
    color: #17a2b8;
    text-decoration: none;
}

.video-tips a:hover {
    text-decoration: underline;
}

/* ====================================
   VIDEO BACKGROUND SUPPORT
   ==================================== */
.swiper-slide {
    position: relative;
    overflow: hidden;
    /* Mobile-optimized background positioning */
    background-attachment: scroll; /* Better mobile performance */
}

/* ====================================
   MOBILE BACKGROUND IMAGE OPTIMIZATION
   ==================================== */
@media (max-width: 768px) {
    .swiper-slide.has-bg-image {
        /* Use smart background sizing for mobile */
        background-size: cover;
        background-position: center center;
        background-repeat: no-repeat;
        /* Ensure full viewport coverage */
        min-height: 100vh;
        min-height: 100dvh;
    }
    
    /* For very tall mobile screens (portrait), prevent bottom cutoff */
    @media (orientation: portrait) and (min-aspect-ratio: 9/21) {
        .swiper-slide.has-bg-image {
            background-size: cover;
            background-position: center center;
        }
    }
    
    /* For landscape mobile screens, use cover to fill width */
    @media (orientation: landscape) {
        .swiper-slide.has-bg-image {
            background-size: cover;
            background-position: center center;
        }
    }
    
    /* Additional padding reduction for mobile to maximize background visibility */
    .swiper-slide {
        padding: 20px;
    }
    
    /* Ensure mobile browsers don't crop backgrounds due to address bar */
    .swiper-slide.has-bg-image {
        background-attachment: scroll !important;
        /* Use viewport units that account for mobile browser UI */
        min-height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
        min-height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    }
    
    /* For devices with very small screens, prioritize content visibility */
    @media (max-height: 600px) {
        .swiper-slide.has-bg-image {
            background-size: cover;
            background-position: center center;
        }
        
        .swiper-slide {
            padding: 15px;
        }
    }
    
    /* Builder preview should use cover */
    #builder-preview .swiper-slide.has-bg-image {
        background-size: cover !important;
    }
    
    /* Height-first background sizing for desktop guest/invitation views only */
    @media only screen and (min-width: 769px) {
        body:not(.builder-page) .swiper-slide.has-bg-image,
        .invitation-container .swiper-slide.has-bg-image,
        #invitation-wrapper .swiper-slide.has-bg-image {
            background-size: auto 100% !important; /* Height 100%, width auto */
        }
    }
    
    /* Mobile: use cover with consistent positioning */
    @media only screen and (max-width: 768px) {
        body:not([class*="builder"]) .swiper-slide.has-bg-image,
        .invitation-container .swiper-slide.has-bg-image {
            background-size: cover !important;
            background-position: center center !important; /* Use center positioning to prevent cumulative shifting */
        }
    }
}

.swiper-slide.has-bg-video {
    position: relative;
}

.bg-video {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    z-index: -1 !important;
    pointer-events: none !important;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Ensure video is visible even with browser restrictions */
.swiper-slide.has-bg-video .bg-video {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.swiper-slide.has-bg-video .slide-content,
.swiper-slide.has-bg-video .slide-content * {
    position: relative;
    z-index: 1;
}

/* Ensure video backgrounds work with existing shadow overlay */
.swiper-slide.has-bg-video.bg-dark-shadow::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, var(--shadow-intensity, 0.3));
    z-index: 0;
    pointer-events: none;
}

/* Link Sharing Styles */
.sharing-preview-card {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin-top: 15px;
}

.sharing-mock-preview {
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    background: white;
    max-width: 400px;
    margin-top: 10px;
}

.sharing-preview-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid #e0e0e0;
}

.sharing-preview-placeholder {
    font-size: 24px;
    color: #999;
}

.sharing-preview-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sharing-preview-content {
    padding: 12px;
    flex: 1;
    min-width: 0;
}

.sharing-preview-title {
    margin: 0 0 5px 0;
    font-size: 14px;
    font-weight: 600;
    color: #1877f2;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sharing-preview-description {
    margin: 0 0 8px 0;
    font-size: 12px;
    color: #65676b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sharing-preview-url {
    font-size: 11px;
    color: #8a8d91;
    text-transform: uppercase;
    font-weight: 500;
}

/* ====================================
   START PAGE CUSTOMIZER STYLES
   ==================================== */

/* Start Page Container */
.start-page-container {
    transition: all 0.5s ease;
    position: relative;
    overflow: hidden;
}

.start-page-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    opacity: var(--bg-opacity, 1);
    filter: blur(var(--bg-blur, 0px));
    z-index: -1;
    transition: all 0.3s ease;
}

.start-page-content {
    position: relative;
    z-index: 1;
}

/* Start Page Buttons */
.start-btn {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.start-btn.btn-size-small {
    padding: 8px 16px;
    font-size: 12px;
}

.start-btn.btn-size-medium {
    padding: 12px 30px;
    font-size: 16px;
}

.start-btn.btn-size-large {
    padding: 16px 40px;
    font-size: 18px;
}

.start-btn.btn-shape-square {
    border-radius: 4px;
}

.start-btn.btn-shape-rounded {
    border-radius: 25px;
}

.start-btn.btn-shape-pill {
    border-radius: 50px;
}

.start-btn.btn-shape-sharp {
    border-radius: 0;
}

.start-btn.btn-style-solid {
    background: var(--btn-color-1, #667eea) !important;
}

.start-btn.btn-style-outline {
    background: transparent !important;
    border: 2px solid var(--btn-color-1, #667eea) !important;
    color: var(--btn-color-1, #667eea) !important;
}

.start-btn.btn-style-glass {
    background: rgba(255, 255, 255, 0.2) !important;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    color: white !important;
}

/* Customizer Modal */
.customizer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    min-height: 70vh;
    max-height: 80vh;
}

.customizer-controls {
    overflow-y: auto;
    max-height: 70vh;
    padding-right: 10px;
    min-width: 0; /* Prevents overflow issues */
}

.customizer-preview {
    position: sticky;
    top: 0;
    height: fit-content;
    min-width: 300px;
}

.preview-header {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px 8px 0 0;
    border-bottom: 1px solid #e9ecef;
}

.preview-header h3 {
    margin: 0 0 5px 0;
    color: #2c3e50;
    font-size: 1.1rem;
}

.preview-header p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.start-page-preview {
    border: 1px solid #e9ecef;
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    background: #f0f2f5;
    min-height: 400px;
}

.preview-container {
    position: relative;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
}

.preview-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    width: 280px;
    text-align: center;
}

.preview-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.preview-header-section h1 {
    font-size: 1.2rem;
    margin: 0;
    color: #667eea;
}

.preview-btn-small {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    color: #667eea;
}

.preview-subtitle {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 20px;
}

.preview-buttons-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 15px;
}

.preview-buttons-secondary {
    display: flex;
    justify-content: center;
    gap: 8px;
}

.preview-btn {
    border: none;
    padding: 8px 12px;
    border-radius: 15px;
    font-size: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.preview-btn.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.preview-btn.secondary {
    background: #6c757d;
    color: white;
    font-size: 9px;
    padding: 6px 10px;
}

.preview-btn.info {
    background: #17a2b8;
    color: white;
    font-size: 9px;
    padding: 6px 10px;
}

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

/* Icon Upload Display */
.custom-icon-display {
    width: 32px;
    height: 32px;
    object-fit: contain;
    vertical-align: middle;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .customizer-grid {
        grid-template-columns: 3fr 2fr;
        gap: 20px;
    }
    
    .customizer-preview .preview-content {
        width: 250px;
        padding: 25px;
    }
}

@media (max-width: 1200px) {
    .customizer-grid {
        grid-template-columns: 2fr 1fr;
        gap: 20px;
    }
    
    .customizer-preview {
        min-width: 280px;
    }
    
    .preview-content {
        width: 220px;
        padding: 20px;
    }
}

@media (max-width: 900px) {
    .customizer-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .customizer-preview {
        position: static;
        order: -1;
        min-width: auto;
    }
    
    .preview-container {
        min-height: 300px;
    }
    
    .preview-content {
        width: 200px;
        padding: 15px;
    }
    
    .customizer-controls {
        max-height: none;
        padding-right: 0;
    }
}

@media (max-width: 768px) {
    .modal-content.large-modal {
        width: 95%;
        max-width: none;
        margin: 2% auto;
        padding: 20px;
    }
    
    .customizer-grid {
        gap: 15px;
    }
    
    .preview-content {
        width: 180px;
        padding: 12px;
    }
}

/* Enhanced Button Styles */
.btn-gradient-custom {
    background: linear-gradient(135deg, var(--btn-color-1, #667eea) 0%, var(--btn-color-2, #764ba2) 100%) !important;
}

/* Icon Selection */
.icon-option.custom-icon {
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Animation for smooth transitions */
.start-page-container,
.start-btn,
#startPageTitle,
#startPageIcon {
    transition: all 0.3s ease;
}

/* Background overlay for better text readability */
.start-page-container.has-bg-image .start-page-content {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    backdrop-filter: blur(10px);
}

/* ====================================
   LOADING SCREEN STYLES
   ==================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.fade-out {
    opacity: 0;
    visibility: hidden;
}

.loading-container {
    text-align: center;
    color: white;
    max-width: 400px;
    padding: 40px 20px;
}

.loading-logo {
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease;
}

.loading-icon {
    font-size: 4rem;
    display: block;
    margin-bottom: 15px;
    animation: pulse 2s infinite;
}

.loading-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
    letter-spacing: 2px;
}

.loading-spinner {
    margin: 30px 0;
    animation: fadeInUp 0.8s ease 0.2s both;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    margin: 0 auto;
    animation: spin 1s linear infinite;
}

.loading-text {
    animation: fadeInUp 0.8s ease 0.4s both;
}

.loading-message {
    font-size: 1.1rem;
    margin-bottom: 25px;
    opacity: 0.9;
    font-weight: 300;
}

.loading-progress {
    margin: 20px 0;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar {
    flex: 1;
    height: 6px;
    background: rgba(255,255,255,0.2);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #fff 0%, rgba(255,255,255,0.8) 100%);
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
    box-shadow: 0 0 10px rgba(255,255,255,0.5);
}

.progress-text {
    font-size: 0.9rem;
    font-weight: 600;
    min-width: 35px;
}

.loading-status {
    font-size: 0.9rem;
    opacity: 0.8;
    margin: 15px 0 0 0;
    font-weight: 300;
    min-height: 20px;
}

/* Loading button states */
.loading-disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
    position: relative;
}

.loading-disabled::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(1px);
    border-radius: inherit;
}

/* Loading animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes pulse {
    0%, 100% { 
        transform: scale(1);
        opacity: 1;
    }
    50% { 
        transform: scale(1.05);
        opacity: 0.8;
    }
}

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

/* Button loading state transition */
.start-btn {
    transition: all 0.3s ease;
}

.start-btn:not(.loading-disabled) {
    animation: buttonReady 0.5s ease;
}

@keyframes buttonReady {
    from {
        opacity: 0.6;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive loading screen */
@media (max-width: 768px) {
    .loading-container {
        padding: 30px 15px;
        max-width: 350px;
    }
    
    .loading-icon {
        font-size: 3rem;
    }
    
    .loading-title {
        font-size: 2rem;
    }
    
    .loading-message {
        font-size: 1rem;
    }
    
    .spinner {
        width: 40px;
        height: 40px;
    }
}

/* ================================================
   TEXT FORMATTING CONTROLS
   ================================================ */

.text-formatting-controls {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.btn-format {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 8px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 40px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-format:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.btn-format.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.btn-format.active:hover {
    background: #0056b3;
    border-color: #0056b3;
}

.btn-format strong,
.btn-format em,
.btn-format u {
    font-size: 14px;
    font-weight: bold;
}

.btn-format em {
    font-style: italic;
    font-weight: normal;
}

.btn-format u {
    text-decoration: underline;
    font-weight: normal;
}

.btn-clear {
    background: #f8f9fa;
    color: #6c757d;
    font-size: 11px;
    padding: 6px 10px;
}

.btn-clear:hover {
    background: #e9ecef;
    color: #495057;
}

.btn-clear.active {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* Text formatting in content editable elements */
[contenteditable="true"] b,
[contenteditable="true"] strong {
    font-weight: bold;
}

[contenteditable="true"] i,
[contenteditable="true"] em {
    font-style: italic;
}

[contenteditable="true"] u {
    text-decoration: underline;
}

/* Selection styling for better UX */
[contenteditable="true"]:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
}

/* Formatting indicator in preview mode */
.formatted-text {
    position: relative;
}

.formatting-indicator {
    position: absolute;
    top: -20px;
    right: 0;
    background: rgba(0, 123, 255, 0.8);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.formatted-text:hover .formatting-indicator {
    opacity: 1;
}

/* Responsive formatting controls */
@media (max-width: 768px) {
    .text-formatting-controls {
        gap: 6px;
    }
    
    .btn-format {
        padding: 6px 10px;
        min-width: 36px;
        height: 32px;
        font-size: 12px;
    }
    
    .btn-clear {
        font-size: 10px;
        padding: 4px 8px;
    }
}

/* ================================================
   ENHANCED ICON PICKER
   ================================================ */

.icon-picker-modal {
    max-width: 700px;
    max-height: 90vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.icon-search-container {
    position: relative;
    margin: 15px 0;
}

.icon-search-container input {
    width: 100%;
    padding: 12px 40px 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.icon-search-container input:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #666;
}

.icon-category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.icon-tab {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 20px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    white-space: nowrap;
    color: #666;
}

.icon-tab:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.icon-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fafafa;
}

.icon-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 24px;
    transition: all 0.2s ease;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.icon-option:hover {
    border-color: #007bff;
    transform: scale(1.1);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    z-index: 2;
}

.icon-option.selected {
    border-color: #28a745;
    background: #e8f5e9;
}

.icon-picker-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e0e0e0;
}

.icon-count {
    font-size: 12px;
    color: #666;
    font-weight: 500;
}

/* Enhanced scrollbar for icon grid */
.icon-grid::-webkit-scrollbar {
    width: 8px;
}

.icon-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.icon-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.icon-grid::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

/* Responsive design for icon picker */
@media (max-width: 768px) {
    .icon-picker-modal {
        max-width: 95vw;
        margin: 10px;
    }
    
    .icon-category-tabs {
        gap: 3px;
    }
    
    .icon-tab {
        padding: 6px 12px;
        font-size: 11px;
    }
    
    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(45px, 1fr));
        gap: 8px;
        max-height: 300px;
    }
    
    .icon-option {
        width: 45px;
        height: 45px;
        font-size: 20px;
    }
    
    .icon-search-container input {
        padding: 10px 35px 10px 12px;
        font-size: 13px;
    }
}

/* Animation for icon loading */
@keyframes iconFadeIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.icon-option {
    animation: iconFadeIn 0.3s ease forwards;
}

/* Search result highlighting */
.icon-option.search-match {
    border-color: #ffc107;
    background: #fff8e1;
}

/* Category-specific styling */
.icon-tab[data-category="religious"].active {
    background: #6f42c1;
    border-color: #6f42c1;
}

.icon-tab[data-category="love"].active {
    background: #e91e63;
    border-color: #e91e63;
}

.icon-tab[data-category="wedding"].active {
    background: #ff6b9d;
    border-color: #ff6b9d;
}

.icon-tab[data-category="celebration"].active {
    background: #ff9800;
    border-color: #ff9800;
}

.icon-tab[data-category="nature"].active {
    background: #4caf50;
    border-color: #4caf50;
}

.icon-tab[data-category="decorative"].active {
    background: #9c27b0;
    border-color: #9c27b0;
}

/* Button Customization Modal Styles */
.button-customizer-modal {
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
}

.button-preview-container {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.button-preview-wrapper {
    margin-top: 15px;
}

.btn-customizable {
    padding: 12px 24px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #667eea;
    color: white;
    min-width: 150px;
}

.customizer-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.customizer-section:last-child {
    border-bottom: none;
}

.customizer-section h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
}

/* Style Options */
.style-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
}

.style-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.style-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.style-option input[type="radio"] {
    display: none;
}

.style-option input[type="radio"]:checked + .style-preview {
    border-color: #667eea;
    transform: scale(1.1);
}

.style-option input[type="radio"]:checked ~ span {
    color: #667eea;
    font-weight: 600;
}

.style-preview {
    width: 40px;
    height: 20px;
    border-radius: 4px;
    margin-bottom: 8px;
    border: 2px solid #ddd;
    transition: all 0.3s ease;
}

.style-preview.solid {
    background: #667eea;
}

.style-preview.gradient {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.style-preview.outline {
    background: transparent;
    border: 2px solid #667eea;
}

.style-preview.glass {
    background: rgba(102, 126, 234, 0.2);
    border: 1px solid rgba(102, 126, 234, 0.3);
    backdrop-filter: blur(10px);
}

/* Shape Options */
.shape-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.shape-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shape-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.shape-option input[type="radio"] {
    display: none;
}

.shape-option input[type="radio"]:checked + .shape-preview {
    background: #667eea;
}

.shape-option input[type="radio"]:checked ~ span {
    color: #667eea;
    font-weight: 600;
}

.shape-preview {
    width: 40px;
    height: 20px;
    background: #ddd;
    margin-bottom: 8px;
    transition: all 0.3s ease;
}

.shape-preview.rounded {
    border-radius: 5px;
}

.shape-preview.square {
    border-radius: 0;
}

.shape-preview.pill {
    border-radius: 20px;
}

/* Size Options */
.size-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.size-option {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.size-option:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.size-option input[type="radio"] {
    display: none;
}

.size-option input[type="radio"]:checked ~ span {
    color: #667eea;
    font-weight: 600;
}

/* Color Options */
.color-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
}

.color-group {
    display: flex;
    flex-direction: column;
}

.color-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.color-group input[type="color"] {
    width: 100%;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 5px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.color-group input[type="color"]:hover {
    border-color: #667eea;
}

/* Preset Colors */
.preset-colors {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.preset-color {
    width: 40px;
    height: 40px;
    border: 2px solid #e9ecef;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.preset-color:hover {
    transform: scale(1.1);
    border-color: #333;
}

.preset-color[data-color1="#667eea"] {
    background: linear-gradient(135deg, #667eea, #764ba2);
}

.preset-color[data-color1="#f093fb"] {
    background: linear-gradient(135deg, #f093fb, #f5576c);
}

.preset-color[data-color1="#4facfe"] {
    background: linear-gradient(135deg, #4facfe, #00f2fe);
}

.preset-color[data-color1="#43e97b"] {
    background: linear-gradient(135deg, #43e97b, #38f9d7);
}

.preset-color[data-color1="#fa709a"] {
    background: linear-gradient(135deg, #fa709a, #fee140);
}

.preset-color[data-color1="#a8edea"] {
    background: linear-gradient(135deg, #a8edea, #fed6e3);
}

.preset-color[data-color1="#ff9a9e"] {
    background: linear-gradient(135deg, #ff9a9e, #fecfef);
}

.preset-color[data-color1="#ff8a80"] {
    background: linear-gradient(135deg, #ff8a80, #ffab91);
}

.button-customizer-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Button Customization Classes */
.btn-style-solid {
    background: var(--btn-bg-color, #667eea) !important;
    border: none;
}

.btn-style-gradient {
    background: linear-gradient(135deg, var(--btn-color-1, #667eea), var(--btn-color-2, #764ba2)) !important;
    border: none;
}

.btn-style-outline {
    background: transparent !important;
    border: 2px solid var(--btn-bg-color, #667eea) !important;
    color: var(--btn-bg-color, #667eea) !important;
}

.btn-style-glass {
    background: rgba(102, 126, 234, 0.2) !important;
    border: 1px solid rgba(102, 126, 234, 0.3) !important;
    backdrop-filter: blur(10px);
    color: var(--btn-text-color, #333) !important;
}

.btn-shape-rounded {
    border-radius: 5px !important;
}

.btn-shape-square {
    border-radius: 0 !important;
}

.btn-shape-pill {
    border-radius: 25px !important;
}

.btn-size-small {
    padding: 8px 16px !important;
    font-size: 14px !important;
}

.btn-size-medium {
    padding: 12px 24px !important;
    font-size: 16px !important;
}

.btn-size-large {
    padding: 16px 32px !important;
    font-size: 18px !important;
}

/* Customize Button */
.customize-button {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    font-size: 14px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.customize-button:hover {
    background: #667eea;
    color: white;
    transform: scale(1.1);
}

/* Save Invitation Button in Header */
.save-invitation-btn {
    padding: 12px 24px !important;
    font-weight: 600;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.2);
    transition: all 0.3s ease;
    min-width: 140px;
    font-size: 16px;
    margin-top: 5px;
    white-space: nowrap;
}

.save-invitation-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.save-invitation-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Location Customization Modal Styles */
.location-customizer-modal {
    max-width: 700px;
    width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 25px;
}

.location-preview-container {
    text-align: center;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 2px dashed #dee2e6;
}

.location-preview-wrapper {
    margin-top: 15px;
}

.location-card-preview {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    max-width: 300px;
    margin: 0 auto;
    transition: all 0.3s ease;
}

.location-card-preview .location-icon {
    font-size: 2em;
    margin-bottom: 10px;
}

.location-card-preview h3 {
    margin: 10px 0;
    color: #333;
}

.location-card-preview p {
    margin: 10px 0;
    color: #666;
}

.location-buttons-preview {
    margin-top: 15px;
}

.location-redirect-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 5px;
    background: #667eea;
    color: white;
    cursor: pointer;
    margin: 5px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.location-redirect-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

/* Theme Options */
.theme-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.theme-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
}

.theme-option input[type="radio"] {
    display: none;
}

.theme-preview {
    width: 100px;
    height: 80px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 10px;
    text-align: center;
}

.theme-preview:hover {
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.theme-option input[type="radio"]:checked + .theme-preview {
    border-color: #667eea;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    transform: scale(1.05);
}

.theme-icon {
    font-size: 1.5em;
    margin-bottom: 5px;
}

.theme-preview span {
    font-size: 12px;
    font-weight: 500;
    color: #333;
}

/* Theme-specific styles */
.theme-preview.classic {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
}

.theme-preview.modern {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.theme-preview.modern span {
    color: white;
}

.theme-preview.elegant {
    background: linear-gradient(135deg, #ffd89b, #19547b);
    color: white;
}

.theme-preview.elegant span {
    color: white;
}

.theme-preview.minimal {
    background: #ffffff;
    border: 1px solid #ddd;
}

.theme-preview.vintage {
    background: linear-gradient(135deg, #8b4513, #daa520);
    color: white;
}

.theme-preview.vintage span {
    color: white;
}

.theme-preview.rustic {
    background: linear-gradient(135deg, #8fbc8f, #556b2f);
    color: white;
}

.theme-preview.rustic span {
    color: white;
}

/* Style Controls */
.style-controls {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.control-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.control-group label {
    min-width: 120px;
    font-weight: 500;
    color: #2c3e50;
}

.slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

.slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

.slider-value {
    min-width: 60px;
    font-weight: 500;
    color: #667eea;
}

/* Field Labels Customization */
.field-labels-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.field-label-group {
    display: flex;
    flex-direction: column;
}

.field-label-group label {
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
    font-size: 14px;
}

.field-label-group input {
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.field-label-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.field-label-group input::placeholder {
    color: #999;
    font-style: italic;
}

/* Custom Buttons */
.custom-buttons-container {
    margin-top: 15px;
}

.custom-button-list {
    margin-bottom: 15px;
}

.custom-button-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
}

.custom-button-info {
    flex: 1;
}

.custom-button-text {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.custom-button-url {
    font-size: 12px;
    color: #666;
    word-break: break-all;
}

.custom-button-actions {
    display: flex;
    gap: 8px;
}

.btn-edit-custom, .btn-delete-custom {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.btn-edit-custom {
    background: #ffc107;
    color: #333;
}

.btn-edit-custom:hover {
    background: #e0a800;
}

.btn-delete-custom {
    background: #dc3545;
    color: white;
}

.btn-delete-custom:hover {
    background: #c82333;
}

.btn-add-custom-button {
    width: 100%;
    padding: 12px;
    border: 2px dashed #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-add-custom-button:hover {
    background: rgba(102, 126, 234, 0.1);
    border-style: solid;
}

/* Custom Button Modal */
.custom-button-modal {
    max-width: 500px;
    width: 90%;
    padding: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

.location-customizer-footer,
.custom-button-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

/* Location Card Themes */
.location-theme-classic {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border: 1px solid #dee2e6;
}

.location-theme-modern {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
    border: 1px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.15);
}

.location-theme-elegant {
    background: linear-gradient(135deg, rgba(255, 216, 155, 0.2), rgba(25, 84, 123, 0.1));
    border: 1px solid rgba(255, 216, 155, 0.3);
    position: relative;
}

.location-theme-elegant::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 216, 155, 0.1));
    pointer-events: none;
}

.location-theme-minimal {
    background: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: none;
}

.location-theme-vintage {
    background: linear-gradient(135deg, rgba(139, 69, 19, 0.1), rgba(218, 165, 32, 0.1));
    border: 1px solid rgba(139, 69, 19, 0.2);
    position: relative;
}

.location-theme-rustic {
    background: linear-gradient(135deg, rgba(143, 188, 143, 0.1), rgba(85, 107, 47, 0.1));
    border: 1px solid rgba(143, 188, 143, 0.3);
}

/* Button text color inheritance */
.btn[style*="--button-text-color"] span,
.btn-submit[style*="--button-text-color"] span {
    color: var(--button-text-color) !important;
}

/* Outline button special handling */
.btn[style*="background: transparent"][style*="--button-outline-color"] span,
.btn-submit[style*="background: transparent"][style*="--button-outline-color"] span {
    color: var(--button-text-color) !important;
}