@tailwind base;
@tailwind components;
@tailwind utilities;

#card-element input {
    @apply border-gray-300 dark:border-gray-700 dark:bg-gray-900 dark:text-gray-300 focus:border-indigo-500 dark:focus:border-indigo-600 focus:ring-indigo-500 dark:focus:ring-indigo-600 rounded-md shadow-sm block mt-1 w-full;
}

trix-editor h2,
trix-editor strong,
trix-editor em,
trix-editor strike,
trix-editor ul,
trix-editor ol,
trix-editor li,
trix-editor p,
trix-editor blockquote,
trix-editor a,
trix-editor span {
    margin: 0;
    padding: 0;
    font-weight: normal;
    font-style: normal;
    text-decoration: none;
    list-style-type: disc;
}

trix-editor h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin: 0.67em 0;
}

trix-editor strong {
    font-weight: 1000;
}

trix-editor em {
    font-style: italic;
}

trix-editor strike {
    text-decoration: line-through;
}

trix-editor ul {
    list-style-type: disc;
    padding-left: 40px;
    margin: 1em 0;
}

trix-editor ol {
    list-style-type: decimal;
    padding-left: 40px;
    margin: 1em 0;
}

trix-editor li {
    margin: 0.5em 0;
}

trix-editor p {
    margin: 1em 0;
}

trix-editor blockquote {
    margin: 1em 0;
    padding-left: 40px;
    border-left: 2px solid #ddd;
}

trix-editor a {
    color: #007bff;
    text-decoration: underline;
}

trix-editor span {
    font-weight: inherit;
    font-style: inherit;
    text-decoration: inherit;
}

.fi-color-success {
    color: #38c172 !important;
}
.fi-color-danger {
    color: #e3342f !important;
}
.fi-color-primary[role="switch"] {
    background: #38c172 !important;
}
.fi-color-gray[role="switch"] {
    background: #e3342f !important;
}

svg.fi-input-wrp-icon.h-5.w-5.text-custom-500:is(.dark *) {
    fill: white;
}

/* Minimal inputs used in owner/member-details custom fields */
.mm-input {
    @apply block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-600;
}
.mm-select {
    @apply block w-full rounded-md border border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-blue-600;
}
.mm-checkbox {
    @apply h-4 w-4 text-blue-600 border-gray-300 dark:border-gray-600 rounded focus:ring-blue-600;
}

div#calendar:is(.dark *) {
    background: #FFFFFFaa;
    border-radius: 15px;
    padding: 10px;
    margin-top: 3em;
}

.swal2-html-container p {
    text-align: left;
    margin-bottom: 1em;
}

/* Tiptap Editor Table Styling - Match editor appearance in frontend */
.tiptap-editor-content table,
.prose table,
article table,
.ProseMirror table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    overflow: hidden;
    table-layout: auto;
}

.tiptap-editor-content table td,
.tiptap-editor-content table th,
.prose table td,
.prose table th,
article table td,
article table th,
.ProseMirror table td,
.ProseMirror table th {
    border: 2px solid #e5e7eb;
    padding: 0.75rem;
    vertical-align: top;
    box-sizing: border-box;
    position: relative;
    min-width: 1em;
}

.dark .tiptap-editor-content table td,
.dark .tiptap-editor-content table th,
.dark .prose table td,
.dark .prose table th,
.dark article table td,
.dark article table th,
.dark .ProseMirror table td,
.dark .ProseMirror table th {
    border-color: #374151;
}

.tiptap-editor-content table th,
.prose table th,
article table th,
.ProseMirror table th {
    font-weight: 700;
    text-align: left;
    background-color: #f9fafb;
}

.dark .tiptap-editor-content table th,
.dark .prose table th,
.dark article table th,
.dark .ProseMirror table th {
    background-color: #1f2937;
}

/* Column resize handle */
.ProseMirror .column-resize-handle {
    position: absolute;
    right: -2px;
    top: 0;
    bottom: 0;
    width: 4px;
    background-color: #3b82f6;
    pointer-events: none;
}

/* Selected cell */
.ProseMirror .selectedCell:after {
    z-index: 2;
    position: absolute;
    content: "";
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.15);
    pointer-events: none;
}

/* Tiptap content wrapper - removed @apply due to missing prose plugin */

/* Make tables responsive */
@media (max-width: 640px) {
    .tiptap-editor-content table,
    .prose table,
    article table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* Squeeze page lead-capture form (resources/views/squeeze-pages/partials/form.blade.php) */
.mm-form-field { margin-bottom: 16px; text-align: left; }
.mm-form-label { display:block; font-size:14px; font-weight:600; color:#334155; margin-bottom:6px; }
.mm-form-input { width:100%; padding:11px 14px; border:1.5px solid #e2e8f0; border-radius:8px; font-size:15px; color:#0f172a; box-sizing:border-box; transition:border-color .15s ease, box-shadow .15s ease; font-family:inherit; }
.mm-form-input:focus { outline:none; border-color:#3b82f6; box-shadow:0 0 0 3px rgba(59,130,246,.15); }
.mm-form-submit { width:100%; padding:13px; border:none; border-radius:8px; font-weight:700; font-size:15px; cursor:pointer; transition:opacity .15s ease; margin-top:4px; }
.mm-form-submit:hover { opacity:.9; }
.mm-form-error { color:#dc2626; font-size:13px; margin-top:4px; }
