/**
 * RAS Template Bridge - Frontend Styles
 */

/* Flexible content container */
.ras-flexible-content {
    margin: 0;
    padding: 0;
}

/* Image Text Block - Hide all media widgets by default, let JS show the correct one */
.media_col_img,
.media_col_vid,
.media_col_gal,
.media_col_sli {
    display: none;
}

/* Only show widgets that are marked as active by JavaScript */
.media_col_img[data-ras-active="true"],
.media_col_vid[data-ras-active="true"],
.media_col_gal[data-ras-active="true"],
.media_col_sli[data-ras-active="true"] {
    display: block;
}

/* Individual layout wrappers */
.ras-layout {
    margin-bottom: 20px;
}

.ras-layout:last-child {
    margin-bottom: 0;
}

/* Fallback layout styles */
.ras-fallback-layout {
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 4px;
    margin-bottom: 20px;
}

.ras-fallback-message {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 40px 20px;
    background: #fff;
    border: 2px dashed #ddd;
    border-radius: 4px;
}

/* Text block fallback */
.ras-text-block {
    max-width: 100%;
}

.ras-text-title {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 24px;
    line-height: 1.3;
}

.ras-text-content {
    color: #555;
    line-height: 1.6;
}

.ras-text-content p {
    margin-bottom: 15px;
}

.ras-text-content p:last-child {
    margin-bottom: 0;
}

/* Image block fallback */
.ras-image-block {
    max-width: 100%;
}

.ras-image-figure {
    margin: 0;
    text-align: center;
}

.ras-image {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 4px;
}

.ras-image-caption {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    font-style: italic;
    text-align: center;
}

/* Image + Text block fallback */
.ras-image-text-block {
    display: flex;
    gap: 30px;
    align-items: flex-start;
    flex-wrap: wrap;
}

.ras-image-text-block .ras-image-block {
    flex: 0 0 300px;
    min-width: 250px;
}

.ras-image-text-block .ras-text-block {
    flex: 1;
    min-width: 250px;
}

/* Error states */
.ras-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

/* Debug info */
.ras-debug-info {
    background: #f0f0f0;
    padding: 10px;
    margin: 10px 0;
    border-left: 4px solid #0073aa;
    font-size: 12px;
    font-family: monospace;
}

.ras-debug-info strong {
    color: #0073aa;
}

.ras-debug-info small {
    color: #666;
}

/* Unknown layout fallback */
.ras-unknown-layout {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 20px;
    color: #856404;
}

.ras-unknown-layout h3 {
    margin: 0 0 10px 0;
    color: #856404;
}

.ras-unknown-layout details {
    margin-top: 15px;
}

.ras-unknown-layout summary {
    cursor: pointer;
    font-weight: bold;
    color: #856404;
}

.ras-unknown-layout pre {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 3px;
    overflow-x: auto;
    font-size: 11px;
    margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .ras-layout {
        margin-bottom: 15px;
    }
    
    .ras-fallback-layout {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .ras-text-title {
        font-size: 20px;
    }
    
    .ras-image-text-block {
        flex-direction: column;
        gap: 20px;
    }
    
    .ras-image-text-block .ras-image-block,
    .ras-image-text-block .ras-text-block {
        flex: none;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .ras-fallback-layout {
        padding: 10px;
    }
    
    .ras-text-title {
        font-size: 18px;
    }
    
    .ras-fallback-message {
        padding: 20px 10px;
        font-size: 14px;
    }
}

/* RAS Manual Accordion Styles */
.ras-manual-accordion {
    /* Clear all styling - no padding, border, etc. */
    margin: 0;
    padding: 0;
    border: none;
    background: none;
    width: 100%;
}

.accordion-item {
    background: white;
    border: 1px solid black;
    border-radius: 15px;
    color: black;
    margin-bottom: 10px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.accordion-title {
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    user-select: none;
    transition: border-bottom 0.3s ease;
}

.accordion-title.active {
    border-bottom: 1px solid #f1f1f1;
}

.accordion-icon {
    font-size: 14px;
    transition: transform 0.3s ease;
    line-height: 1;
}

.accordion-icon.rotated {
    transform: rotate(180deg);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.accordion-content.open {
    max-height: 1000px; /* Adjust based on your content needs */
}

.accordion-content-inner {
    padding: 0 20px 20px 20px;
    color: black;
}

.accordion-content-inner p {
    margin: 0 0 15px 0;
    line-height: 1.6;
}

.accordion-content-inner p:last-child {
    margin-bottom: 0;
}

/* Role Badge Styles for Enhanced Member Display */
.ras-role-badge {
    display: inline-block;
    padding: 4px 8px;
    margin: 2px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 500;
    background: #f0f0f1;
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.ras-role-badge.ras-role-filtered {
    background: #007cba;
    color: white;
    border-color: #005a87;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.ras-role-badge.ras-role-level-0 {
    font-weight: bold;
    border-width: 2px;
}

.ras-role-badge.ras-role-level-1 {
    font-style: italic;
    background: rgba(70, 180, 80, 0.1);
    border-color: #46b450;
}

.ras-role-badge.ras-role-level-2 {
    background: rgba(255, 185, 0, 0.1);
    border-color: #ffb900;
}

.ras-role-badge.ras-role-level-3 {
    background: rgba(214, 54, 56, 0.1);
    border-color: #d63638;
}

/* Hover effects */
.ras-role-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Container for role badges */
.ras-member-roles {
    margin: 10px 0;
}

.ras-member-roles .ras-role-badge {
    margin-right: 4px;
    margin-bottom: 4px;
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .ras-role-badge {
        font-size: 11px;
        padding: 3px 6px;
        margin: 1px;
    }
}
