/* =================================================================
   LearnFlash Layout & Common Components
   Replaces Bootstrap dependencies with custom CSS
   ================================================================= */

/* === RESET & BASE === */
* {
    box-sizing: border-box;
}

/* === GLOBAL FONT INHERITANCE === */
/* Ensure all LearnFlash elements inherit parent theme/Elementor fonts */
[class^="learnflash-"],
[class*=" learnflash-"],
[class^="lf-"],
[class*=" lf-"] {
    font-family: inherit;
}

/* === LAYOUT CONTAINERS === */
.lf-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

.lf-container-fluid {
    width: 100%;
    padding: 0 15px;
}

/* === SPACING UTILITIES === */
.lf-my-1 { margin-top: 0.25rem; margin-bottom: 0.25rem; }
.lf-my-2 { margin-top: 0.5rem; margin-bottom: 0.5rem; }
.lf-my-3 { margin-top: 1rem; margin-bottom: 1rem; }
.lf-my-4 { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.lf-my-5 { margin-top: 3rem; margin-bottom: 3rem; }

.lf-mb-1 { margin-bottom: 0.25rem; }
.lf-mb-2 { margin-bottom: 0.5rem; }
.lf-mb-3 { margin-bottom: 1rem; }
.lf-mb-4 { margin-bottom: 1.5rem; }
.lf-mb-5 { margin-bottom: 3rem; }

.lf-me-2 { margin-right: 0.5rem; }
.lf-me-3 { margin-right: 1rem; }
.lf-ms-3 { margin-left: 1rem; }
.lf-ms-auto { margin-left: auto; }

.lf-py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }

/* === FLEXBOX UTILITIES === */
.lf-d-flex {
    display: flex;
}

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

.lf-align-items-center {
    align-items: center;
}

.lf-align-items-start {
    align-items: flex-start;
}

.lf-justify-content-between {
    justify-content: space-between;
}

.lf-justify-content-center {
    justify-content: center;
}

.lf-justify-content-end {
    justify-content: flex-end;
}

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

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

/* === GRID SYSTEM === */
.lf-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px;
}

.lf-col {
    flex: 1 0 0%;
    padding: 0 15px;
}

.lf-col-auto {
    flex: 0 0 auto;
    width: auto;
    padding: 0 15px;
}

.lf-col-1 { flex: 0 0 8.333333%; width: 8.333333%; padding: 0 15px; }
.lf-col-2 { flex: 0 0 16.666667%; width: 16.666667%; padding: 0 15px; }
.lf-col-3 { flex: 0 0 25%; width: 25%; padding: 0 15px; }
.lf-col-4 { flex: 0 0 33.333333%; width: 33.333333%; padding: 0 15px; }
.lf-col-6 { flex: 0 0 50%; width: 50%; padding: 0 15px; }
.lf-col-8 { flex: 0 0 66.666667%; width: 66.666667%; padding: 0 15px; }
.lf-col-12 { flex: 0 0 100%; width: 100%; padding: 0 15px; }

/* === BUTTONS === */
.lf-btn {
    display: inline-block;
    padding: 8px 16px;
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    border-radius: 6px;
    transition: all 0.2s ease;
    background: none;
}

.lf-btn:hover {
    text-decoration: none;
}

.lf-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 85, 255, 0.25);
}

.lf-btn-primary {
    background-color: #0055ff;
    border-color: #0055ff;
    color: #fff;
}

.lf-btn-primary:hover {
    background-color: #0044cc;
    border-color: #0044cc;
    color: #fff;
}

.lf-btn-outline-secondary {
    background-color: transparent;
    border-color: #6c757d;
    color: #6c757d;
}

.lf-btn-outline-secondary:hover {
    background-color: #6c757d;
    border-color: #6c757d;
    color: #fff;
}

.lf-btn-outline-secondary.disabled,
.lf-btn-outline-secondary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.lf-btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* === PROGRESS BARS === */
.lf-progress {
    display: flex;
    height: 8px;
    overflow: hidden;
    font-size: 0.75rem;
    background-color: #e9ecef;
    border-radius: 4px;
}

.lf-progress-bar {
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #0055ff;
    transition: width 0.6s ease;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 600;
}

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

.lf-badge-rounded-pill {
    border-radius: 50rem;
}

/* === DISPLAY UTILITIES === */
.lf-d-none {
    display: none;
}

.lf-d-block {
    display: block;
}

.lf-d-inline-block {
    display: inline-block;
}

/* === TEXT UTILITIES === */
.lf-text-end {
    text-align: right;
}

.lf-text-center {
    text-align: center;
}

.lf-text-decoration-none {
    text-decoration: none;
}

.lf-text-decoration-none:hover {
    text-decoration: none;
}

/* === BACKGROUND UTILITIES === */
.lf-bg-light {
    background-color: #f8f9fa;
}

/* === LIST UTILITIES === */
.lf-list-unstyled {
    padding-left: 0;
    list-style: none;
}

/* === RESPONSIVE UTILITIES === */
@media (max-width: 767.98px) {
    .lf-d-md-none {
        display: none;
    }
    
    .lf-d-md-block {
        display: block;
    }
    
    .lf-d-md-inline-block {
        display: inline-block;
    }
    
    /* Mobile grid adjustments */
    .lf-col-md-1, .lf-col-md-2, .lf-col-md-3, .lf-col-md-4, 
    .lf-col-md-6, .lf-col-md-8, .lf-col-md-12 {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .lf-row {
        margin: 0 -10px;
    }
    
    .lf-col, .lf-col-auto, [class*="lf-col-"] {
        padding: 0 10px;
    }
    
    .lf-container {
        padding: 0 10px;
    }
}

@media (min-width: 768px) {
    .lf-d-md-none {
        display: none;
    }
    
    .lf-d-md-block {
        display: block;
    }
    
    .lf-d-md-inline-block {
        display: inline-block;
    }
    
    /* Desktop grid sizes */
    .lf-col-md-1 { flex: 0 0 8.333333%; width: 8.333333%; }
    .lf-col-md-2 { flex: 0 0 16.666667%; width: 16.666667%; }
    .lf-col-md-3 { flex: 0 0 25%; width: 25%; }
    .lf-col-md-4 { flex: 0 0 33.333333%; width: 33.333333%; }
    .lf-col-md-6 { flex: 0 0 50%; width: 50%; }
    .lf-col-md-8 { flex: 0 0 66.666667%; width: 66.666667%; }
    .lf-col-md-12 { flex: 0 0 100%; width: 100%; }
}

/* === ACCORDION COMPONENT === */
.lf-accordion {
    border-radius: 8px;
    overflow: hidden;
}

.lf-accordion-item {
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.125);
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
}

.lf-accordion-header {
    margin-bottom: 0;
}

.lf-accordion-button {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    padding: 1rem 1.25rem;
    font-size: 1rem;
    color: #212529;
    text-align: left;
    background-color: #fff;
    border: 0;
    border-radius: 0;
    overflow-anchor: none;
    transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out, border-radius 0.15s ease;
    cursor: pointer;
}

.lf-accordion-button:not(.collapsed) {
    color: #0c63e4;
    background-color: #e7f1ff;
    box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.125);
}

.lf-accordion-button:focus {
    z-index: 3;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.lf-accordion-button::after {
    flex-shrink: 0;
    width: 1.25rem;
    height: 1.25rem;
    margin-left: auto;
    content: "";
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23212529'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-size: 1.25rem;
    transition: transform 0.2s ease-in-out;
}

.lf-accordion-button:not(.collapsed)::after {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%230c63e4'%3e%3cpath fill-rule='evenodd' d='M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z'/%3e%3c/svg%3e");
    transform: rotate(-180deg);
}

.lf-accordion-collapse {
    border-top: 1px solid rgba(0, 0, 0, 0.125);
}

.lf-accordion-body {
    padding: 1rem 1.25rem;
}

/* === COLLAPSE COMPONENT === */
.lf-collapse:not(.show) {
    display: none;
}

.lf-collapse.show {
    display: block;
}

/* === SMALL UTILITIES === */
.lf-small {
    font-size: 0.875em;
}

/* === ROUNDED UTILITIES === */
.lf-rounded-top {
    border-top-left-radius: 0.375rem;
    border-top-right-radius: 0.375rem;
}

.lf-rounded-bottom {
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
} 