/* CSS HEX */
:root {
    --color-light-green: #acf39dff;
    --color-indian-red: #e85f5cff;
    --color-ice-blue: #9cfffaff;
    --color-wine: #773344ff;
    --color-pale-dogwood: #e3b5a4ff;
    --color-light-grey: #f0f0f0;
}

body {
    background-color: var(--color-light-green);
    font-family: Arial, sans-serif;
    color: #333333;
}

h1 {
    color: var(--color-indian-red);
}

h2 {
    color: var(--color-indian-red);
}



/* body {
    background-color: #f2f2f2;
    font-family: Arial, sans-serif;
    color: #333333;
}

h1 {
    color: #ff0000;
}


h2 {
    color: #ff0000;
} */

p {
    font-size: 16px;
    line-height: 1.5;
}


.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15px, 1fr));
    grid-gap: 25px;
    border: 1px solid black; /* This will add a 1px black border */
    padding: 5px; /* This will add some space between the border and the content */
}
.grid label {
    display: grid;
    grid-template-columns: 5fr;
    align-items: center;
    justify-items: start;
    grid-gap: 5px;
    border-bottom: 1px solid black; /* This will add a 1px black border at the bottom of each label */
}

.jumbotron {
    background-color: rgb(7, 7, 14);
    /* color: rgb(52, 70, 173); */
    color: #333333;
    width: 100%;
    /* Enhanced jumbotron layout with grid */
    overflow: hidden;
    word-wrap: break-word;
    padding: 1rem;
}

body {
    /* This will center the content and add padding on large screens */
    @media (min-width: 992px) {
        display: flex;
        justify-content: center;
        padding: 5px;
    }
}

.container {
    /* This will limit the width of the content and center it on large screens */
    @media (min-width: 992px) {
        max-width: 1800px;
        margin: 0 auto;
    }
}

.form-check-input {
    margin-right: 10px;
    border-right: 1px solid black; /* This will add a 1px black border on the right side of each checkbox */
}

form {
    width: 100%; /* Adjust this value as needed */
}

main {
    /* This will add some space between the content and the footer */
    width: 80%;
}
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--color-wine);
    padding: 10px 30px;
    width: 100%;
}

.navbar a {
    color: var(--color-light-green);
    background-color: var(--color-wine);
    text-decoration: none;
    margin: 0 30px;
    padding: 10px;
    flex-grow: 1;  /* Add this line */
    text-align: center;  /* Add this line if you want the text to be centered */
}

.navbar a:hover {
    color: var(--color-indian-red);
}

div.debug-info {
    background-color: var(--color-ice-blue);
    color: var(--color-wine);
    padding: 20px;
    margin: 20px;
    border: 1px solid var(--color-wine);
}


.phone-symbol {
    font-size: 1.2em;
    font-weight: bold;
    color: var(--color-indian-red);
    text-align: center;
    margin-bottom: 0.5rem;
    display: block;
    max-width: 100%;
    overflow: hidden;
    white-space: nowrap;
    padding: 0.25rem;
}

.jumbotron.grid label {
    white-space: nowrap;
}

table {
    border-collapse: collapse;
}

.column-border {
    border-right: 1px solid #ddd;
}
.column-border:last-child {
    border-right: none; /* Remove border for the last column */
}

input.checkbox-orange {
    background-color: orange;
}

option.blue {
    background-color: rgb(100, 100, 221);
    color: white;
}
option.white {
    background-color: white;
    color: black;
}
option.orange {
    background-color: rgb(236, 167, 38);
    color: black;
}
button.orange {
    background-color: rgb(236, 167, 38);
    color: black;
}
button.blue {
    background-color: rgb(100, 100, 221);
    color: white;
}

@media (max-width: 1200px) {
    .jumbotron .row {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    }
    .jumbotron .col-lg-4 {
        min-width: 300px;
        max-width: 450px;
    }
    .jumbotron .col-lg-4 .form-group label {
        min-width: 60px;
        max-width: 80px;
        font-size: 1em;
    }
    .phone-symbol {
        font-size: 1em;
    }
    select[id^="id_phone_"] {
        min-width: 200px;
    }
    .select2-container {
        min-width: 200px;
    }
    .select2-dropdown {
        min-width: 200px;
    }
}

@media (max-width: 768px) {
    .jumbotron .row {
        grid-template-columns: 1fr;
    }
    .jumbotron .col-lg-4 {
        min-width: 100%;
        max-width: 100%;
    }
    .jumbotron .col-lg-4 .form-group {
        flex-direction: column;
        align-items: stretch;
    }
    .jumbotron .col-lg-4 .form-group label {
        min-width: auto;
        max-width: none;
        margin-bottom: 0.5rem;
        text-align: center;
        font-size: 1.4em;
    }
    .jumbotron .col-lg-4 .form-group .controls {
        width: 100%;
    }
    .phone-symbol {
        font-size: 1.4em;
    }
    select[id^="id_phone_"] {
        font-size: 1.1em;
        min-width: 200px;
    }
    select[id^="id_phone_"] option {
        font-size: 1.1em;
        padding: 8px;
    }
    .select2-container {
        min-width: 200px;
    }
    .select2-dropdown {
        min-width: 200px;
    }
    .select2-results__option {
        font-size: 1.1em;
        padding: 10px;
    }
    
    /* Autopilot recommendations mobile layout */
    #auto-pilot-recommendations .list-group-item {
        padding: 1rem;
    }
    
    #auto-pilot-recommendations .list-group-item .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }
    
    #auto-pilot-recommendations .list-group-item .d-flex.justify-content-between > div:first-child {
        display: flex;
        flex-wrap: wrap;
        gap: 0.5rem;
        justify-content: flex-start;
        align-items: baseline;
    }
    
    #auto-pilot-recommendations .list-group-item .d-flex.justify-content-between > div:first-child span,
    #auto-pilot-recommendations .list-group-item .d-flex.justify-content-between > div:first-child strong {
        white-space: nowrap;
    }
    
    #auto-pilot-recommendations .list-group-item .d-flex.align-items-center {
        justify-content: center;
        gap: 1rem;
    }
    
    #auto-pilot-recommendations .add-pair-btn-known,
    #auto-pilot-recommendations .add-pair-btn-candidate {
        flex: 1;
        max-width: 150px;
        margin: 0;
        font-size: 0.9em;
        padding: 0.5rem 1rem;
    }
}

select[id^="id_phone_"] {
    width: 100% !important;
    min-width: 250px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
}

select[id^="id_phone_"] option {
    white-space: normal;
    padding: 5px;
    min-height: 1.5em;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
    /* Ensure options can display full text */
    min-width: 200px;
}

.form-group {
    margin-bottom: 1rem;
    max-width: 100%;
    overflow: visible;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    max-width: 100%;
    overflow: hidden;
}

.jumbotron .row {
    margin: 0;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 1rem;
    align-items: start;
}

.jumbotron .col-lg-4 {
    padding: 0.5rem;
    min-width: 350px;
    max-width: 500px;
    overflow: visible;
    position: relative;
    transform: translateZ(0);
}

/* Create horizontal layout with label to the left of select */
.jumbotron .col-lg-4 .form-group {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 1rem;
    width: 100%;
}

.jumbotron .col-lg-4 .form-group label {
    flex: 0 0 auto;
    margin-bottom: 0;
    text-align: center;
    min-width: 80px;
    max-width: 100px;
    font-size: 1.2em;
    font-weight: bold;
    color: var(--color-indian-red);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.jumbotron .col-lg-4 .form-group .controls {
    flex: 1;
    width: auto;
    min-width: 0;
}

.controls {
    width: 100%;
    overflow: visible;
}

.phone-graph-select {
    overflow: visible;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* Form button groups */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    max-width: 100%;
}

.btn-group > select {
    flex: 1;
    min-width: 200px;
    max-width: 100%;
    box-sizing: border-box;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    width: 3rem;
    height: 3rem;
}

/* Help text styling */
.help-text {
    background-color: #f8f9fa;
    border-left: 4px solid #007bff;
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 0.25rem;
}

.help-text p {
    margin-bottom: 0.5rem;
}

.help-text p:last-child {
    margin-bottom: 0;
}

.form-group .help-text {
    font-size: 0.875rem;
    color: #6c757d;
    margin-top: 0.25rem;
}

/* Select2 styling */
.select2-container {
    width: 100% !important;
    min-width: 250px;
    max-width: 100%;
    box-sizing: border-box;
}

.select2-dropdown {
    min-width: 250px;
    max-width: 100%;
    box-sizing: border-box;
}

.select2-results__option {
    white-space: normal;
    padding: 8px;
    min-height: 1.5em;
    font-size: 0.9em;
    line-height: 1.4;
    word-wrap: break-word;
}

/* Recommendation button styling */
.add-pair-btn-known,
.add-pair-btn-candidate {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
    white-space: nowrap;
}

.d-flex.align-items-center {
    gap: 0.5rem;
}

/* Ensure checkboxes are fully opaque */
input[type="checkbox"] {
    opacity: 1;
}

/* Fix blend checkboxes so the box itself is clickable */
#lesson-form .custom-control.custom-checkbox {
    padding-left: 0;               /* Move padding away from the container */
    display: flex;                /* Keep checkbox and label inline */
    align-items: center;
}

#lesson-form .custom-control.custom-checkbox .custom-control-input {
    position: static;             /* Bring checkbox into normal flow so it receives clicks */
    margin-right: 0.5rem;         /* Space between checkbox and text */
    z-index: auto;
}

#lesson-form .custom-control.custom-checkbox .custom-control-label {
    padding-left: 0;              /* Remove default left padding from label */
    margin-bottom: 0;
}

/* Template section styling */
.templates-section {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.template-item {
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
    background-color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
}

.template-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.template-item.selected {
    border-color: #007bff;
    background-color: #e7f3ff;
}

.template-main-info {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 1rem;
    min-width: 0;
}

.template-name-section {
    min-width: 0;
    flex: 1;
}

.template-name {
    font-weight: bold;
    color: #007bff;
    margin: 0;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-description {
    color: #6c757d;
    font-size: 0.75rem;
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.template-pairs {
    font-size: 0.75rem;
    color: #6c757d;
    white-space: nowrap;
    min-width: 120px;
    text-align: center;
}

.template-meta {
    font-size: 0.7rem;
    color: #6c757d;
    white-space: nowrap;
    min-width: 80px;
    text-align: center;
}

.template-actions {
    display: flex;
    gap: 0.25rem;
    align-items: center;
    min-width: 120px;
    justify-content: flex-end;
}

.template-actions .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
}

.save-template-form {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    padding: 1rem;
    margin-top: 1rem;
    display: none;
}

.template-buttons {
    margin-bottom: 1rem;
}

.no-templates-message {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 2rem;
}

.templates-scroll-container {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 0.25rem;
    background-color: #fff;
}

.template-filter .input-group-text {
    background-color: #f8f9fa;
    border-color: #dee2e6;
}

.template-filter #template-search {
    border-color: #dee2e6;
}

.template-filter #clear-search {
    border-color: #dee2e6;
}

.template-item.hidden {
    display: none !important;
}
