/* Rich Tagger Styles */
/* 
 * Complete styling for the Rich Tagger editor component
 * Includes toolbar, editor area, buttons, dropdowns, and content formatting
 */

/* ========================================
   TOOLBAR CONTAINER AND LAYOUT
   ======================================== */

/* Main toolbar container with flexbox layout */
.rte-toolbar {
    border: 1px solid #dee2e6;
    border-bottom: none;
    background-color: #f8f9fa;
    border-radius: 0.375rem 0.375rem 0 0;
    display: flex;
    gap: 0.25rem 0.25rem !important;
    row-gap: 0.5rem !important;
    justify-content: flex-start !important;
    align-items: flex-start !important;
    margin: 0 !important;
    padding: 0.75rem !important;
}

/* Ensure padding is applied to both basic and advanced toolbars */
.rte-toolbar.d-flex {
    padding: 0.75rem !important;
}

/* Remove any inherited margins/padding from toolbar children */
.rte-toolbar > * {
    margin: 0 !important;
}

/* ========================================
   TOOLBAR BUTTONS AND CONTROLS
   ======================================== */

/* Base styling for all toolbar buttons */
.rte-toolbar-btn {
    border: 1px solid #dee2e6;
    background-color: white;
    border-radius: 0.25rem;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
    text-decoration: none;
    min-width: 32px !important;
    height: 32px !important;
    padding: 0.25rem !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Button hover effect */
.rte-toolbar-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

/* Active button state (when formatting is applied) */
.rte-toolbar-btn.active {
    background-color: #0d6efd !important;
    color: white !important;
    border-color: #0d6efd !important;
}

/* Remove margins from icons within buttons */
.rte-toolbar-btn i {
    margin: 0 !important;
}

/* Extra padding for dropdown buttons */
.rte-toolbar-btn.dropdown-toggle {
    padding-left: 0.6rem !important;
    padding-right: 0.6rem !important;
    min-width: auto !important;
}

/* ========================================
   TOOLBAR DIVIDERS AND SEPARATORS
   ======================================== */

/* Visual dividers between button groups */
.toolbar-divider {
    margin: 0 4px !important;
}

/* ========================================
   EDITOR AREA AND CONTENT
   ======================================== */

/* Main content editor container */
.rte-editor {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 0 0.375rem 0.375rem;
    padding: 12px;
    min-height: 300px;
    background-color: white;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.5;
}

/* Editor focus state with blue border and shadow */
.rte-editor:focus {
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* ========================================
   EDITOR CONTENT FORMATTING
   ======================================== */

/* Paragraph spacing within editor */
.rte-editor p {
    margin-bottom: 1rem;
}

.rte-editor p:last-child {
    margin-bottom: 0;
}

/* List styling within editor */
.rte-editor ul, .rte-editor ol {
    margin-bottom: 1rem;
    padding-left: 2rem;
}

/* Blockquote styling within editor */
.rte-editor blockquote {
    border-left: 4px solid #dee2e6;
    padding-left: 1rem;
    margin: 1rem 0;
    font-style: italic;
    color: #6c757d;
}

/* ========================================
   COLOR PICKER DROPDOWN STYLING
   ======================================== */

/* Base color grid dropdown (hidden by default) */
.color-grid-dropdown {
    display: none;
}

/* Show color grid when dropdown is active */
.color-grid-dropdown.show {
    display: grid !important;
}

/* ========================================
   FULLSCREEN MODE STYLING
   ======================================== */

/* Fullscreen mode container */
.rte-fullscreen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background-color: white !important;
    z-index: 9999 !important;
    padding: 20px !important;
}

/* Editor height in fullscreen mode */
.rte-fullscreen .rte-editor {
    height: calc(100vh - 200px) !important;
    max-height: none !important;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .rte-toolbar {
        padding: 0.5rem !important;
        gap: 0.2rem !important;
    }
    
    .rte-toolbar-btn {
        min-width: 28px !important;
        height: 28px !important;
        font-size: 0.8rem;
    }
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* Focus outline for keyboard navigation */
.rte-toolbar-btn:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Disabled button styling */
.rte-toolbar-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f8f9fa;
}

/* ========================================
   ANIMATION AND TRANSITIONS
   ======================================== */

/* Smooth transitions for button states */
.rte-toolbar-btn {
    transition: all 0.15s ease-in-out;
}

/* Dropdown menu animation */
.dropdown-menu {
    transition: opacity 0.15s ease-in-out;
}

/* ========================================
   CUSTOM RICH TAGGER SPECIFIC STYLES
   ======================================== */

/* Container for Rich Tagger specific styling */
.rich-tagger-container {
    border-radius: 0.375rem;
    overflow: hidden;
}

/* Special styling for Rich Tagger fullscreen mode */
.rich-tagger-container.rte-fullscreen {
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.3);
}

/* Rich Tagger editor enhanced focus state */
.rich-tagger-container .rte-editor:focus {
    border-color: #198754;
    box-shadow: 0 0 0 0.25rem rgba(25, 135, 84, 0.25);
}