/* public/css/layout.css */
/* ==================== GRID SYSTEM ENHANCEMENTS ==================== */
.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
    grid-template-columns: repeat(4, 1fr);
}

@media (max-width: 991.98px) {
    .grid-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}

/* ==================== FLEX UTILITIES ==================== */
.flex-center {
    display: flex;
    align-items: center;
    justify-content: center;
}

.flex-between {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.flex-column {
    display: flex;
    flex-direction: column;
}

.flex-grow {
    flex-grow: 1;
}

.flex-shrink {
    flex-shrink: 1;
}

.flex-wrap {
    flex-wrap: wrap;
}

/* ==================== SPACING UTILITIES ==================== */
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }
.gap-4 { gap: 2rem; }
.gap-5 { gap: 3rem; }

/* ==================== COMPONENT SPECIFIC LAYOUTS ==================== */
.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

/* ==================== RESPONSIVE EMBEDS ==================== */
.embed-responsive {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 Aspect Ratio */
    height: 0;
    overflow: hidden;
}

.embed-responsive iframe,
.embed-responsive video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ==================== STICKY ELEMENTS ==================== */
.sticky-top {
    position: sticky;
    top: 0;
    z-index: 1020;
}

.sticky-bottom {
    position: sticky;
    bottom: 0;
    z-index: 1020;
}

/* ==================== OVERLAY EFFECTS ==================== */
.overlay {
    position: relative;
}

.overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, transparent, rgba(0,0,0,0.5));
    z-index: 1;
}

.overlay-content {
    position: relative;
    z-index: 2;
}

/* ==================== CARD LAYOUT VARIATIONS ==================== */
.card-horizontal {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.card-vertical {
    display: flex;
    flex-direction: column;
}

@media (max-width: 767.98px) {
    .card-horizontal {
        flex-direction: column;
    }
}

/* ==================== MODAL LAYOUT ==================== */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.modal-backdrop.show {
    display: block;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: var(--border-radius-lg);
    padding: 2rem;
    z-index: 1050;
    max-width: 90%;
    width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

@media (max-width: 575.98px) {
    .modal {
        width: 95%;
        padding: 1.5rem;
    }
}

/* ==================== LOADING LAYOUT ==================== */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid var(--light-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ==================== OFFCANVAS LAYOUT ==================== */
.offcanvas {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100%;
    background: white;
    box-shadow: var(--shadow-heavy);
    transition: right var(--transition-normal);
    z-index: 1045;
    padding: 2rem;
    overflow-y: auto;
}

.offcanvas.show {
    right: 0;
}

.offcanvas-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    display: none;
}

.offcanvas-backdrop.show {
    display: block;
}

/* ==================== TOAST NOTIFICATIONS ==================== */
.toast-container {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    z-index: 1060;
}

.toast {
    background: white;
    border-radius: var(--border-radius-md);
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-medium);
    min-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ==================== STEPPER/WIZARD LAYOUT ==================== */
.stepper {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 2rem 0;
}

.stepper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--light-color);
    z-index: 1;
}

.step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    background: var(--light-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: bold;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

/* ==================== TIMELINE LAYOUT ==================== */
.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--light-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
}

/* ==================== PRICING TABLE LAYOUT ==================== */
.pricing-table {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.pricing-card {
    text-align: center;
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    border: 2px solid var(--light-color);
    transition: all var(--transition-normal);
}

.pricing-card.featured {
    border-color: var(--primary-color);
    transform: scale(1.05);
    position: relative;
    overflow: hidden;
}

.pricing-card.featured::before {
    content: 'POPULAIRE';
    position: absolute;
    top: 10px;
    right: -30px;
    background: var(--primary-color);
    color: white;
    padding: 5px 30px;
    transform: rotate(45deg);
    font-size: 0.75rem;
    font-weight: bold;
}

@media (max-width: 767.98px) {
    .pricing-card.featured {
        transform: none;
    }
}

/* ==================== TESTIMONIALS LAYOUT ==================== */
.testimonials-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    gap: 2rem;
    padding: 1rem 0;
}

.testimonials-slider::-webkit-scrollbar {
    display: none;
}

.testimonial-slide {
    flex: 0 0 auto;
    width: 100%;
    scroll-snap-align: start;
}

@media (min-width: 768px) {
    .testimonial-slide {
        width: calc(50% - 1rem);
    }
}

@media (min-width: 992px) {
    .testimonial-slide {
        width: calc(33.333% - 1.33rem);
    }
}

/* ==================== TEAM MEMBER LAYOUT ==================== */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.team-member {
    text-align: center;
    transition: all var(--transition-normal);
}

.team-member:hover {
    transform: translateY(-5px);
}

.member-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    border: 5px solid white;
    box-shadow: var(--shadow-light);
}

/* ==================== PORTFOLIO/GRID LAYOUT ==================== */
.portfolio-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
    justify-content: center;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--light-color);
    background: white;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: all var(--transition-normal);
}

.filter-btn.active,
.filter-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.portfolio-item {
    border-radius: var(--border-radius-md);
    overflow: hidden;
    position: relative;
}

.portfolio-item img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    transition: transform var(--transition-normal);
}

.portfolio-item:hover img {
    transform: scale(1.05);
}

/* ==================== BREADCRUMBS ==================== */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    padding: 1rem 0;
    margin: 0;
}

.breadcrumb-item {
    margin-right: 0.5rem;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin-left: 0.5rem;
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--text-light);
}

.breadcrumb-item.active a {
    color: var(--primary-color);
    font-weight: bold;
}

/* ==================== PAGINATION ==================== */
.pagination {
    display: flex;
    justify-content: center;
    list-style: none;
    padding: 0;
    margin: 2rem 0;
}

.page-item {
    margin: 0 0.25rem;
}

.page-link {
    display: block;
    padding: 0.5rem 1rem;
    border: 1px solid var(--light-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-dark);
    transition: all var(--transition-normal);
    min-width: 44px;
    text-align: center;
}

.page-item.active .page-link {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.page-link:hover {
    background: var(--light-color);
    border-color: var(--text-light);
}

/* ==================== PROGRESS BARS ==================== */
.progress {
    height: 8px;
    background: var(--light-color);
    border-radius: 4px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    white-space: nowrap;
    vertical-align: baseline;
    border-radius: 10rem;
}

.badge-primary {
    background: var(--primary-color);
    color: white;
}

.badge-secondary {
    background: var(--secondary-color);
    color: white;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}