/* =================================================================
   WORMWIZE CUSTOM STYLES
   Color Palette:
   - Sidebar: #612B4B (purple)
   - Orange: #EC5116
   - Text: Purple on white background
   ================================================================= */

/* ============================================
   SIDEBAR STYLING
   ============================================ */
.sidebar, .navbar, .navbar {
    background-color: #612B4B !important;
    color: white !important;
}

.sidebar .nav-link {
    color: white !important;
    transition: background-color 0.3s ease;
}

.sidebar .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.sidebar .nav-link.active {
    background-color: #EC5116 !important;
}

.sidebar h6,
.sidebar .sidebar-heading {
    color: white !important;
    opacity: 0.9;
}

/* ============================================
   BUTTON STYLING - ALL ORANGE
   ============================================ */
.btn-primary,
.btn-success,
.btn-info,
button[type="submit"],
.gc-save-button,
.gc-add-button,
.fbutton .add,
.btn-request-report,
.form-button-save, .form-button-box input {
    background-color: #EC5116 !important;
    border-color: #EC5116 !important;
    color: white !important;
    transition: all 0.3s ease;
    background-image: none !important;
}

.btn-primary:hover,
.btn-success:hover,
.btn-info:hover,
button[type="submit"]:hover,
.gc-save-button:hover,
.gc-add-button:hover,
.btn-request-report:hover,
.fbutton .add:hover,
.form-button-save:hover, .form-button-box input:hover {
    background-color: #d4460f !important;
    border-color: #d4460f !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(236, 81, 22, 0.3);
    background-image: none !important;
}

/* SAVE Button - Larger */
.gc-save-button,
button[type="submit"],
.btn-save-and-go-back,
button.btn.btn-success,
.form-button-save, .form-button-box input {
    font-size: 1.2rem !important;
    padding: 12px 30px !important;
    font-weight: 600 !important;
    min-width: 150px !important;
}

/* ADD Button in GroceryCRUD tables - Larger */
.gc-add-button,
.fbutton .add,
a.btn.btn-success[href*="add"],
.floatL.t5 a.btn {
    font-size: 1.1rem !important;
    padding: 10px 25px !important;
    font-weight: 600 !important;
}


/* ============================================
   CONTENT AREA
   ============================================ */
.main-content {
    background-color: white !important;
    color: #612B4B !important; /* Purple text */
}

h1, h2, h3, h4, h5, h6, a {
    color: #612B4B !important;
}

.bg-primary, .bg-primary h4, .navbar-brand, .btn-outline-light { /* contact */
    background-color: #612B4B !important;
    color: white !important;
}

.card-auth {
    max-width: 480px;
    margin: 80px auto;
    border: none;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.card-auth .card-header, .card-header h4 {
    background-color: #612B4B !important;
    color: white !important;
    text-align: center;
    padding: 1.5rem;
    border-radius: 0.375rem 0.375rem 0 0;
}
.card-auth .card-header h4 {
    margin: 0;
    font-weight: 600;
}

.btn-outline-light:hover {
    background-color: white !important;
    color: #612B4B !important; /* Purple text */
    color: white !important;
}

.badge {
    background-color: #d4460f !important;
}

/* ============================================
   DASHBOARD WELCOME BOX
   ============================================ */
.dashboard-welcome {
    background: linear-gradient(135deg, #612B4B 0%, #7d3861 100%);
    color: white;
    padding: 30px;
    border-radius: 12px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(97, 43, 75, 0.2);
}

.dashboard-welcome h2 {
    color: white !important;
    margin-bottom: 20px;
}

.dashboard-welcome p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 25px;
}

.btn-request-report {
    background-color: #EC5116 !important;
    border: none;
    padding: 15px 40px;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   WIZARD CATEGORY BUTTONS
   ============================================ */
.wizard-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
}

.wizard-category-btn {
    background-color: #EC5116 !important;
    border: 3px solid #EC5116 !important;
    color: white !important;
    padding: 30px 20px !important;
    border-radius: 12px !important;
    font-size: 1.3rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
    min-height: 150px !important;
    cursor: pointer !important;
}

.wizard-category-btn:hover {
    background-color: white !important;
    color: #EC5116 !important;
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(236, 81, 22, 0.3);
}

.wizard-category-btn i {
    font-size: 3rem !important;
}

/* ============================================
   VIEW REPORTS TABS
   ============================================ */
.nav-tabs .nav-link {
    color: #612B4B !important;
    border: 2px solid transparent !important;
    font-weight: 600 !important;
    padding: 12px 25px !important;
}

.nav-tabs .nav-link:hover {
    border-color: #EC5116 !important;
    color: #EC5116 !important;
}

.nav-tabs .nav-link.active {
    background-color: #EC5116 !important;
    color: white !important;
    border-color: #EC5116 !important;
}

/* ============================================
   MOBILE RESPONSIVENESS
   ============================================ */ 
@media (max-width: 768px) {
    .sidebar {
        display: block !important; /* Override any Bootstrap/base display:none */
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transition: left 0.3s ease;
        overflow-y: auto;
        background-color: #fff; /* ✅ Required — otherwise sidebar is invisible */
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2); /* Optional but helps visually */
        padding-top: 60px; /* ✅ Prevent content hiding behind the toggle button */
    }

    .sidebar.show {
        left: 0;
    }

    /* ✅ Dim overlay behind sidebar when open */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 999;
    }
    .sidebar-overlay.show {
        display: block;
    }

    .mobile-menu-toggle {
        display: block;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background-color: #612B4B;
        color: white;
        padding: 10px 15px;
        border: none;
        border-radius: 5px;
        cursor: pointer;
    }

    .wizard-category-btn {
        font-size: 1.1rem !important;
        padding: 20px 15px !important;
        min-height: 120px !important;
    }

    .gc-save-button,
    button[type="submit"] {
        width: 100% !important;
        margin-top: 10px !important;
    }
}

/* ============================================
   REGISTRATION WIZARD
   ============================================ */
.registration-intro {
    text-align: center;
    padding: 50px 20px;
}

.registration-intro h1 {
    font-size: 2.5rem;
    margin-bottom: 40px;
    color: #612B4B;
}

.profile-choice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    max-width: 800px;
    margin: 0 auto;
}

.profile-choice-btn {
    background-color: #EC5116 !important;
    border: 3px solid #EC5116 !important;
    color: white !important;
    padding: 40px 20px !important;
    border-radius: 12px !important;
    font-size: 1.5rem !important;
    font-weight: 600 !important;
    text-align: center !important;
    transition: all 0.3s ease !important;
    cursor: pointer !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.profile-choice-btn:hover {
    background-color: white !important;
    color: #EC5116 !important;
    transform: scale(1.05);
    box-shadow: 0 8px 20px rgba(236, 81, 22, 0.3);
}

.profile-choice-btn i {
    font-size: 3rem;
}

/* ============================================
   FORM IMPROVEMENTS
   ============================================ */
/* Add Farmer Link next to dropdown */
.add-farmer-link {
    display: inline-block;
    margin-left: 15px;
    color: #EC5116 !important;
    font-weight: 600;
    text-decoration: none;
}

.add-farmer-link:hover {
    text-decoration: underline;
}

.add-farmer-link i {
    margin-right: 5px;
}

/* Belgium farm ID placeholder */
input[name="farm_id"].belgium-placeholder::placeholder {
    color: #999;
    opacity: 1;
}

/* Password fields styling */
input[type="password"][name="credential"] {
    background-color: white !important;
}

/* ============================================
   GROCERYCRUD TABLE IMPROVEMENTS
   ============================================ */
/* Make tables more readable */
.table {
    font-size: 0.95rem;
}

.table th {
    background-color: #612B4B;
    color: white !important;
    font-weight: 600;
}

.table-striped > tbody > tr:nth-of-type(odd) > * {
    background-color: rgba(97, 43, 75, 0.05);
}

/* Action buttons in tables */
.table .btn {
    font-size: 0.85rem;
    padding: 5px 12px;
}

/* ============================================
   ACCORDION STYLING (for report lists)
   ============================================ */
.accordion-button {
    background-color: #f8f9fa;
    color: #612B4B !important;
    font-weight: 600;
}

.accordion-button:not(.collapsed) {
    background-color: #612B4B;
    color: white !important;
}

.accordion-button:hover {
    background-color: #EC5116;
    color: white !important;
}

.accordion-button i {
    margin-right: 10px;
}

/* ============================================
   LOADING STATES
   ============================================ */
.loading-spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #EC5116;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.text-purple {
    color: #612B4B !important;
}

.bg-purple {
    background-color: #612B4B !important;
}

.text-orange {
    color: #EC5116 !important;
}

.bg-orange {
    background-color: #EC5116 !important;
}

/* ============================================
   RESPONSIVE TYPOGRAPHY
   ============================================ */
@media (max-width: 576px) {
    h1 {
        font-size: 1.8rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    h3 {
        font-size: 1.3rem !important;
    }
    
    .dashboard-welcome p {
        font-size: 1rem;
    }
    
    .registration-intro h1 {
        font-size: 2rem;
    }
}

/* ============================================
   BIGGER FORMS
   ============================================ */
/* Regular text inputs */
.form-input-box input,
.form-div textarea {
    font-size: 1.2em !important;
    padding: 20px 10px !important;
}

.form-display-as-box, .ftitle-left {
    font-size: 1.2em !important;
}

/* Chosen dropdown — the visible button */
.chosen-container .chosen-single {
    font-size: 1.2em !important;
    padding: 5px 10px !important;
    height: auto !important;
    line-height: 1.4 !important;
}

/* Chosen dropdown — the options list */
.chosen-container .chosen-drop .chosen-results li {
    font-size: 1.2em !important;
    padding: 5px 10px !important;
}

.chosen-container {
    min-width: 500px;
}

#treatment_section_display_as_box {
    visibility: hidden;
}

#treatment_section_field_box #treatment_section_input_box {
    font-weight: bold;
    font-size: 1.5em;
    padding-top: 1em;
    /*text-align: center !important; this does nothing*/
}


#lab_section_display_as_box {
    visibility: hidden;
}

#lab_section_field_box #lab_section_input_box {
    font-weight: bold;
    font-size: 1.5em;
    padding-top: 1em;
}

/*
#treatment1_nr_animals_display_as_box, 
#treatment2_nr_animals_display_as_box, 
#treatment3_nr_animals_display_as_box {
    font-weight: bold !important;
}
    */

/* White arrow fix OK */
.accordion-button::after {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%23ffffff'%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") !important;
}

/* Also in custom_crud.css */
/* Hide search box, because it otherwise lets you search in int-fields etc (like mowed) */
#quickSearchBox,.search-div-clear-button *,#search_clear {
    display: none !important;
}


.bg-success {
    background-color: green !important;
}

.x-image-icon {
    width: 150px;
    height: 150px;
}

@media (min-width: 600px) {
        /* Treatment fields 3-column layout */
        .treatment-grid {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 0.75rem;
            margin: 1rem 0;
            max-width: 100%;
        }
        .treatment-column {
            border: 1px solid #dee2e6;
            padding: 0.75rem;
            border-radius: 0.25rem;
            background: #f8f9fa;
            min-width: 0; /* Allow shrinking below content size */
        }
        .treatment-column h5 {
            margin-top: 0;
            font-size: 0.9rem;
            font-weight: 600;
            color: #495057;
            border-bottom: 2px solid #0d6efd;
            padding-bottom: 0.4rem;
            margin-bottom: 0.75rem;
        }
        .treatments-header {
            font-size: 1rem;
            font-weight: 600;
            color: #2c3e50;
            margin: 1.5rem 0 0.5rem 0;
            padding-bottom: 0.5rem;
            border-bottom: 2px solid #dee2e6;
        }
        
        /* Make form fields inside treatment columns more compact */
        .treatment-column .form-display-as-box {
            font-size: 0.85rem;
            margin-bottom: 0.25rem;
            text-align: left;
        }
        .treatment-column .form-input-box {
            margin-bottom: 0.5rem;
        }
        .treatment-column input[type="text"],
        .treatment-column select,
        .treatment-column .chosen-container,
        .treatment-column .chosen-single {
            width: 250px !important;
            max-width: 300px;
            font-size: 0.9rem;
            white-space: nowrap;
        }
        .treatment-column .form-field-box {
            margin-bottom: 0.75rem;
        }
    }