/* Rich Text Editor Layout Styles */

/* Toolbar Container */
.format-toolbar {
    display: flex;
    border-radius: 8px 8px 0 0;
    padding: 8px;
    gap: 10px;
    flex-wrap: wrap;
    border-bottom: none;
    align-items: center;
}

/* Toolbar Section */
.toolbar-section {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 3px 5px;
    border-radius: 4px;
    height: 30px;
}

/* Format Button */
.format-button {
    border: none;
    border-radius: 4px;
    margin-right: 5px;
    padding: 5px 10px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    height: 28px;
    min-width: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Format Select Dropdown */
.format-select {
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 14px;
    min-width: 80px;
    height: 28px;
}

.format-select option {
    padding: 5px;
}

/* Number Input (Font Size) */
.format-input {
    width: 55px;
    border: none;
    border-radius: 4px;
    padding: 5px 8px;
    font-size: 14px;
    text-align: center;
    height: 28px;
}

/* Remove spinner buttons from number input */
.format-input::-webkit-inner-spin-button, 
.format-input::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    margin: 0;
}

/* Color Input */
input[type="color"] {
    -webkit-appearance: none;
    border: none;
    width: 25px;
    height: 25px;
    cursor: pointer;
    background-color: transparent;
    border-radius: 4px;
}

input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
}

input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Label for color inputs */
.toolbar-section label {
    font-size: 12px;
    margin-left: 5px;
}

/* Menu Container */
#menu-container {
    margin-bottom: 10px;
}

/* Typing Area (Editor container) */
.typing-area {
    border-radius: 0 0 8px 8px;
    overflow: hidden;
    position: relative;
    resize: both; /* Make the typing area resizable */
    min-width: 300px;
    min-height: 150px;
    max-width: 100%;
}

/* Typing Input Area */
.typing-input {
    min-height: 200px;
    padding: 15px;
    border: none;
    outline: none;
    resize: none;
    overflow-y: auto;
    line-height: 1.5;
    transition: background-color 0.3s;
}

/* Styling for content inside the editor */
.typing-input ul {
    padding-left: 25px;
    list-style-type: disc;
    margin-bottom: 10px;
}

.typing-input ol {
    padding-left: 25px;
    list-style-type: decimal;
    margin-bottom: 10px;
}

.typing-input li {
    margin-bottom: 5px;
}

.typing-input p,
.typing-input div {
    margin-bottom: 10px;
}

/* Font preview in dropdown */
#font-family option {
    font-size: 14px;
    padding: 5px;
}

/* Styling for text with letter/word spacing */
.typing-input span[style*="letter-spacing"] {
    border-bottom: 1px dotted rgba(102, 204, 255, 0.3);
}

.typing-input span[style*="word-spacing"] {
    border-bottom: 1px dotted rgba(153, 255, 102, 0.3);
}

/* WSV Controls Layout */
.wsv-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 30px;
}

.wsv-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    cursor: pointer;
    user-select: none;
    margin: 0;
    height: 100%;
}

/* WSV checkbox */
input[type="checkbox"]#wsvToggle {
    margin: 0;
    padding: 0;
}

/* Help icon */
.help-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    font-size: 14px;
    cursor: pointer;
}

/* Tooltip positioning */
.tooltip {
    position: fixed;
    z-index: 1000;
    display: none;
    width: 550px;
    max-width: 90vw;
    border-radius: 8px;
    padding: 15px;
    /* Prevent overflow */
    overflow-y: auto;
    max-height: 80vh;
}

.tooltip-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.tooltip-section {
    padding: 10px;
    border-radius: 5px;
}

/* Responsive styles for smaller screens */
@media (max-width: 768px) {
    .format-toolbar {
        flex-direction: column;
        gap: 5px;
    }
    
    .toolbar-section {
        width: 100%;
        justify-content: center;
    }
    
    .tooltip {
        width: 90vw;
        max-width: none;
        left: 5vw !important;
    }
    
    .tooltip-grid {
        grid-template-columns: 1fr;
    }
}