/* Main site styles */

/* Content preview in service page drafter */
.content-preview {
    max-height: 800px; /* Increased height to show more content */
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Fix bullet lists spacing in content display */
.content-container ul,
.content-container ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

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

.content-container li:last-child {
    margin-bottom: 0;
}

/* Fix double spacing in lists */
.content-container li p {
    margin-bottom: 0.25rem;
}

/* Improve table formatting */
.content-container table {
    width: 100%;
    margin-bottom: 1rem;
    border-collapse: collapse;
}

.content-container table td,
.content-container table th {
    padding: 0.5rem;
    border: 1px solid #dee2e6;
}

/* Image library styles */
.image-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.image-library-item {
    position: relative;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    overflow: hidden;
}

.image-library-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.image-library-actions {
    position: absolute;
    top: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 0 0 0 0.25rem;
    padding: 0.25rem;
}

.image-info {
    padding: 0.5rem;
    font-size: 0.875rem;
}

.image-info .filename {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.image-info .filesize {
    color: #6c757d;
}

/* Character Limit UI Elements */
.char-limit-progress {
    width: 100%;
    height: 6px;
    background-color: #e9ecef;
    border-radius: 3px;
    margin-top: 4px;
    overflow: hidden;
}

.char-limit-bar {
    height: 100%;
    border-radius: 3px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.char-limit-optimal {
    background-color: #28a745; /* Green */
}

.char-limit-warning {
    background-color: #ffc107; /* Yellow */
}

.char-limit-danger {
    background-color: #dc3545; /* Red */
}

.char-limit-message {
    font-size: 0.85rem;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Format status bar styles */
#format-status-bar {
    background-color: #f8f9fa;
    border-top: 1px solid #dee2e6;
    padding: 0.5rem;
    font-size: 0.875rem;
    color: #6c757d;
}

.format-tag {
    display: inline-block;
    padding: 0.125rem 0.5rem;
    border-radius: 3px;
    font-size: 0.8125rem;
    font-weight: 500;
    background-color: #e9ecef;
    margin-right: 0.25rem;
}

/* Heading format tags */
.format-tag.h1 {
    background-color: #f8d7da;
    color: #721c24;
    font-weight: 700;
}

.format-tag.h2 {
    background-color: #d1ecf1;
    color: #0c5460;
    font-weight: 700;
}

.format-tag.h3 {
    background-color: #fff3cd;
    color: #856404;
    font-weight: 600;
}

.format-tag.h4 {
    background-color: #d4edda;
    color: #155724;
    font-weight: 600;
}

.format-tag.h5 {
    background-color: #e2e3e5;
    color: #383d41;
    font-weight: 600;
}

.format-tag.h6 {
    background-color: #f8f9fa;
    color: #495057;
    font-weight: 600;
}

.format-tag.blockquote {
    background-color: #e9ecef;
    color: #495057;
    font-style: italic;
}

.format-tag.pre, .format-tag.code {
    background-color: #f1f1f1;
    color: #212529;
    font-family: monospace;
}

/* Custom summernote editor styling */
.note-editable h1 {
    font-size: 2.2rem !important;
    font-weight: 700 !important;
    color: #212529 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1rem !important;
    border-bottom: 2px solid #f8d7da !important;
    padding-bottom: 0.5rem !important;
}

.note-editable h2 {
    font-size: 1.8rem !important;
    font-weight: 700 !important;
    color: #0c5460 !important;
    margin-top: 1.5rem !important;
    margin-bottom: 1rem !important;
    border-bottom: 2px solid #d1ecf1 !important;
    padding-bottom: 0.25rem !important;
}

.note-editable h3 {
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    color: #856404 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.75rem !important;
}

.note-editable h4 {
    font-size: 1.25rem !important;
    font-weight: 600 !important;
    color: #155724 !important;
    margin-top: 1.25rem !important;
    margin-bottom: 0.75rem !important;
}

.note-editable h5 {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
    color: #383d41 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
}

.note-editable h6 {
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: #495057 !important;
    margin-top: 1rem !important;
    margin-bottom: 0.5rem !important;
}

.note-editable blockquote {
    font-style: italic !important;
    border-left: 3px solid #6c757d !important;
    padding-left: 1rem !important;
    margin-left: 0 !important;
    color: #6c757d !important;
}

.note-editable pre {
    background-color: #f1f1f1 !important;
    padding: 1rem !important;
    border-radius: 0.25rem !important;
    font-family: monospace !important;
    font-size: 0.875rem !important;
    overflow-x: auto !important;
}

.note-editable code {
    font-family: monospace !important;
    background-color: #f1f1f1 !important;
    padding: 0.125rem 0.25rem !important;
    border-radius: 0.25rem !important;
    font-size: 0.875rem !important;
}

/* Service page layout styling */
.service-detail-content .row {
    display: flex !important;
    flex-wrap: wrap !important;
}

/* Force the main content to be 2/3 width on desktop */
@media (min-width: 992px) {
    .service-detail-content .col-lg-8 {
        width: 66.666667% !important;
        flex: 0 0 66.666667% !important;
        max-width: 66.666667% !important;
        float: left !important;
        position: relative !important;
        order: 1 !important;
    }
    
    /* Force the sidebar to be 1/3 width and stay on the right on desktop */
    .service-detail-content .col-lg-4 {
        width: 33.333333% !important;
        flex: 0 0 33.333333% !important;
        max-width: 33.333333% !important;
        float: right !important;
        position: relative !important;
        order: 2 !important;
    }
}

/* On mobile, stack them vertically */
@media (max-width: 991.98px) {
    .service-detail-content .col-lg-8,
    .service-detail-content .col-lg-4 {
        width: 100% !important;
        flex: 0 0 100% !important;
        max-width: 100% !important;
        float: none !important;
    }
}

/* Service page content styling */
.service-detail-text h2.section-heading {
    color: #0056b3;
    font-size: 1.8rem;
    margin-top: 2rem;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 0.5rem;
    font-weight: 600;
}

.service-detail-text h3.subsection-heading {
    color: #495057;
    font-size: 1.4rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.service-detail-text p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.service-detail-text ul, 
.service-detail-text ol {
    margin-bottom: 1.5rem;
    padding-left: 1.25rem;
}

.service-detail-text ul li, 
.service-detail-text ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.service-detail-text a {
    color: #0056b3;
    text-decoration: none;
    font-weight: 500;
}

.service-detail-text a:hover {
    text-decoration: underline;
}

/* Style the content preview in the admin section */
.content-preview h2.section-heading {
    color: #0056b3;
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 0.5rem;
}

.content-preview h3.subsection-heading {
    color: #495057;
    font-size: 1.25rem;
    margin-top: 1.25rem;
    margin-bottom: 0.75rem;
}

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