/*
 * This file is part of Grexgo.
 * (c) Wess Soft <contact@wess-soft.com>
 */

/* Trix Field Wrapper */
.trix-field-wrapper {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* Trix Toolbar - matches app theme */
.trix-field-wrapper trix-toolbar {
    background: white !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 8px 8px 0 0 !important;
    padding: 8px 12px !important;
    border-bottom: none !important;
}

.trix-field-wrapper trix-toolbar .trix-button-row {
    display: flex !important;
    gap: 4px !important;
    align-items: center !important;
}

.trix-field-wrapper trix-toolbar .trix-button-group {
    display: flex !important;
    gap: 4px !important;
    border: none !important;
    margin-bottom: 0 !important;
}

.trix-field-wrapper trix-toolbar .trix-button {
    background: white !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: 8px !important;
    color: var(--gray-700) !important;
    padding: 6px 12px !important;
    font-family: 'Lufga', sans-serif !important;
    font-size: 14px !important;
    font-weight: 400 !important;
    line-height: 20px !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 32px !important;
    height: 32px !important;
}

.trix-field-wrapper trix-toolbar .trix-button:hover:not(:disabled) {
    background: var(--gray-50) !important;
    border-color: var(--gray-300) !important;
    color: var(--gray-800) !important;
}

.trix-field-wrapper trix-toolbar .trix-button.trix-active {
    background: var(--green-50) !important;
    border-color: var(--green-400) !important;
    color: var(--green-600) !important;
    font-weight: 500 !important;
}

.trix-field-wrapper trix-toolbar .trix-button:disabled {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
}

/* Trix Editor - matches input-field styling */
.trix-field-wrapper trix-editor {
    border: 1px solid var(--gray-200) !important;
    border-radius: 0 0 8px 8px !important;
    padding: 12px !important;
    min-height: 200px !important;
    background: var(--gray-25) !important;
    outline: none !important;
    transition: all 0.2s ease !important;
    overflow-y: auto !important;
}

.trix-field-wrapper trix-editor:hover {
    border-color: var(--green-300) !important;
}

.trix-field-wrapper trix-editor:focus {
    border-color: var(--green-400) !important;
    box-shadow: 0 0 0 3px var(--green-20) !important;
    background: white !important;
}

/* Trix Editor Disabled State */
.trix-field-wrapper trix-editor.trix-disabled {
    background: var(--gray-50) !important;
    cursor: not-allowed !important;
    opacity: 0.6 !important;
    pointer-events: none !important;
}

.trix-field-wrapper trix-editor.trix-disabled:hover {
    border-color: var(--gray-200) !important;
    box-shadow: none !important;
}

/* Hide toolbar when disabled */
.trix-field-wrapper:has(trix-editor.trix-disabled) trix-toolbar {
    opacity: 0.5 !important;
    pointer-events: none !important;
}

/* Trix Content Styling (for display pages) */
.trix-content h1 {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--gray-900);
}

.trix-content h2 {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 0.875rem;
    color: var(--gray-900);
}

.trix-content h3 {
    font-size: 1.25rem;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    color: var(--gray-900);
}

.trix-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.trix-content strong {
    font-weight: 600;
}

.trix-content em {
    font-style: italic;
}

.trix-content ul,
.trix-content ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.trix-content li {
    margin-bottom: 0.5rem;
}
