/* ===== Page Builder Public Rendering Styles ===== */

/* Section Base */
.pb-section {
    position: relative;
    width: 100%;
}

/* Container */
.pb-container {
    width: 100%;
    padding-right: 15px;
    padding-left: 15px;
}

/* Row and Column Layout */
.pb-row {
    /* Layout can be flexbox OR grid depending on content
       Grid layout is applied inline for multi-column sections
       This fallback handles single-column sections */
    display: block;
    width: 100%;
}

.pb-column {
    position: relative;
    width: 100%;
}

/* Responsive Column Behavior */
@media (max-width: 767px) {
    .pb-row {
        flex-direction: column;
    }
    
    .pb-column {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
}

/* Section Type Styles */
.pb-section-hero {
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-size: cover;
    background-position: center;
}

.pb-section-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 20px;
}

.pb-section-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

/* Widget Base */
.pb-widget {
    margin-bottom: 20px;
}

.pb-widget:last-child {
    margin-bottom: 0;
}

/* Widget Type Styles */
.pb-widget-rich-text {
    /* Inherits from main content styles */
}

.pb-widget-image {
    text-align: center;
}

.pb-widget-image img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
}

.pb-widget-button {
    text-align: center;
    padding: 20px 0;
}

.pb-widget-spacer {
    /* Height set inline via style attribute */
}

.pb-widget-divider {
    margin: 30px 0;
}

.pb-widget-divider hr {
    border: 0;
    border-top: 1px solid #dee2e6;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadein {
    animation: fadeIn 0.6s ease-out;
}

.animate-slideup {
    animation: slideUp 0.6s ease-out;
}

.animate-slidedown {
    animation: slideDown 0.6s ease-out;
}

/* Utility Classes */
.pb-text-left {
    text-align: left;
}

.pb-text-center {
    text-align: center;
}

.pb-text-right {
    text-align: right;
}

.pb-text-justify {
    text-align: justify;
}

/* Responsive Utilities */
@media (max-width: 575px) {
    .pb-hide-mobile {
        display: none !important;
    }
}

@media (min-width: 576px) and (max-width: 991px) {
    .pb-hide-tablet {
        display: none !important;
    }
}

@media (min-width: 992px) {
    .pb-hide-desktop {
        display: none !important;
    }
}

/* Preview Mode (for admin preview) */
.preview-mode .pb-section {
    border: 2px dashed #007bff;
    margin-bottom: 10px;
}

.preview-mode .pb-widget {
    border: 1px dashed #6c757d;
    padding: 10px;
}
