@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;
}

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;
    }
}