/* Form Container */
.filemaker-form-container {
    margin: 20px 0;
    max-width: 800px;
}

/* Modal form container - ensure proper width */
.filemaker-modal .filemaker-form-container {
    max-width: none;
    width: 100%;
}

/* Ensure modal forms have proper width */
.filemaker-modal .filemaker-form {
    width: 100%;
    max-width: none;
}

/* Ensure multipage form navigation works in modals */
.filemaker-modal .filemaker-form-next,
.filemaker-modal .filemaker-form-prev {
    display: inline-block !important;
    margin: 10px 5px;
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    font-size: 14px;
}

.filemaker-modal .filemaker-form-next:hover,
.filemaker-modal .filemaker-form-prev:hover {
    background-color: #005177;
}

.filemaker-modal .filemaker-form-prev {
    background-color: #666;
}

.filemaker-modal .filemaker-form-prev:hover {
    background-color: #555;
}

/* Form Fields */
.filemaker-form-field {
    margin-bottom: 20px;
}

.filemaker-form-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.filemaker-form-field input[type="text"],
.filemaker-form-field input[type="email"],
.filemaker-form-field input[type="number"],
.filemaker-form-field input[type="date"],
.filemaker-form-field textarea,
.filemaker-form-field select {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.filemaker-form-field textarea {
    min-height: 100px;
}

.filemaker-form-field.field-error input,
.filemaker-form-field.field-error textarea,
.filemaker-form-field.field-error select {
    border-color: #dc3232;
}

.filemaker-field-error {
    color: #dc3232;
    font-size: 0.9em;
    margin-top: 5px;
    display: none;
}

/* Radio and Checkbox Groups */
.filemaker-radio-group,
.filemaker-checkbox-group {
    margin-top: 5px;
}

.filemaker-radio-option,
.filemaker-checkbox-option {
    margin-bottom: 5px;
}

.filemaker-radio-option label,
.filemaker-checkbox-option label {
    display: inline;
    margin-left: 5px;
    font-weight: normal;
}

/* Confirmation Checkbox (single checkbox) */
.filemaker-confirmation-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.filemaker-confirmation-checkbox input[type="checkbox"] {
    margin: 0;
    margin-top: 2px;
    cursor: pointer;
    flex-shrink: 0;
}

.filemaker-confirmation-checkbox label {
    margin: 0;
    cursor: pointer;
    font-weight: normal;
    line-height: 1.5;
}

/* Custom Value Input for Dropdowns */
.filemaker-custom-value-input {
    width: 100%;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.filemaker-custom-value-input:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Visual indicator for auto-switched custom inputs (from preloaded data) */
.filemaker-custom-value-input[data-auto-custom="true"] {
    border-left: 3px solid #f0ad4e;
    background-color: #fffbf0;
}

.filemaker-custom-value-input[data-auto-custom="true"]::before {
    content: "Custom value (not in dropdown list)";
    font-size: 11px;
    color: #856404;
    display: block;
    margin-bottom: 4px;
}

/* Form Messages */
.filemaker-form-success,
.filemaker-form-error {
    padding: 10px;
    margin: 10px 0;
    border-radius: 4px;
}

.filemaker-form-success {
    background-color: #ecf8e0;
    color: #2c662d;
    border: 1px solid #c5e1a5;
}

.filemaker-form-error {
    background-color: #fde8e8;
    color: #a83232;
    border: 1px solid #f5c6cb;
}

/* Multi-page Form */
.filemaker-form-progress {
    margin-bottom: 20px;
}

/* Standard Navigation (for few pages) */
.filemaker-form-progress-steps {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #ddd;
    flex-wrap: wrap;
}

.filemaker-form-progress-steps li {
    position: relative;
    opacity: 0.6;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
}

.filemaker-form-progress-steps li.active {
    font-weight: bold;
    border-bottom: 2px solid #0073aa;
    opacity: 1;
}

.filemaker-form-progress-steps .page-link {
    display: block;
    padding: 10px 15px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    text-align: left;
    width: 100%;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.filemaker-form-progress-steps .page-link:hover {
    background-color: #f5f5f5;
    color: #0073aa;
}

.filemaker-form-progress-steps li.active .page-link {
    color: #0073aa;
    font-weight: bold;
}

/* Dropdown Navigation (for many pages) */
.filemaker-form-progress-dropdown {
    position: relative;
    display: inline-block;
    width: 100%;
    max-width: 400px;
}

.filemaker-form-progress-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.filemaker-form-progress-toggle:hover {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.1);
}

.filemaker-form-progress-toggle.open {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.1);
}

.filemaker-form-progress-toggle .current-page-name {
    font-weight: bold;
    color: #0073aa;
}

.filemaker-form-progress-toggle .page-counter {
    color: #666;
    font-size: 13px;
    margin-left: 8px;
}

.filemaker-form-progress-toggle .dropdown-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.2s ease;
}

.filemaker-form-progress-toggle.open .dropdown-arrow {
    transform: rotate(180deg);
}

.filemaker-form-progress-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    max-height: 300px;
    overflow-y: auto;
    margin: 2px 0 0 0;
    padding: 0;
    list-style: none;
}

.filemaker-form-progress-dropdown-menu li {
    border-bottom: 1px solid #f0f0f0;
}

.filemaker-form-progress-dropdown-menu li:last-child {
    border-bottom: none;
}

.filemaker-form-progress-dropdown-menu li.active {
    background-color: #f8f9fa;
}

.filemaker-form-progress-dropdown-menu .page-link {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: inherit;
    font-family: inherit;
    text-align: left;
    transition: background-color 0.2s ease;
}

.filemaker-form-progress-dropdown-menu .page-link:hover {
    background-color: #f5f5f5;
}

.filemaker-form-progress-dropdown-menu li.active .page-link {
    background-color: #e8f4f8;
    color: #0073aa;
}

.filemaker-form-progress-dropdown-menu .page-number {
    font-weight: bold;
    color: #666;
    margin-right: 8px;
    min-width: 24px;
}

.filemaker-form-progress-dropdown-menu li.active .page-number {
    color: #0073aa;
}

.filemaker-form-progress-dropdown-menu .page-name {
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .filemaker-form-progress-steps {
        flex-direction: column;
        border-bottom: none;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    
    .filemaker-form-progress-steps li {
        border-bottom: 1px solid #f0f0f0;
        border-right: none;
    }
    
    .filemaker-form-progress-steps li:last-child {
        border-bottom: none;
    }
    
    .filemaker-form-progress-steps li.active {
        border-bottom: 1px solid #f0f0f0;
        border-left: 3px solid #0073aa;
    }
    
    .filemaker-form-progress-dropdown {
        max-width: 100%;
    }
}

/* Enhanced Navigation Styles */
.filemaker-form-progress-steps li:not(.active) .page-link {
    color: #666;
}

.filemaker-form-progress-steps li:not(.active):hover .page-link {
    color: #0073aa;
}

/* Visual feedback for completed pages */
.filemaker-form-progress-steps li.completed {
    opacity: 0.8;
}

.filemaker-form-progress-steps li.completed .page-link::after {
    content: " ✓";
    color: #46b450;
    font-weight: bold;
}

.filemaker-form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.filemaker-form-prev,
.filemaker-form-next {
    padding: 8px 16px;
    background-color: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.filemaker-form-submit {
    margin-top: 20px;
}

.filemaker-form-submit button {
    padding: 10px 20px;
    background-color: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.filemaker-form-submit button:hover {
    background-color: #005177;
}

/* Inline fields - both float left with gap */
.filemaker-field-inline {
    display: block !important;
    width: 48% !important;
    box-sizing: border-box !important;
    float: left !important;
    margin-bottom: 20px !important;
    margin-right: 4% !important;
    clear: none !important;
}

/* Every second inline field - remove margin to prevent wrapping */
.filemaker-field-inline + .filemaker-field-inline {
    margin-right: 0 !important;
    clear: none !important;
}

/* After two inline fields, next non-inline or third inline should clear */
.filemaker-field-inline + .filemaker-field-inline + .filemaker-form-field {
    clear: both !important;
}

/* Non-inline fields clear and take full width */
.filemaker-form-field:not(.filemaker-field-inline) {
    clear: both !important;
    width: 100% !important;
    float: none !important;
}

/* Force full width for inputs */
.filemaker-field-inline input,
.filemaker-field-inline select,
.filemaker-field-inline textarea {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Clear floats */
.filemaker-form-page:after,
.filemaker-form:after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* Add a visible indicator for debugging */
.filemaker-field-inline {
    position: relative !important;
}

.filemaker-field-inline:before {
    content: none !important;
    display: none !important;
}

@media (max-width: 768px) {
    .filemaker-field-inline {
        display: block !important;
        width: 100% !important;
        float: none !important;
        margin-right: 0 !important;
        clear: both !important;
        position: relative !important;
        z-index: 1 !important;
    }
    
    /* Ensure inputs are accessible on mobile */
    .filemaker-field-inline input,
    .filemaker-field-inline select,
    .filemaker-field-inline textarea {
        position: relative !important;
        z-index: 2 !important;
        pointer-events: auto !important;
    }
    
    /* Ensure labels don't block inputs */
    .filemaker-field-inline label {
        position: relative !important;
        z-index: 1 !important;
        pointer-events: none !important;
    }
}

/* Info Field Styles */
.filemaker-form-info {
    margin: 15px 0;
}

.filemaker-form-heading h1,
.filemaker-form-heading h2,
.filemaker-form-heading h3,
.filemaker-form-heading h4,
.filemaker-form-heading h5,
.filemaker-form-heading h6 {
    margin: 0 0 10px 0;
    padding: 0;
    line-height: 1.2;
}

.filemaker-form-text {
    margin-bottom: 15px;
}

.filemaker-form-divider {
    margin: 20px 0;
}

.filemaker-form-divider hr {
    border: 0;
    height: 1px;
    margin: 0;
}

/* Save Progress */
.filemaker-save-progress {
    margin-right: 10px;
    background-color: #f0f0f0;
    color: #333;
    border: 1px solid #ccc;
}

.filemaker-restore-notice {
    background-color: #f8f8f8;
    border: 1px solid #ddd;
    padding: 10px 15px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.filemaker-restore-link {
    color: #0073aa;
    text-decoration: underline;
    cursor: pointer;
}

.filemaker-restore-link:hover {
    color: #00a0d2;
}

.filemaker-save-message,
.filemaker-restore-message {
    background-color: #d4edda;
    color: #155724;
    padding: 10px 15px;
    margin-bottom: 15px;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

/* File Upload */
.filemaker-file-upload {
    margin-top: 5px;
}

.filemaker-file-preview {
    margin-top: 10px;
    max-width: 200px;
}

.filemaker-file-preview img {
    max-width: 100%;
    height: auto;
    border: 1px solid #ddd;
    padding: 3px;
}

.filemaker-remove-file {
    display: block;
    margin-top: 5px;
    background: #f44336;
    color: white;
    border: none;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 12px;
}

.filemaker-file-progress {
    margin-top: 10px;
    background-color: #f0f0f0;
    border-radius: 4px;
    overflow: hidden;
}

.filemaker-file-progress-bar {
    height: 20px;
    background-color: #4CAF50;
    width: 0%;
    transition: width 0.3s;
}

.filemaker-file-progress-text {
    margin-top: 5px;
    font-size: 12px;
    text-align: center;
} 

/* Form submission styling */
.filemaker-form .form-status {
    margin: 15px 0;
    padding: 10px;
    border-radius: 4px;
    display: none;
}

/* Table Fields Styling */
.table-field-container {
    margin: 15px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    background: #fafafa;
}

.filemaker-table-field {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 10px;
    background: white;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.filemaker-table-field thead {
    background: #f8f9fa;
}

.filemaker-table-field th,
.filemaker-table-field td {
    padding: 10px;
    border: 1px solid #dee2e6;
    text-align: left;
    vertical-align: middle;
}

.filemaker-table-field th {
    font-weight: 600;
    color: #495057;
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.filemaker-table-field .required-asterisk {
    color: #dc3545;
    margin-left: 2px;
}

.filemaker-table-field input,
.filemaker-table-field select {
    width: 100%;
    min-width: 120px;
    padding: 6px 8px;
    border: 1px solid #ced4da;
    border-radius: 3px;
    font-size: 14px;
    background: white;
}

.filemaker-table-field input:focus,
.filemaker-table-field select:focus {
    border-color: #007cba;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

.filemaker-table-field input:invalid {
    border-color: #dc3545;
}

.table-actions {
    width: 50px;
    text-align: center;
}

.remove-table-row {
    background: transparent;
    color: #dc3545;
    border: 1px solid #dc3545;
    width: 28px;
    height: 28px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 18px;
    font-weight: bold;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-table-row:hover {
    background: #dc3545;
    color: white;
}



.table-field-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #dee2e6;
}

.add-table-row {
    background: #007cba;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.add-table-row:hover {
    background: #005a87;
}

.table-row-count {
    font-size: 14px;
    color: #6c757d;
}

.table-row-count .count {
    font-weight: 600;
    color: #495057;
}

.table-field-error {
    color: #dc3545;
    font-style: italic;
    margin: 10px 0;
}

/* Responsive table styling */
@media (max-width: 768px) {
    .table-field-container {
        padding: 10px;
    }
    
    .filemaker-table-field {
        font-size: 14px;
    }
    
    .filemaker-table-field th,
    .filemaker-table-field td {
        padding: 8px 5px;
    }
    
    .filemaker-table-field input,
    .filemaker-table-field select {
        min-width: 100px;
        font-size: 13px;
        padding: 5px 6px;
    }
    
    .table-field-controls {
        flex-direction: column;
        gap: 10px;
        align-items: stretch;
    }
    
    .table-row-count {
        text-align: center;
    }
}

/* Compact table for small screens */
@media (max-width: 480px) {
    .filemaker-table-field {
        font-size: 12px;
    }
    
    .filemaker-table-field th,
    .filemaker-table-field td {
        padding: 6px 3px;
    }
    
    .filemaker-table-field input,
    .filemaker-table-field select {
        min-width: 80px;
        font-size: 12px;
        padding: 4px 5px;
    }
    
    .remove-table-row {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
}

/* Fixed Rows Table - Hide actions column */
.table-field-container.fixed-rows .table-actions {
    display: none;
}

.table-field-container.fixed-rows .table-field-controls {
    display: none;
}

/* Label Column Styling */
.table-cell-label {
    background: #f8f9fa;
}

.table-label-value {
    display: block;
    font-weight: 500;
    color: #333;
    padding: 6px 0;
}

/* Auto-Fill Column Styling */
.table-cell-auto_fill {
    background: #f0f7ff;
}

.auto-fill-field {
    background: #f8fbff !important;
    color: #555;
    cursor: not-allowed;
    border-color: #c8dae8 !important;
}

.auto-fill-field:focus {
    box-shadow: none !important;
    border-color: #c8dae8 !important;
}

/* Dynamic Dropdown in Table */
.table-dynamic-dropdown {
    width: 100%;
    min-width: 150px;
}

.table-cell-dynamic_dropdown select {
    padding: 6px 8px;
}

/* Label column header styling */
.filemaker-table-field th.label-column {
    background: #e9ecef;
}

/* Row hover effect for tables with dynamic content */
.filemaker-table-field tbody tr:hover {
    background: #f5f8fb;
}

.filemaker-table-field tbody tr:hover .table-cell-label {
    background: #e9ecef;
}

.filemaker-table-field tbody tr:hover .table-cell-auto_fill {
    background: #e8f0fa;
} 

/* Nested Table Data Display */
.nested-table-data {
    width: 100%;
    border-collapse: collapse;
    margin: 5px 0;
    font-size: 0.9em;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.nested-table-data th,
.nested-table-data td {
    padding: 6px 8px;
    border: 1px solid #e8e8e8;
    text-align: left;
    vertical-align: top;
}

.nested-table-data th {
    background: #f5f5f5;
    font-weight: 600;
    font-size: 0.85em;
    color: #333;
}

.nested-table-data td {
    background: white;
}

.table-data-list {
    margin: 5px 0;
    padding-left: 20px;
    list-style-type: disc;
}

.table-data-list li {
    margin: 2px 0;
    font-size: 0.9em;
    line-height: 1.3;
}

.table-data-summary {
    font-size: 0.9em;
    color: #666;
    font-style: italic;
}

/* Responsive nested tables */
@media (max-width: 768px) {
    .nested-table-data {
        font-size: 0.8em;
    }
    
    .nested-table-data th,
    .nested-table-data td {
        padding: 4px 6px;
    }
    
    .table-data-list {
        font-size: 0.85em;
    }
}

/* Calculation Fields */
.calculation-field {
    background-color: #f8f9fa !important;
    color: #495057;
    font-family: monospace;
    position: relative;
}

.calculation-field:focus {
    background-color: #f8f9fa !important;
    cursor: not-allowed;
}

.calculation-field.calc-error {
    background-color: #f8d7da !important;
    border-color: #dc3545 !important;
    color: #721c24;
}

.calculation-field::placeholder {
    color: #6c757d;
    font-style: italic;
}

/* Visual indicator for calculated fields */
.filemaker-field-type-calculation {
    position: relative;
}

.filemaker-field-type-calculation::after {
    content: "🧮";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 16px;
    opacity: 0.6;
}

.filemaker-field-type-calculation label {
    position: relative;
}

.filemaker-field-type-calculation label::after {
    content: " (calculated)";
    font-size: 0.85em;
    color: #6c757d;
    font-weight: normal;
    font-style: italic;
}

/* ========================================
   Email Action Styles
   ======================================== */

/* Email Loading */
.filemaker-email-loading {
    background: white;
    padding: 40px 60px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.filemaker-email-loading .fm-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #0073aa;
    border-radius: 50%;
    animation: fm-spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes fm-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Email Prompt Modal */
.filemaker-email-prompt-modal {
    max-width: 600px;
    width: 90%;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    z-index: 10;
}

.filemaker-email-prompt-modal .filemaker-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #ddd;
    background: #f9f9f9;
    border-radius: 8px 8px 0 0;
}

.filemaker-email-prompt-modal .filemaker-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.filemaker-email-prompt-modal .filemaker-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    line-height: 1;
}

.filemaker-email-prompt-modal .filemaker-modal-close:hover {
    color: #333;
}

/* Email Prompt Overlay */
.filemaker-email-prompt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100000;
}

.filemaker-email-prompt-modal .filemaker-modal-body {
    padding: 20px;
}

.filemaker-email-form .fm-email-field {
    margin-bottom: 15px;
}

.filemaker-email-form .fm-email-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.filemaker-email-form .fm-email-field input,
.filemaker-email-form .fm-email-field textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.filemaker-email-form .fm-email-field input:focus,
.filemaker-email-form .fm-email-field textarea:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.filemaker-email-form .fm-email-field input[readonly],
.filemaker-email-form .fm-email-field textarea[readonly] {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

.filemaker-email-form .fm-email-field textarea {
    min-height: 120px;
    resize: vertical;
    font-family: inherit;
}

.filemaker-email-prompt-modal .filemaker-modal-footer {
    padding: 15px 20px;
    border-top: 1px solid #ddd;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    background: #f9f9f9;
}

.filemaker-email-prompt-modal .fm-email-send {
    background: #0073aa;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
}

.filemaker-email-prompt-modal .fm-email-send:hover {
    background: #005a87;
}

.filemaker-email-prompt-modal .fm-email-cancel {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
}

.filemaker-email-prompt-modal .fm-email-cancel:hover {
    background: #e5e5e5;
}

/* Email Notification Toast */
.fm-email-notification {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 8px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    z-index: 100001;
    max-width: 400px;
    animation: fm-slide-in 0.3s ease-out;
}

@keyframes fm-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.fm-email-notification-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.fm-email-notification-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.fm-email-notification .fm-email-icon {
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
}

.fm-email-notification-success .fm-email-icon {
    color: #28a745;
}

.fm-email-notification-error .fm-email-icon {
    color: #dc3545;
}

.fm-email-notification .fm-email-message {
    flex: 1;
    font-size: 14px;
}

.fm-email-notification .fm-email-recipients {
    font-size: 12px;
    margin-top: 5px;
    opacity: 0.8;
}

.fm-email-notification .fm-email-dismiss {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    opacity: 0.5;
    padding: 0;
    line-height: 1;
}

.fm-email-notification .fm-email-dismiss:hover {
    opacity: 1;
}

/* ========================================
   Action Menu Sub-Menu Navigation
   ======================================== */

/* Action menu header with back button */
.filemaker-action-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filemaker-action-menu-header h3 {
    flex: 1;
    margin: 0;
}

/* Back button */
.filemaker-menu-back-btn {
    background: none;
    border: none;
    padding: 5px 8px;
    cursor: pointer;
    color: #666;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.filemaker-menu-back-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.filemaker-menu-back-btn .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

/* Smooth transition for menu content */
.filemaker-action-menu-body {
    transition: opacity 0.2s ease;
}

.filemaker-action-menu-body.loading {
    opacity: 0.6;
}

/* ==========================================
   Data Count Info
   ========================================== */
.filemaker-count-info {
    padding: 8px 12px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

/* ==========================================
   Pagination
   ========================================== */
.filemaker-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    padding: 15px 0;
    margin-top: 10px;
}

.filemaker-page-btn {
    padding: 8px 16px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.filemaker-page-btn:hover:not(:disabled) {
    background: #005177;
}

.filemaker-page-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.filemaker-page-info {
    font-size: 14px;
    color: #666;
}

/* ==========================================
   Multi-Select
   ========================================== */
.filemaker-select-column {
    width: 40px;
    text-align: center;
}

.filemaker-select-column input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.filemaker-data-row.selected {
    background-color: #e8f4fd !important;
}

.filemaker-selection-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #e8f4fd;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
}

.filemaker-selection-bar .selection-count {
    font-weight: 600;
    color: #0073aa;
}

.filemaker-selection-bar button {
    padding: 6px 12px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.filemaker-selection-bar button:hover {
    background: #f0f0f0;
    border-color: #999;
}

.filemaker-select-all-matching-btn {
    background: #0073aa !important;
    color: white !important;
    border-color: #0073aa !important;
}

.filemaker-select-all-matching-btn:hover {
    background: #005177 !important;
}

.filemaker-selection-actions-btn {
    background: #2e7d32 !important;
    color: white !important;
    border-color: #2e7d32 !important;
    font-weight: 600;
    margin-left: auto;
}

.filemaker-selection-actions-btn:hover {
    background: #1b5e20 !important;
}

/* Bulk mode indicator in action menu */
.filemaker-bulk-indicator {
    padding: 10px 15px;
    margin-bottom: 10px;
    background: #e8f4fd;
    border-radius: 4px;
    border-left: 3px solid #0073aa;
    color: #0073aa;
    font-weight: 500;
}

.filemaker-bulk-indicator .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

/* ==========================================
   Filters
   ========================================== */
.filemaker-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    padding: 15px;
    margin-bottom: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.filemaker-filter {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.filemaker-filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filemaker-filter-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
    cursor: pointer;
}

.filemaker-filter-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.filemaker-filter-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.filemaker-filter-radio-label {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.2s;
}

.filemaker-filter-radio-label:hover {
    border-color: #0073aa;
}

.filemaker-filter-radio-label:has(input:checked) {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.filemaker-filter-radio {
    display: none;
}

/* Active filter indicator */
.filemaker-filter.has-value .filemaker-filter-select {
    border-color: #0073aa;
    background: #e8f4fd;
}

/* Responsive */
@media (max-width: 768px) {
    .filemaker-filters {
        flex-direction: column;
    }
    
    .filemaker-filter {
        width: 100%;
    }
    
    .filemaker-filter-select {
        width: 100%;
    }
}

/* ===================================
   Bulk Email Loading
   =================================== */
.filemaker-bulk-email-loading {
    background: white;
    padding: 30px;
    border-radius: 8px;
    text-align: center;
    max-width: 400px;
    margin: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.filemaker-bulk-email-loading .fm-bulk-email-note {
    font-size: 13px;
    color: #888;
    margin-top: 10px;
}

/* ===================================
   No Actions Available Message
   =================================== */
.filemaker-no-actions {
    padding: 30px;
    text-align: center;
    color: #666;
}

.filemaker-no-actions p {
    margin: 0 0 10px 0;
}

.filemaker-no-actions .hint {
    font-size: 13px;
    color: #999;
    font-style: italic;
}