/*!
 * Mastors Flexer v1.0.0
 * Comprehensive Flexbox Utility Library
 * https://github.com/KEHEM-IT/Mastors-Flexer
 * Licensed under MIT
 * Author: KEHEM-IT
 */

/* ===============================
   FLEX UTILITIES - CSS CLASSES
   =============================== */

/* Basic Flex Containers */
.flex { display: flex; }
.flex-row { display: flex; flex-direction: row; }
.flex-col { display: flex; flex-direction: column; }
.flex-row-reverse { display: flex; flex-direction: row-reverse; }
.flex-col-reverse { display: flex; flex-direction: column-reverse; }
.flex-inline { display: inline-flex; }

/* Flex Wrap */
.flex-wrap { flex-wrap: wrap; }
.flex-wrap-reverse { flex-wrap: wrap-reverse; }
.flex-nowrap { flex-wrap: nowrap; }

/* Justify Content */
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-around { justify-content: space-around; }
.justify-evenly { justify-content: space-evenly; }

/* Align Items */
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }
.items-center { align-items: center; }
.items-baseline { align-items: baseline; }
.items-stretch { align-items: stretch; }

/* Align Content */
.content-start { align-content: flex-start; }
.content-end { align-content: flex-end; }
.content-center { align-content: center; }
.content-between { align-content: space-between; }
.content-around { align-content: space-around; }
.content-evenly { align-content: space-evenly; }
.content-stretch { align-content: stretch; }

/* Align Self */
.self-auto { align-self: auto; }
.self-start { align-self: flex-start; }
.self-end { align-self: flex-end; }
.self-center { align-self: center; }
.self-stretch { align-self: stretch; }
.self-baseline { align-self: baseline; }

/* Flex Grow */
.flex-grow-0 { flex-grow: 0; }
.flex-grow { flex-grow: 1; }
.flex-grow-2 { flex-grow: 2; }
.flex-grow-3 { flex-grow: 3; }

/* Flex Shrink */
.flex-shrink-0 { flex-shrink: 0; }
.flex-shrink { flex-shrink: 1; }
.flex-shrink-2 { flex-shrink: 2; }
.flex-shrink-3 { flex-shrink: 3; }

/* Flex Basis */
.flex-basis-0 { flex-basis: 0; }
.flex-basis-auto { flex-basis: auto; }
.flex-basis-full { flex-basis: 100%; }
.flex-basis-1-2 { flex-basis: 50%; }
.flex-basis-1-3 { flex-basis: 33.333333%; }
.flex-basis-2-3 { flex-basis: 66.666667%; }
.flex-basis-1-4 { flex-basis: 25%; }
.flex-basis-3-4 { flex-basis: 75%; }

/* Flex Shorthand */
.flex-1 { flex: 1 1 0%; }
.flex-auto { flex: 1 1 auto; }
.flex-initial { flex: 0 1 auto; }
.flex-none { flex: none; }

/* Gap Utilities */
.gap-0 { gap: 0; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-5 { gap: 1.25rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-10 { gap: 2.5rem; }
.gap-12 { gap: 3rem; }
.gap-16 { gap: 4rem; }

/* Row Gap */
.gap-y-0 { row-gap: 0; }
.gap-y-1 { row-gap: 0.25rem; }
.gap-y-2 { row-gap: 0.5rem; }
.gap-y-3 { row-gap: 0.75rem; }
.gap-y-4 { row-gap: 1rem; }
.gap-y-6 { row-gap: 1.5rem; }
.gap-y-8 { row-gap: 2rem; }

/* Column Gap */
.gap-x-0 { column-gap: 0; }
.gap-x-1 { column-gap: 0.25rem; }
.gap-x-2 { column-gap: 0.5rem; }
.gap-x-3 { column-gap: 0.75rem; }
.gap-x-4 { column-gap: 1rem; }
.gap-x-6 { column-gap: 1.5rem; }
.gap-x-8 { column-gap: 2rem; }

/* Order */
.order-first { order: -9999; }
.order-last { order: 9999; }
.order-none { order: 0; }
.order-1 { order: 1; }
.order-2 { order: 2; }
.order-3 { order: 3; }
.order-4 { order: 4; }
.order-5 { order: 5; }
.order-6 { order: 6; }

/* Common Layouts */
.flex-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

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

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

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

/* Responsive Flex Direction */
@media (max-width: 768px) {
    .flex-sm-col { flex-direction: column; }
    .flex-sm-row { flex-direction: row; }
}

@media (max-width: 1024px) {
    .flex-md-col { flex-direction: column; }
    .flex-md-row { flex-direction: row; }
}

/* Auto Margins for Spacing */
.ml-auto { margin-left: auto; }
.mr-auto { margin-right: auto; }
.mt-auto { margin-top: auto; }
.mb-auto { margin-bottom: auto; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-auto { margin-top: auto; margin-bottom: auto; }

/* Flex Equal Children */
.flex-equal > * { flex: 1; }

/* Flex Grid Simulation */
.flex-grid-2 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.flex-grid-2 > * {
    flex: 1 1 calc(50% - 0.5rem);
    max-width: calc(50% - 0.5rem);
}

.flex-grid-3 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.flex-grid-3 > * {
    flex: 1 1 calc(33.333% - 0.667rem);
    max-width: calc(33.333% - 0.667rem);
}

.flex-grid-4 {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}
.flex-grid-4 > * {
    flex: 1 1 calc(25% - 0.75rem);
    max-width: calc(25% - 0.75rem);
}

/* Responsive Flex Grid */
@media (max-width: 768px) {
    .flex-grid-2 > *,
    .flex-grid-3 > *,
    .flex-grid-4 > * {
        flex: 1 1 100%;
        max-width: 100%;
    }
}

/* Sticky Footer Layout */
.flex-sticky-footer {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
.flex-sticky-footer .content {
    flex: 1;
}

/* Fullscreen Center */
.flex-fullscreen-center {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
}

/* Sidebar Layouts */
.flex-sidebar-left {
    display: flex;
    gap: 1rem;
}
.flex-sidebar-left > :first-child {
    flex: 0 0 250px;
}
.flex-sidebar-left > :last-child {
    flex: 1;
}

.flex-sidebar-right {
    display: flex;
    gap: 1rem;
}
.flex-sidebar-right > :first-child {
    flex: 1;
}
.flex-sidebar-right > :last-child {
    flex: 0 0 250px;
}

@media (max-width: 768px) {
    .flex-sidebar-left,
    .flex-sidebar-right {
        flex-direction: column;
    }
    .flex-sidebar-left > :first-child,
    .flex-sidebar-left > :last-child,
    .flex-sidebar-right > :first-child,
    .flex-sidebar-right > :last-child {
        flex: 1 1 auto;
    }
}

/* Card Layouts */
.flex-cards {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.flex-cards > * {
    flex: 1 1 280px;
    max-width: 100%;
}

/* Media Object */
.flex-media {
    display: flex;
    gap: 1rem;
}
.flex-media .media-image {
    flex: 0 0 100px;
}
.flex-media .media-content {
    flex: 1;
}

/* Navbar */
.flex-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}
@media (max-width: 768px) {
    .flex-navbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Utility Classes */
.flex-v-center {
    display: flex;
    align-items: center;
}

.flex-h-center {
    display: flex;
    justify-content: center;
}

.flex-stretch {
    display: flex;
    align-items: stretch;
}

.flex-baseline {
    display: flex;
    align-items: baseline;
}
