/* Forms Pages Styles - Mobile Responsive & Consistent Design */
:root {
    --primary: #5A4AE3;
    --accent: #00D2C5;
    --background: #F4F7FA;
    --text-primary: #1B1F2B;
    --text-muted: #6C7A89;
    --card-bg: #FFFFFF;
    --error-alert: #FF6B6B;
}

/* ===== HERO SECTIONS ===== */
.forms-hero {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    border-radius: 1rem;
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.forms-hero h1,
.forms-hero h2 {
    font-weight: 700;
    font-size: 1.75rem;
    color: #fff;
}

.forms-hero h1 i,
.forms-hero h2 i {
    color: rgba(255, 255, 255, 0.9);
}

.forms-hero p.lead {
    opacity: 0.9;
    margin-bottom: 0;
}

/* Mobile Responsive Hero */
@media (max-width: 768px) {
    .forms-hero {
        padding: 1.5rem 1rem;
        border-radius: 12px;
    }
    
    .forms-hero h1,
    .forms-hero h2 {
        font-size: 1.5rem;
    }
    
    .forms-hero p.lead {
        font-size: 1rem;
    }
}

/* ===== FILTER CARD ===== */
.filter-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(90, 74, 227, 0.08);
}

.filter-card h6 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.filter-card .btn-group {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.filter-card .btn-group .btn {
    border-radius: 8px;
    font-size: 0.9rem;
    padding: 0.5rem 1rem;
    margin: 0 !important;
}

/* Mobile Filter Adjustments */
@media (max-width: 768px) {
    .filter-card {
        padding: 1rem;
    }
    
    .filter-card .btn-group {
        flex-direction: column;
        width: 100%;
    }
    
    .filter-card .btn-group .btn {
        width: 100%;
        text-align: left;
    }
}

/* ===== FORMS GRID ===== */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .forms-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
}

/* ===== FORM CARDS ===== */
.form-card {
    background: var(--card-bg);
    border-radius: 1rem;
    box-shadow: 0 2px 16px rgba(90, 74, 227, 0.08);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(90, 74, 227, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.form-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(90, 74, 227, 0.12);
}

.form-card h2,
.form-card h3,
.form-card h4,
.form-card h5 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
}

.form-card h3 i,
.form-card h5 i {
    color: var(--accent);
}

.form-card .card-title {
    color: var(--primary);
    font-weight: 700;
}

.form-card .card-text {
    color: var(--text-muted);
}

.form-card .text-muted {
    color: var(--text-muted) !important;
}

/* Form Card Dropdown */
.form-card .dropdown-menu {
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(0, 0, 0, 0.08);
}

.form-card .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.form-card .dropdown-item:hover {
    background: var(--background);
}

.form-card .dropdown-item.text-danger:hover {
    background: rgba(255, 107, 107, 0.1);
}

/* Mobile Card Adjustments */
@media (max-width: 768px) {
    .form-card {
        padding: 1rem;
        border-radius: 12px;
    }
    
    .form-card .row.g-2 > .col-6 {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* ===== ADVANCED SETTINGS CARD ===== */
.advanced-settings-card {
    background: var(--background);
    border-radius: 12px;
    padding: 1.5rem;
    border: 1px solid #e5e7eb;
    margin-top: 1rem;
}

.advanced-settings-card h6 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--accent);
}

.advanced-settings-card .form-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.advanced-settings-card .form-text {
    font-size: 0.8rem;
}

@media (max-width: 768px) {
    .advanced-settings-card {
        padding: 1rem;
    }
}

/* ===== FIELD OPTIONS CONTAINER ===== */
.field-options-container {
    animation: slideDown 0.3s ease;
    display: none;
}

.field-options-container.show {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FORM CONTROLS ===== */
.form-control,
.form-select {
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    background: #f8fafc;
    color: var(--text-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(90, 74, 227, 0.1);
    outline: none;
}

/* Form Validation States */
.form-control.is-valid,
.form-select.is-valid {
    border-color: #10b981;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 8'%3e%3cpath fill='%2310b981' d='M2.3 6.73L.6 4.53c-.4-1.04.46-1.4 1.1-.8l1.1 1.4 3.4-3.8c.6-.63 1.6-.27 1.2.7l-4 4.6c-.43.5-.8.4-1.1.1z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--error-alert);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' width='12' height='12' fill='none' stroke='%23FF6B6B'%3e%3ccircle cx='6' cy='6' r='4.5'/%3e%3cpath stroke-linejoin='round' d='M5.8 3.6h.4L6 6.5z'/%3e%3ccircle cx='6' cy='8.2' r='.6' fill='%23FF6B6B' stroke='none'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right calc(0.375em + 0.1875rem) center;
    background-size: calc(0.75em + 0.375rem) calc(0.75em + 0.375rem);
    padding-right: calc(1.5em + 0.75rem);
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.form-text {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.form-check-label {
    font-weight: 500;
    color: var(--text-primary);
}

.form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}

/* Monospace for code/JSON inputs */
.font-monospace {
    font-family: 'Courier New', 'Consolas', monospace !important;
}

code {
    background: var(--background);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--primary);
}

/* ===== CHARACTER COUNTER ===== */
.character-counter {
    font-size: 0.85rem;
    margin-top: 0.25rem;
    transition: color 0.2s ease;
}

.character-counter.text-warning {
    color: #f59e0b !important;
}

.character-counter.text-danger {
    color: var(--error-alert) !important;
}

/* ===== BUTTONS ===== */
.btn-accent {
    background: var(--accent);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.btn-accent:hover,
.btn-accent:focus {
    background: #00b8ad;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 210, 197, 0.3);
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(90, 74, 227, 0.2);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background: #4a3dc9;
    border-color: #4a3dc9;
    box-shadow: 0 4px 16px rgba(90, 74, 227, 0.3);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #9ca3af;
    border-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-outline-primary:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-outline-secondary {
    border-color: var(--text-muted);
    color: var(--text-muted);
    border-radius: 8px;
    font-weight: 600;
}

.btn-outline-secondary:hover {
    background: var(--text-muted);
    border-color: var(--text-muted);
    color: #fff;
}

.btn-outline-info {
    border-color: var(--accent);
    color: var(--accent);
    border-radius: 8px;
}

.btn-outline-info:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-outline-success {
    border-color: var(--accent);
    color: var(--accent);
    border-radius: 8px;
}

.btn-outline-success:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn-outline-warning {
    border-color: #f59e0b;
    color: #f59e0b;
    border-radius: 8px;
}

.btn-outline-warning:hover {
    background: #f59e0b;
    border-color: #f59e0b;
    color: #fff;
}

.btn-danger {
    background: var(--error-alert);
    border-color: var(--error-alert);
    border-radius: 8px;
    font-weight: 600;
}

.btn-danger:hover {
    background: #e85555;
    border-color: #e85555;
}

.btn-outline-danger {
    border-color: var(--error-alert);
    color: var(--error-alert);
    border-radius: 8px;
}

.btn-outline-danger:hover {
    background: var(--error-alert);
    border-color: var(--error-alert);
    color: #fff;
}

/* ===== BADGES ===== */
.badge {
    border-radius: 6px;
    padding: 0.35rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.badge.bg-success {
    background: var(--accent) !important;
}

.badge.bg-danger {
    background: var(--error-alert) !important;
}

.badge.bg-warning {
    background: #f59e0b !important;
    color: #fff !important;
}

.badge.bg-info {
    background: var(--accent) !important;
}

.badge.bg-primary {
    background: var(--primary) !important;
}

.badge.bg-secondary {
    background: var(--text-muted) !important;
}

.badge.bg-light {
    background: var(--background) !important;
    color: var(--text-primary) !important;
}

/* ===== TABLES ===== */
.forms-table {
    background: var(--card-bg);
    border-radius: 0.5rem;
    overflow: hidden;
    width: 100%;
}

.forms-table thead {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
}

.forms-table th {
    font-weight: 600;
    padding: 1rem;
    border: none;
}

.forms-table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: rgba(0, 0, 0, 0.05);
}

.forms-table tbody tr:hover {
    background: rgba(90, 74, 227, 0.03);
}

/* Mobile Table Responsiveness */
@media (max-width: 768px) {
    .forms-table {
        font-size: 0.85rem;
    }
    
    .forms-table thead {
        display: none;
    }
    
    .forms-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e7e7eb;
        border-radius: 8px;
        padding: 1rem;
        background: var(--card-bg);
    }
    
    .forms-table tbody td {
        display: block;
        text-align: right;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .forms-table tbody td:last-child {
        border-bottom: none;
    }
    
    .forms-table tbody td::before {
        content: attr(data-label);
        float: left;
        font-weight: 700;
        color: var(--primary);
    }
}

/* ===== ALERTS ===== */
.alert {
    border-radius: 12px;
    padding: 1rem 1.25rem;
    border: none;
    font-weight: 500;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}

.alert-info {
    background: rgba(0, 210, 197, 0.1);
    border: 1px solid var(--accent);
    color: var(--text-primary);
    border-radius: 0.75rem;
}

.alert-info .alert-heading {
    color: var(--primary);
    font-weight: 600;
}

.alert-link {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

/* ===== EMPTY STATES ===== */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 3rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.empty-state h4,
.empty-state h5 {
    color: var(--text-primary);
    font-weight: 600;
}

.empty-state p {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ===== MODALS ===== */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    color: #fff;
    border-radius: 16px 16px 0 0;
    border-bottom: none;
    padding: 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-title {
    font-weight: 700;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem 1.5rem;
}

/* ===== NEWFORM PAGE: TEMPLATE OPTION CARDS ===== */
.template-option-card {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e7e7eb;
    transition: all 0.3s ease;
}

.template-option-card:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(90, 74, 227, 0.1);
}

.template-option-card .form-check-input:checked ~ .form-check-label {
    color: var(--primary);
}

/* ===== NEWFORM PAGE: VARIANT TABS ===== */
.variant-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.variant-tab-btn {
    flex: 1;
    min-width: 100px;
    transition: all 0.3s ease;
}

.variant-tab-btn.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(90, 74, 227, 0.3);
}

@media (max-width: 576px) {
    .variant-tabs {
        flex-direction: column;
    }
    
    .variant-tab-btn {
        width: 100%;
    }
}

/* ===== NEWFORM PAGE: IMAGE UPLOAD & BORDER RADIUS ===== */
.image-upload-input {
    cursor: pointer;
}

.image-radius-container {
    animation: fadeIn 0.3s ease;
}

.image-radius-container.border-radius-visible {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        max-height: 0;
    }
    to {
        opacity: 1;
        max-height: 200px;
    }
}

/* ===== NEWFORM PAGE: COLLAPSIBLE SECTIONS ===== */
.card-header[data-bs-toggle="collapse"] {
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.card-header[data-bs-toggle="collapse"]:hover {
    background: rgba(90, 74, 227, 0.05);
}

.card-header[data-bs-toggle="collapse"] h5 {
    margin: 0;
}

.card-header[data-bs-toggle="collapse"]::after {
    content: '\f282';
    font-family: 'bootstrap-icons';
    float: right;
    transition: transform 0.3s ease;
}

.card-header[data-bs-toggle="collapse"]:not(.collapsed)::after {
    transform: rotate(180deg);
}

/* ===== NEWFORM PAGE: AUTO-SAVE NOTIFICATION ===== */
.auto-save-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    font-size: 0.9rem;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.auto-save-notification::before {
    content: '\f26c';
    font-family: 'bootstrap-icons';
    font-size: 1.1rem;
}

/* ===== FORM BUILDER LAYOUT - FIXED ===== */
.form-builder-row {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.form-builder-col {
    flex: 1 1 55%;
    min-width: 0;
    max-width: 58%;
}

.form-builder-section {
    margin-top: 1rem;
}

/* Live Preview Column - Fills remaining space with auto height */
.live-preview-col {
    flex: 1 1 42%;
    min-width: 320px;
    max-width: 42%;
}

.preview-sticky-wrapper {
    position: sticky;
    top: 80px;
    width: 100%;
}

.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--primary);
}

.preview-header h5 {
    color: var(--primary);
    font-weight: 700;
    margin: 0;
    font-size: 1rem;
}

/* Live preview container - auto height, no forced scrolling */
.live-preview-container {
    background: #f8f9fa;
    border-radius: 8px;
    overflow: visible;
    padding: 0;
    width: 100%;
    border: 1px solid #e7e7eb;
    /* Remove max-height to prevent scrolling */
}

/* Ensure embed wrapper inside preview is compact */
.live-preview-container .form-embed-wrapper {
    min-height: auto !important;
    padding: 1rem 0.75rem !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* Compact form container in preview */
.live-preview-container .form-container {
    max-width: 100% !important;
    width: 100% !important;
    padding: 1rem !important;
}

/* Compact field styling in preview */
.live-preview-container .preview-field {
    margin-bottom: 0.5rem !important;
}

.live-preview-container .preview-field .form-label {
    font-size: 0.8rem !important;
    margin-bottom: 0.25rem !important;
}

.live-preview-container .preview-field .form-control,
.live-preview-container .preview-field .form-select {
    padding: 0.35rem 0.5rem !important;
    font-size: 0.85rem !important;
}

/* Preview banner styling */
.live-preview-container .preview-banner {
    position: sticky;
    top: 0;
    z-index: 10;
    background: rgba(255,255,255,0.95);
    padding: 0.35rem;
    margin-bottom: 0.25rem;
    border-radius: 4px;
}

/* Ensure inputs in preview are visually disabled */
.live-preview-container input:disabled,
.live-preview-container select:disabled,
.live-preview-container textarea:disabled {
    opacity: 0.8;
    cursor: not-allowed;
}

/* Button in preview shouldn't be clickable */
.live-preview-container button {
    pointer-events: none;
}

/* Preview footer */
.preview-footer {
    background: var(--background);
    border-radius: 0 0 8px 8px;
    padding: 0.5rem;
    font-size: 0.8rem;
}

/* Mobile Layout for Form Builder */
@media (max-width: 1199px) {
    .form-builder-col {
        flex: 1 1 55%;
        max-width: 55%;
    }
    
    .live-preview-col {
        flex: 1 1 45%;
        min-width: 280px;
        max-width: 45%;
    }
}

@media (max-width: 991px) {
    .form-builder-row {
        flex-direction: column;
    }
    
    .form-builder-col,
    .live-preview-col {
        flex: none;
        max-width: 100%;
        width: 100%;
    }
    
    .live-preview-col {
        min-width: 0;
        order: -1;
        margin-bottom: 1.5rem;
    }
    
    .preview-sticky-wrapper {
        position: static;
    }
}

@media (max-width: 768px) {
    .form-section {
        padding: 1rem;
    }
    
    .template-option-card {
        padding: 0.875rem;
    }
    
    .forms-hero .btn {
        padding: 0.375rem 0.75rem;
        font-size: 0.875rem;
    }
    
    .live-preview-container {
        padding: 1rem;
        min-height: 350px;
    }
}

/* ===== SETTINGS PAGE STYLES ===== */
.settings-option-card {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    height: 100%;
}

.settings-option-card:hover {
    border-color: var(--primary);
}

.settings-option-card:has(.form-check-input:checked) {
    border-color: var(--primary);
    background: rgba(90, 74, 227, 0.05);
}

.settings-option-card .form-check-input[type="checkbox"] {
    width: 3em;
    height: 1.5em;
}

.settings-option-card .form-check-label {
    font-weight: 600;
}

.logo-preview {
    margin-top: 1rem;
}

.logo-preview-img {
    max-height: 80px;
    max-width: 200px;
    object-fit: contain;
}

.form-control-color {
    max-width: 60px;
    height: 38px;
    padding: 0.25rem;
    cursor: pointer;
}

@media (max-width: 768px) {
    .logo-preview-img {
        max-width: 150px;
        max-height: 60px;
    }
    
    .settings-option-card {
        margin-bottom: 0.5rem;
    }
}

/* ===== SUBMISSION DETAILS PAGE STYLES ===== */
.submission-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.meta-item {
    display: flex;
    align-items: center;
    font-size: 0.95rem;
}

.submission-fields-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.submission-field-item {
    padding: 1rem;
    background: var(--background);
    border-radius: 8px;
    border: 1px solid #e7e7eb;
    transition: border-color 0.3s ease;
}

.submission-field-item:hover {
    border-color: var(--primary);
}

.field-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.field-value {
    color: var(--text-primary);
    font-size: 1rem;
    word-wrap: break-word;
}

.textarea-content {
    white-space: pre-wrap;
    background: #fff;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #e7e7eb;
}

/* Comments Section */
.comment-input-group {
    background: var(--background);
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e7e7eb;
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.comment-item {
    background: var(--background);
    padding: 1rem;
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment-body {
    color: var(--text-primary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* Action Cards */
.action-card {
    background: var(--background);
    border: 1px solid #e7e7eb;
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    gap: 1rem;
    align-items: start;
    transition: all 0.3s ease;
    height: 100%;
}

.action-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.action-card.border-danger {
    border-color: var(--error-alert);
}

.action-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.action-content {
    flex: 1;
}

.action-content h6 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

/* Background subtle colors */
.bg-info-subtle {
    background: rgba(0, 210, 197, 0.1);
}

.bg-success-subtle {
    background: rgba(16, 185, 129, 0.1);
}

.bg-danger-subtle {
    background: rgba(255, 107, 107, 0.1);
}

.bg-warning-subtle {
    background: rgba(245, 158, 11, 0.1);
}

.bg-primary-subtle {
    background: rgba(90, 74, 227, 0.1);
}

/* Text colors for icons */
.text-info {
    color: var(--accent) !important;
}

.text-success {
    color: #10b981 !important;
}

.text-danger {
    color: var(--error-alert) !important;
}

.text-warning {
    color: #f59e0b !important;
}

@media (max-width: 768px) {
    .submission-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .action-card {
        flex-direction: column;
        text-align: center;
    }
    
    .action-icon {
        margin: 0 auto;
    }
    
    .action-content {
        text-align: center;
    }
}

/* ===== CONFIRMATION PAGES ===== */
.confirmation-card {
    background: var(--card-bg);
    border-radius: 1rem;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 4px 24px rgba(90, 74, 227, 0.1);
    border: 1px solid rgba(90, 74, 227, 0.08);
}

.confirmation-card .success-icon {
    font-size: 4rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    animation: successPulse 0.6s ease-out;
}

.confirmation-card h2 {
    color: var(--primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
    font-size: 1.75rem;
}

.confirmation-card p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

.confirmation-card .border-top {
    border-color: rgba(0, 0, 0, 0.08) !important;
}

.confirmation-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
}

.confirmation-actions .btn {
    min-width: 200px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
}

.confirmation-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
        opacity: 0;
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .confirmation-card {
        padding: 2rem 1.5rem;
        margin: 0 0.5rem;
    }
    
    .confirmation-card .success-icon {
        font-size: 3rem;
    }
    
    .confirmation-card h2 {
        font-size: 1.5rem;
    }
    
    .confirmation-actions .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (min-width: 576px) {
    .confirmation-actions {
        flex-direction: row;
        justify-content: center;
    }
}

/* ===== EMBED CODE STYLES ===== */
.embed-code-container {
    position: relative;
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid #e7e7eb;
}

.embed-code {
    background: #1e293b;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 1rem;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.copy-embed-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 10;
}

.copy-embed-btn.copied {
    background: var(--accent);
    border-color: var(--accent);
}

.embed-preview-container {
    background: var(--background);
    border-radius: 8px;
    padding: 1rem;
    border: 2px dashed #d1d5db;
}

.embed-preview-frame {
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .copy-embed-btn {
        position: static;
        width: 100%;
        margin-top: 0.5rem;
    }
    
    .embed-code {
        font-size: 0.75rem;
        padding: 1rem;
    }
}

/* ===== FIELD CARDS ===== */
.field-card {
    background: var(--card-bg);
    border: 2px solid #e7e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
}

.field-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(90, 74, 227, 0.12);
    transform: translateY(-2px);
}

.field-card:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90, 74, 227, 0.1);
}

/* Drag handle styling */
.drag-handle {
    cursor: grab;
    color: var(--text-muted);
    transition: color 0.2s ease;
}

.drag-handle:hover {
    color: var(--primary);
}

.drag-handle:active {
    cursor: grabbing;
}

/* Column selector visual enhancements */
select.field-column {
    font-weight: 600;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235A4AE3' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
}

select.field-column:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90, 74, 227, 0.15);
}

/* Success state for validation */
.is-valid {
    border-color: #10b981 !important;
}

.is-invalid {
    border-color: var(--error-alert) !important;
}

/* Spinner for loading states */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
    border-width: 0.2em;
}

/* Smooth transitions for all form controls */
.form-control,
.form-select,
.btn {
    transition: all 0.2s ease;
}

/* Focus visible for accessibility */
*:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
    border-radius: 4px;
}

/* Print styles for forms */
@media print {
    .forms-hero,
    .filter-card,
    .btn,
    .pagination,
    .modal,
    .live-preview-col {
        display: none !important;
    }
    
    .form-card {
        box-shadow: none;
        border: 1px solid #000;
        page-break-inside: avoid;
    }
    
    .form-builder-col {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* ===== SUBMISSIONS PAGE STYLES ===== */
.unread-row {
    background: rgba(255, 193, 7, 0.1);
}

.sort-link {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s ease;
}

.sort-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.field-values-list {
    list-style: none;
    padding: 0.5rem 0;
    margin: 0;
}

.field-value-item {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e7e7eb;
}

.field-value-item:last-child {
    border-bottom: none;
}

.field-name {
    color: var(--primary);
    font-size: 0.9rem;
}

.field-value-link {
    color: var(--accent);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.field-value-link:hover {
    color: var(--primary);
}

.submissions-table tbody tr {
    transition: background-color 0.2s ease;
}

/* Submissions Table Mobile */
@media (max-width: 768px) {
    .submissions-table thead {
        display: none;
    }
    
    .submissions-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e7e7eb;
        border-radius: 8px;
        padding: 1rem;
        background: var(--card-bg);
    }
    
    .submissions-table tbody td {
        display: block;
        text-align: left;
        padding: 0.5rem 0;
        border: none;
    }
    
    .submissions-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--primary);
        display: block;
        margin-bottom: 0.25rem;
    }
}

/* ===== SUBMIT FORM PAGE STYLES ===== */
.form-field-wrapper {
    background: var(--background);
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e7e7eb;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-field-wrapper:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(90, 74, 227, 0.1);
}

.schedule-field-container {
    background: #fff;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e7e7eb;
}

.selected-time-display {
    padding: 0.75rem;
    background: var(--background);
    border-radius: 6px;
    border: 1px solid #e7e7eb;
    min-height: 50px;
}

.selected-time-display:empty::before {
    content: "No time slot selected";
    color: var(--text-muted);
    font-style: italic;
}

.schedule-slot-selected {
    background: rgba(0, 210, 197, 0.15);
    border-color: var(--accent);
}

@media (max-width: 768px) {
    .form-field-wrapper {
        padding: 1rem;
    }
}

/* ===== SCHEDULE PAGE SPECIFIC ===== */
.schedule-table td,
.schedule-table th {
    vertical-align: middle;
}

.time-input {
    max-width: 150px;
}

.edit-mode-row {
    background: var(--background);
}

@media (max-width: 768px) {
    .time-input {
        max-width: 100%;
    }
    
    .schedule-table .badge {
        font-size: 0.75rem;
    }
    
    .schedule-table thead {
        display: none;
    }
    
    .schedule-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        background: var(--card-bg);
        border-radius: 0.5rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        padding: 1rem;
    }
    
    .schedule-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 0.5rem 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }
    
    .schedule-table td:last-child {
        border-bottom: none;
    }
    
    .schedule-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-primary);
        flex: 0 0 40%;
    }
    
    .schedule-table td[data-label="Day"] {
        background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
        color: #fff;
        border-radius: 0.5rem 0.5rem 0 0;
        margin: -1rem -1rem 0.5rem -1rem;
        padding: 0.75rem 1rem;
    }
    
    .schedule-table td[data-label="Day"]::before {
        display: none;
    }
    
    .schedule-table td[data-label="Day"] strong {
        color: #fff;
    }
}

/* ===== WEBHOOK LOGS PAGE STYLES ===== */
.webhook-logs-table .failed-row {
    background: rgba(255, 107, 107, 0.05);
    border-left: 4px solid var(--error-alert);
}

.webhook-url-cell {
    max-width: 250px;
}

.webhook-url {
    display: block;
    font-size: 0.85rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    color: var(--primary);
    background: var(--background);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    border: 1px solid #e7e7eb;
}

.status-code {
    font-weight: 600;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.view-details-btn {
    font-size: 0.85rem;
}

.webhook-details-content {
    white-space: pre-wrap;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    background: #1e293b;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 8px;
    max-height: 500px;
    overflow-y: auto;
    line-height: 1.6;
}

/* Scrollbar styling for webhook details */
.webhook-details-content::-webkit-scrollbar {
    width: 8px;
}

.webhook-details-content::-webkit-scrollbar-track {
    background: #0f172a;
    border-radius: 4px;
}

.webhook-details-content::-webkit-scrollbar-thumb {
    background: #475569;
    border-radius: 4px;
}

.webhook-details-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Mobile adjustments for webhook logs */
@media (max-width: 768px) {
    .webhook-logs-table thead {
        display: none;
    }
    
    .webhook-logs-table tbody tr {
        display: block;
        margin-bottom: 1rem;
        border: 1px solid #e7e7eb;
        border-radius: 8px;
        padding: 1rem;
        background: var(--card-bg);
    }
    
    .webhook-logs-table tbody td {
        display: block;
        text-align: left;
        padding: 0.5rem 0;
        border: none;
    }
    
    .webhook-logs-table tbody td::before {
        content: attr(data-label);
        font-weight: 700;
        color: var(--primary);
        display: block;
        margin-bottom: 0.25rem;
    }
    
    .webhook-url-cell {
        max-width: 100%;
    }
}

/* ===== FORM VIEW PAGE STYLES ===== */
.form-embed-wrapper {
    padding: 2rem 1rem;
    background: var(--form-bg, var(--background));
    font-family: var(--form-font, 'Segoe UI', Arial, sans-serif);
    --form-primary: var(--primary);
    --form-accent: var(--accent);
    --form-bg: var(--background);
    --form-font: 'Segoe UI', Arial, sans-serif;
}

.form-view-container {
    max-width: 800px;
    margin: 0 auto;
}

.form-title {
    color: var(--form-primary, var(--primary));
    font-weight: 700;
    font-size: 1.75rem;
}

.form-description {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.form-more-description {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.5;
}

.form-images {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.form-images.stacked {
    flex-direction: column;
    align-items: center;
}

.form-images.align-left {
    justify-content: flex-start;
}

.form-images.align-center {
    justify-content: center;
}

.form-images.align-right {
    justify-content: flex-end;
}

.form-logo-img,
.form-personal-img {
    max-width: 150px;
    max-height: 150px;
    object-fit: contain;
}

.form-fields-card {
    background: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    margin-bottom: 2rem;
}

.field-wrapper {
    margin-bottom: 1.5rem;
}

.field-full-width {
    grid-column: 1 / -1;
}

.field-value-container {
    background: var(--background);
    border-radius: 0.5rem;
    padding: 0.75rem;
    word-break: break-word;
}

.form-submit-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e7e7eb;
}

.btn-nav {
    padding: 0.75rem 2rem;
    font-weight: 600;
    border-radius: 8px;
}

.btn-submit {
    padding: 0.85rem 2.5rem;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 8px;
}

.btn-gradient {
    background: linear-gradient(90deg, var(--form-primary, var(--primary)) 0%, var(--form-accent, var(--accent)) 100%);
    border: none;
    color: #fff;
    transition: all 0.3s ease;
}

.btn-gradient:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(90, 74, 227, 0.3);
    color: #fff;
}

/* Step Navigation */
.step-navigation {
    max-width: 800px;
    margin: 0 auto;
}

.step-progress-bar {
    height: 4px;
    background: #e7e7eb;
    border-radius: 2px;
    margin-bottom: 1rem;
    overflow: hidden;
}

.step-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
    transition: width 0.4s ease;
}

.step-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.step-item {
    flex: 1;
    text-align: center;
}

.step-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--text-muted);
    transition: all 0.3s ease;
}

.step-link:hover {
    color: var(--primary);
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e7e7eb;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.step-item.active .step-number {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(90, 74, 227, 0.3);
}

.step-item.completed .step-number {
    background: var(--accent);
    color: #fff;
}

.step-item.active .step-link,
.step-item.completed .step-link {
    color: var(--text-primary);
}

.step-label {
    font-size: 0.85rem;
    font-weight: 600;
}

/* Thread Details - Message styles */
.thread-message-item {
    border-left: 3px solid var(--primary);
    transition: all 0.2s ease;
}

.thread-message-item:hover {
    background: rgba(90, 74, 227, 0.05);
}

.thread-reply-item {
    border-left-color: var(--accent);
}

/* Transfer Ownership page */
.transfer-warning-card {
    background: rgba(255, 107, 107, 0.05);
    border: 2px solid var(--error-alert);
    border-radius: 1rem;
}

.transfer-info-card {
    background: rgba(0, 210, 197, 0.05);
    border: 1px solid var(--accent);
    border-radius: 1rem;
}

/* Animation delay classes for forms */
.forms-fade-in-delay-1 {
    animation-delay: 0.05s;
}

.forms-fade-in-delay-2 {
    animation-delay: 0.1s;
}

.forms-fade-in-delay-3 {
    animation-delay: 0.15s;
}

.forms-fade-in-delay-4 {
    animation-delay: 0.2s;
}

/* =====================================================
   TWO-COLUMN LAYOUT SYSTEM - COMPLETE IMPLEMENTATION
   ===================================================== */

/* Base two-column form wrapper */
.form-two-column {
    max-width: 100%;
}

.form-two-column .form-fields-card {
    max-width: 1000px;
}

/* CSS Grid-based two-column layout for form fields */
.form-two-column .form-fields-grid,
.form-two-column .preview-form-fields {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    align-items: start;
}

/* Full-width fields - span both columns */
.form-two-column .field-wrapper[data-field-column=""],
.form-two-column .field-wrapper:not([data-field-column]),
.form-two-column .field-wrapper[data-field-column="null"],
.form-two-column .field-wrapper[data-field-column="span"],
.form-two-column .field-wrapper[data-field-column="-1"],
.form-two-column .field-full-width,
.form-two-column .preview-field[data-column="span"],
.form-two-column .preview-field[data-column=""],
.form-two-column .preview-field:not([data-column]) {
    grid-column: 1 / -1;
}

/* Left column fields */
.form-two-column .field-wrapper[data-field-column="0"],
.form-two-column .preview-field[data-column="0"] {
    grid-column: 1;
}

/* Right column fields */
.form-two-column .field-wrapper[data-field-column="1"],
.form-two-column .preview-field[data-column="1"] {
    grid-column: 2;
}

/* ===== LIVE PREVIEW TWO-COLUMN GRID ===== */

/* Preview wrapper for two-column mode */
.preview-form-wrapper.form-two-column {
    max-width: 100%;
}

/* Main two-column preview grid structure */
.preview-two-column-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

/* Container for full-width fields that span both columns */
.preview-span-both {
    width: 100%;
}

.preview-span-both .preview-field {
    width: 100%;
}

/* Side-by-side columns container using CSS Grid */
.preview-columns-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

/* Individual column containers */
.preview-left-column,
.preview-right-column {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-width: 0; /* Prevent overflow */
}

/* Single column layout */
.preview-single-column {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Field column container visibility */
.field-column-container.d-none,
.column-selector-group.d-none {
    display: none !important;
}

/* Responsive: Stack columns on mobile */
@media (max-width: 768px) {
    .preview-columns-row {
        grid-template-columns: 1fr;
    }
}

/* Live preview container improvements */
.live-preview-container {
    min-height: 400px;
    max-height: 80vh;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    padding: 1rem;
}

/* Preview field styling */
.preview-field {
    background: #fafbfc;
    border-radius: 6px;
    padding: 0.75rem;
    border: 1px solid #e9ecef;
}

/* Preview field with column indicator badge */
.preview-field[data-column="0"]::before {
    content: "L";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    background: var(--primary);
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    opacity: 0.7;
}

.preview-field[data-column="1"]::before {
    content: "R";
    position: absolute;
    top: 4px;
    right: 4px;
    font-size: 0.65rem;
    background: var(--accent);
    color: #fff;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    opacity: 0.7;
}

.preview-field {
    position: relative;
}

/* Layout indicator in preview header */
.preview-layout-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: var(--background);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    border: 1px solid #e7e7eb;
}

.preview-layout-indicator i {
    color: var(--primary);
}

.preview-layout-indicator.two-column {
    border-color: var(--accent);
}

.preview-layout-indicator.two-column i {
    color: var(--accent);
}

/* Column selector highlight when Two Column is selected */
.field-column-container.highlight {
    background: rgba(0, 210, 197, 0.08);
    border-radius: 8px;
    padding: 0.5rem;
    margin: -0.5rem;
    border: 1px dashed var(--accent);
}

/* Visual guide for column assignment */
.column-guide {
    display: none;
    padding: 0.5rem;
    background: linear-gradient(90deg, rgba(90, 74, 227, 0.05) 0%, rgba(90, 74, 227, 0.05) 50%, rgba(0, 210, 197, 0.05) 50%, rgba(0, 210, 197, 0.05) 100%);
    border-radius: 8px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.form-two-column .column-guide {
    display: block;
}

.column-guide .left-label,
.column-guide .right-label {
    display: inline-block;
    width: 48%;
    padding: 0.25rem;
}

.column-guide .left-label {
    border-right: 1px dashed var(--text-muted);
}

/* Two-column responsive breakpoints */
@media (max-width: 991px) {
    .form-two-column .form-fields-grid,
    .form-two-column .preview-form-fields {
        grid-template-columns: 1fr;
    }
    
    .form-two-column .field-wrapper[data-field-column="0"],
    .form-two-column .field-wrapper[data-field-column="1"],
    .form-two-column .preview-field[data-column="0"],
    .form-two-column .preview-field[data-column="1"] {
        grid-column: 1;
    }
    
    .preview-columns-row {
        grid-template-columns: 1fr;
    }
    
    .column-guide {
        display: none;
    }
}

@media (max-width: 768px) {
    .form-two-column .form-fields-card {
        padding: 1rem;
    }
    
    .preview-field[data-column="0"]::before,
    .preview-field[data-column="1"]::before {
        display: none;
    }
}

/* ===== FIELD CARD COLUMN INDICATOR ===== */
.field-card[data-field-column="0"] {
    border-left: 4px solid var(--primary);
}

.field-card[data-field-column="1"] {
    border-left: 4px solid var(--accent);
}

.field-card[data-field-column=""],
.field-card:not([data-field-column]) {
    border-left: 4px solid #e7e7eb;
}

/* Column badge inside field card */
.field-column-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    padding: 0.15rem 0.5rem;
    border-radius: 12px;
    font-weight: 600;
}

.field-column-badge.left {
    background: rgba(90, 74, 227, 0.1);
    color: var(--primary);
}

.field-column-badge.right {
    background: rgba(0, 210, 197, 0.1);
    color: var(--accent);
}

.field-column-badge.span {
    background: var(--background);
    color: var(--text-muted);
}

/* ===== ADDRESS FIELD SPECIAL STYLING ===== */
.preview-field .address-preview {
    background: #fff;
    border-radius: 6px;
    padding: 0.5rem;
}

.preview-field .address-preview .form-control {
    font-size: 0.875rem;
    padding: 0.5rem;
}

/* ===== RATING FIELD PREVIEW ===== */
.preview-field .rating-preview {
    display: flex;
    gap: 0.25rem;
    color: #fbbf24;
    font-size: 1.25rem;
}

.preview-field .rating-preview i {
    cursor: default;
}

/* ===== SIGNATURE FIELD PREVIEW ===== */
.preview-field .signature-preview {
    min-height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ===== FILE FIELD PREVIEW ===== */
.preview-field input[type="file"] {
    font-size: 0.875rem;
}

/* ===== FORM BUILDER FIELD LIST EMPTY STATE ===== */
#fields-container:empty::after,
.fields-container:empty::after {
    content: "No fields added yet. Click 'Add Field' to get started.";
    display: block;
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    background: var(--background);
    border-radius: 8px;
    border: 2px dashed #d1d5db;
    font-size: 1rem;
}

#no-fields-message {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
    background: var(--background);
    border-radius: 8px;
    border: 2px dashed #d1d5db;
}

#no-fields-message i {
    font-size: 2.5rem;
    color: var(--accent);
    margin-bottom: 1rem;
    display: block;
}

/* ===== FORM PREVIEW BANNER ===== */
.preview-banner {
    margin-bottom: 1rem;
}

.preview-banner .badge {
    font-size: 0.8rem;
    padding: 0.4rem 0.75rem;
}

/* ===== SCROLLBAR STYLING FOR PREVIEW ===== */
.live-preview-container::-webkit-scrollbar {
    width: 6px;
}

.live-preview-container::-webkit-scrollbar-track {
    background: var(--background);
    border-radius: 3px;
}

.live-preview-container::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
    opacity: 0.5;
}

.live-preview-container::-webkit-scrollbar-thumb:hover {
    background: #4a3dc9;
}

/* ===== FORM TITLE IN PREVIEW ===== */
.preview-form-wrapper .form-title {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--background);
}

/* ===== DISABLED FORM CONTROLS IN PREVIEW ===== */
.preview-field .form-control:disabled,
.preview-field .form-select:disabled,
.preview-field .btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    background: #f1f5f9;
}

/* ===== CONDITIONAL VISIBILITY INDICATOR ===== */
.field-card.has-conditions {
    position: relative;
}

.field-card.has-conditions::after {
    content: "\f472"; /* Bootstrap icon for link */
    font-family: 'bootstrap-icons';
    position: absolute;
    top: 0.5rem;
    right: 3rem;
    color: var(--accent);
    font-size: 1rem;
}

/* ===== DRAG AND DROP VISUAL FEEDBACK ===== */
.field-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--primary);
    background: rgba(90, 74, 227, 0.05);
}

.field-card.drag-over {
    border-top: 3px solid var(--accent);
}

.fields-container.drag-active {
    background: rgba(0, 210, 197, 0.03);
    border-radius: 8px;
}

/* ===== UTILITY CLASSES ===== */
.cursor-grab {
    cursor: grab !important;
}

.cursor-grabbing {
    cursor: grabbing !important;
}

.no-select {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

/* ===== ANIMATION FOR FIELD ADDITION ===== */
@keyframes fieldAdded {
    0% {
        opacity: 0;
        transform: translateY(-20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.field-card.just-added {
    animation: fieldAdded 0.3s ease-out;
}

/* ===== FORM BUILDER ACTION BUTTONS ===== */
.form-builder-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.form-builder-actions .btn {
    flex: 1;
    min-width: 120px;
}

@media (max-width: 576px) {
    .form-builder-actions {
        flex-direction: column;
    }
    
    .form-builder-actions .btn {
        width: 100%;
    }
}

/* ===== VARIANT SELECTOR STYLES ===== */
#variantSelector {
    font-weight: 600;
    min-width: 120px;
}

#variantSelector option {
    font-weight: 600;
}

/* ===== STEP SELECTOR STYLES ===== */
.step-selector-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.step-selector-container label {
    font-weight: 600;
    white-space: nowrap;
}

.step-selector-container select {
    flex: 1;
    max-width: 200px;
}

/* ===== FIELD TYPE ICON MAPPING ===== */
.field-type-icon {
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--background);
    border-radius: 4px;
    margin-right: 0.5rem;
    color: var(--primary);
    font-size: 0.875rem;
}

/* ===== TOAST NOTIFICATIONS ===== */
.form-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    transform: translateY(100px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

.form-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.form-toast.success {
    background: var(--accent);
    color: #fff;
}

.form-toast.error {
    background: var(--error-alert);
    color: #fff;
}

.form-toast.info {
    background: var(--primary);
    color: #fff;
}

/* ===== END OF FORMS.CSS ===== */