/* Rich Tagger Styles - Simplified Bootstrap Icons Version */
/* 
 * Simplified styling for the Rich Tagger editor with clean Bootstrap icons
 * Focuses on minimal, consistent icon-based toolbar buttons
 */

/* CSS Custom Properties for easy color customization */
:root {
    --rte-toolbar-bg: #f8f9fa; /* CHANGE THIS VALUE to customize toolbar background color */
    --metadata-labels-bg: #f8f9fa; /* CHANGE THIS VALUE to customize metadata labels background color */
}

/* Metadata labels styling (To:, CC:, BCC:, Subject:, Attach Files:) */
#send-pane .compose-form .input-group-text,
.tab-pane .compose-form .input-group-text,
.compose-form span.input-group-text {
    background-color: var(--metadata-labels-bg) !important;
}

/* ========================================
   TOOLBAR CONTAINER AND LAYOUT
   ======================================== */

/* Main toolbar container with flexbox layout */
.rte-toolbar {
    border: 1px solid #dee2e6;
    border-bottom: none;
    background-color: var(--rte-toolbar-bg);
    border-radius: 0 !important;
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
    padding: 0.5rem;
}

/* Remove any inherited margins/padding from toolbar children */
.rte-toolbar > * {
    margin: 0;
}

/* ========================================
   TOOLBAR BUTTONS - SIMPLIFIED BOOTSTRAP ICONS
   ======================================== */

/* Simple, clean button styling using only Bootstrap icons */
.rte-button,
.rte-toolbar button {
    background: transparent;
    border: none;
    padding: 0.25rem 0.5rem;
    cursor: pointer;
    color: #495057;
    font-size: 1.1rem;
    line-height: 1;
    transition: all 0.15s ease-in-out;
    border-radius: 0.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 32px;
}

/* Hover state - subtle background */
.rte-button:hover,
.rte-toolbar button:hover {
    background-color: rgba(0, 0, 0, 0.05);
    color: #212529;
}

/* Active/pressed state */
.rte-button:active,
.rte-toolbar button:active,
.rte-button.active,
.rte-toolbar button.active {
    background-color: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
}

/* Focus state for accessibility */
.rte-button:focus,
.rte-toolbar button:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Disabled state */
.rte-button:disabled,
.rte-toolbar button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Icons within buttons */
.rte-button i,
.rte-toolbar button i {
    font-size: 1.25rem;
    margin: 0;
}

/* Split color text icon - half red, half blue */
.text-color-split {
    background: linear-gradient(90deg, #dc3545 50%, #0b5ed7 50%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

/* Template buttons - blue/primary color */
.rte-button[title*="Template"] i {
    color: #0b5ed7 !important;
}

/* List icons - back to standard size for consistency */

/* Force square edges - override any Bootstrap or other CSS */
.rte-toolbar,
.rte-editor,
#compose-editor .rte-toolbar,
#compose-editor .rte-editor,
#compose-editor .border {
    border-radius: 0 !important;
}

/* Make rich-tagger fill available space within send tab */
#compose-editor {
    height: auto;
    min-height: 400px;
    max-height: calc(100vh - 400px);
    display: flex;
    flex-direction: column;
}

#compose-editor .rte-editor {
    flex: 1;
    min-height: 350px;
    max-height: calc(100vh - 450px);
    overflow-y: auto;
}

/* Dropdown buttons */
.rte-toolbar .dropdown-toggle {
    padding-right: 0.75rem;
}

/* Remove dropdown arrow for cleaner look */
.rte-toolbar .dropdown-toggle::after {
    display: none;
}

/* ========================================
   TOOLBAR DIVIDERS AND SEPARATORS
   ======================================== */

/* Subtle visual dividers between button groups */
.toolbar-divider {
    width: 1px;
    height: 20px;
    background-color: #dee2e6;
    margin: 0 0.25rem;
    align-self: center;
}

/* ========================================
   EDITOR AREA AND CONTENT
   ======================================== */

/* Main content editor container */
.rte-editor {
    border: 1px solid #dee2e6;
    border-top: none;
    border-radius: 0 !important;
    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;
}

/* ========================================
   DROPDOWN STYLING
   ======================================== */

/* Clean dropdown menus */
.rte-toolbar .dropdown-menu {
    border: 1px solid #dee2e6;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    padding: 0.25rem;
}

/* Color picker grid dropdown */
.color-grid-dropdown {
    display: none;
}

.color-grid-dropdown.show {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    gap: 4px;
    padding: 0.5rem;
}

/* Color swatches */
.color-swatch {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #dee2e6;
    transition: transform 0.1s ease;
}

.color-swatch:hover {
    transform: scale(1.1);
    border-color: #495057;
}

/* ========================================
   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,
    .rte-button {
        min-width: 26px !important;
        height: 26px !important;
        font-size: 0.75rem !important;
        border-width: 2px !important;
    }
    
    .rte-toolbar-btn i,
    .rte-button i {
        font-size: 0.75rem !important;
    }
}

/* ========================================
   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;
}

/* ========================================
   RESPONSIVE ADJUSTMENTS
   ======================================== */

@media (max-width: 576px) {
    .rte-toolbar {
        padding: 0.375rem;
    }
    
    .rte-button,
    .rte-toolbar button {
        min-width: 28px;
        height: 28px;
        padding: 0.25rem;
    }
    
    .rte-button i,
    .rte-toolbar button i {
        font-size: 1.1rem;
    }
}
