/* Remove oval/circular background from logo in sidebar */
.brand-link .brand-image {
    background-color: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

/* Remove any circular shape around logo */
.brand-link img {
    background-color: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* Center logo in sidebar like other icons */
.brand-link {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0.5rem !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

.brand-link:hover {
    background-color: rgba(255, 255, 255, 0.1) !important;
}

.brand-link .brand-image {
    margin: 0 auto !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

.brand-link:hover .brand-image {
    transform: scale(1.05) !important;
}

/* Hide brand text if present */
.brand-text {
    display: none !important;
}

/* Smooth sidebar transitions */
.main-sidebar {
    transition: width 0.3s ease, margin-left 0.3s ease !important;
}

.sidebar-collapse .main-sidebar {
    transition: width 0.3s ease, margin-left 0.3s ease !important;
}

/* Smooth content transitions */
.content-wrapper {
    transition: margin-left 0.3s ease !important;
}

/* Hide hamburger menu button on desktop - using logo click instead */
@media (min-width: 992px) {
    .nav-link[data-widget="pushmenu"] {
        display: none !important;
    }
}

/* Show hamburger menu on mobile/tablet */
@media (max-width: 991.98px) {
    .nav-link[data-widget="pushmenu"] {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        padding: 10px 15px !important;
        color: #fff !important;
        font-size: 20px !important;
    }

    .nav-link[data-widget="pushmenu"]:hover {
        background-color: rgba(255, 255, 255, 0.1) !important;
    }
}

/* Fix textarea editor colors - make text visible */
textarea,
.vLargeTextField,
.django-ckeditor-widget iframe {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Fix CKEditor content area */
.cke_wysiwyg_frame,
.cke_wysiwyg_div {
    background-color: #ffffff !important;
    color: #000000 !important;
}

/* Ensure toolbar buttons are visible */
.cke_toolbar {
    background-color: #f4f4f4 !important;
}

.cke_button_label {
    color: #000000 !important;
}

/* Remove Jazzmin version text from footer - multiple approaches */
.main-footer div:last-child {
    display: none !important;
}

.main-footer strong {
    display: none !important;
}

.main-footer {
    font-size: 0 !important;
}

.main-footer * {
    font-size: 0 !important;
}

/* Hide entire footer if it only contains Jazzmin text */
footer.main-footer:not(:has(a:not([href*="jazzmin"]))) {
    display: none !important;
}

/* Style Import CSV button - simple green button */
.import-csv-link,
a[href*="import-csv"] {
    display: inline-block !important;
    padding: 8px 16px !important;
    background-color: #28a745 !important;
    color: #ffffff !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    margin-left: 10px !important;
}

.import-csv-link:hover,
a[href*="import-csv"]:hover {
    background-color: #218838 !important;
    color: #ffffff !important;
    text-decoration: none !important;
}

/* Password visibility toggle - no wrapper, append to parent */
.password-toggle-btn {
    position: absolute !important;
    right: 45px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    background: none !important;
    border: none !important;
    cursor: pointer !important;
    padding: 5px !important;
    color: #666 !important;
    z-index: 10 !important;
    outline: none !important;
}

.password-toggle-btn:hover {
    color: #000 !important;
}

/* Style Import CSV page to be more professional */
.import-csv-page h1,
form[action*="import-csv"] h1,
form[action*="import-csv-map"] h1,
.breadcrumbs + h1 {
    color: #2c3e50 !important;
    font-size: 28px !important;
    font-weight: 600 !important;
    margin-bottom: 25px !important;
    position: relative !important;
    z-index: 5 !important;
    line-height: 1.4 !important;
}

/* File info section styling */
form[action*="import-csv"] p,
form[action*="import-csv-map"] p {
    background: #e8f5e9 !important;
    padding: 12px 16px !important;
    border-radius: 6px !important;
    border-left: 4px solid #28a745 !important;
    margin: 15px 0 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    color: #2c3e50 !important;
}

/* Preview section */
form[action*="import-csv-map"] h3,
.preview-section h3 {
    margin-top: 30px !important;
    margin-bottom: 15px !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    color: #2c3e50 !important;
}

/* Import CSV form styling */
form[action*="import-csv"] {
    background: #ffffff !important;
    padding: 30px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    margin-top: 50px !important;
}

form[action*="import-csv-map"] {
    background: #ffffff !important;
    padding: 30px !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    margin-top: 50px !important;
}

/* File input styling */
input[type="file"] {
    padding: 12px !important;
    border: 2px dashed #ccc !important;
    border-radius: 6px !important;
    background: #f8f9fa !important;
    width: 100% !important;
    cursor: pointer !important;
}

input[type="file"]:hover {
    border-color: #28a745 !important;
    background: #e8f5e9 !important;
}

/* Submit buttons in import forms */
form[action*="import-csv"] input[type="submit"],
form[action*="import-csv"] button[type="submit"] {
    background: #28a745 !important;
    color: white !important;
    padding: 12px 30px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
}

form[action*="import-csv"] input[type="submit"]:hover,
form[action*="import-csv"] button[type="submit"]:hover {
    background: #218838 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3) !important;
}

/* Help text and instructions */
.helptext,
form[action*="import-csv"] .help,
form[action*="import-csv"] p {
    color: #6c757d !important;
    font-size: 14px !important;
    margin-top: 8px !important;
    line-height: 1.6 !important;
}

/* Table styling for import preview */
table.import-preview,
form[action*="import-csv"] table {
    width: 100% !important;
    border-collapse: collapse !important;
    margin-top: 20px !important;
    background: white !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1) !important;
}

table.import-preview th,
form[action*="import-csv"] table th {
    background: #f8f9fa !important;
    padding: 12px !important;
    text-align: left !important;
    font-weight: 600 !important;
    border-bottom: 2px solid #dee2e6 !important;
}

table.import-preview td,
form[action*="import-csv"] table td {
    padding: 12px !important;
    border-bottom: 1px solid #dee2e6 !important;
}

/* Login page logo sizing - keep it small and professional */
.login-logo img,
.login-box img {
    max-width: 80px !important;
    max-height: 80px !important;
    width: auto !important;
    height: auto !important;
    margin: 0 auto 15px !important;
    display: block !important;
}

/* Sidebar logo sizing - small and centered */
.brand-link .brand-image {
    max-width: 40px !important;
    max-height: 40px !important;
    width: auto !important;
    height: auto !important;
}

/* Login welcome text - bold with gradient on brand name */
.login-box-msg {
    font-weight: 600 !important;
    font-size: 1.1rem !important;
}

.brand-gradient {
    background: linear-gradient(90deg, #00c6ff 0%, #0072ff 20%, #7c3aed 40%, #f472b6 60%, #fb923c 80%, #facc15 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 700 !important;
}

/* Login icons with gradient colors */
.login-box .input-group-text .fa-user {
    color: #00c6ff !important;
}

.login-box .input-group-text .fa-lock {
    color: #7c3aed !important;
}

.login-box .input-group-text .fa-eye,
.login-box .password-toggle-btn .fa-eye {
    color: #f472b6 !important;
}

.login-box .input-group-text .fa-eye-slash,
.login-box .password-toggle-btn .fa-eye-slash {
    color: #fb923c !important;
}

/* Login button with gradient background */
.login-box .btn-primary {
    background: linear-gradient(90deg, #00c6ff 0%, #0072ff 20%, #7c3aed 40%, #f472b6 60%, #fb923c 80%, #facc15 100%) !important;
    border: none !important;
    color: #fff !important;
    font-weight: 600 !important;
}

.login-box .btn-primary:hover {
    background: linear-gradient(90deg, #00b4e6 0%, #0066e6 20%, #6d31d4 40%, #e066a3 60%, #e68533 80%, #e6b800 100%) !important;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4) !important;
}

/* Password reset email icon */
.login-box .input-group-text .fa-envelope {
    color: #0072ff !important;
}

/* ==========================================================================
   MOBILE RESPONSIVE STYLES
   ========================================================================== */

/* Mobile and tablet sidebar styles */
@media (max-width: 991.98px) {
    /* Sidebar - overlay mode on mobile */
    .main-sidebar {
        position: fixed !important;
        top: 0 !important;
        left: -250px !important;
        width: 250px !important;
        height: 100vh !important;
        z-index: 1040 !important;
        transition: left 0.3s ease-in-out !important;
    }

    /* Sidebar open state */
    .sidebar-open .main-sidebar {
        left: 0 !important;
    }

    /* Backdrop when sidebar is open */
    .sidebar-open::after {
        content: '' !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        background: rgba(0, 0, 0, 0.5) !important;
        z-index: 1039 !important;
    }

    /* Content wrapper takes full width on mobile */
    .content-wrapper {
        margin-left: 0 !important;
    }

    /* Top navbar adjustments */
    .main-header.navbar {
        position: sticky !important;
        top: 0 !important;
        z-index: 1030 !important;
        width: 100% !important;
    }

    /* Make sure hamburger icon is visible in top navbar */
    .navbar .nav-link[data-widget="pushmenu"] {
        display: flex !important;
        align-items: center !important;
        color: #fff !important;
        padding: 0.5rem 1rem !important;
    }

    /* Sidebar menu items - larger touch targets */
    .nav-sidebar .nav-link {
        padding: 12px 15px !important;
        font-size: 15px !important;
    }

    .nav-sidebar .nav-icon {
        font-size: 18px !important;
        margin-right: 10px !important;
    }

    /* Brand link adjustments */
    .brand-link {
        padding: 12px !important;
    }

    /* Tables scroll horizontally on mobile */
    .table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
    }

    table.dataTable,
    #result_list {
        min-width: 600px !important;
    }

    /* Form fields full width on mobile */
    .form-row .field-box,
    .form-row .field-box input,
    .form-row .field-box select,
    .form-row .field-box textarea {
        width: 100% !important;
    }

    /* Action bar responsive */
    .actions {
        flex-wrap: wrap !important;
    }

    .actions select {
        margin-bottom: 10px !important;
    }

    /* Breadcrumbs wrap on mobile */
    .breadcrumbs {
        white-space: normal !important;
        word-wrap: break-word !important;
    }

    /* Card and box adjustments */
    .card, .box {
        margin: 10px !important;
        border-radius: 8px !important;
    }

    /* Filter sidebar - stack on mobile */
    #changelist-filter {
        width: 100% !important;
        position: relative !important;
        margin-bottom: 15px !important;
    }

    /* Pagination - center on mobile */
    .pagination {
        justify-content: center !important;
        flex-wrap: wrap !important;
    }
}

/* Small mobile screens */
@media (max-width: 575.98px) {
    /* Navbar brand text hide on very small screens */
    .navbar-brand .brand-text {
        display: none !important;
    }

    /* Reduce padding on very small screens */
    .content-wrapper {
        padding: 10px !important;
    }

    /* Smaller font sizes */
    .content-header h1 {
        font-size: 1.25rem !important;
    }

    /* Stack action buttons vertically */
    .actions {
        flex-direction: column !important;
    }

    .actions select,
    .actions button {
        width: 100% !important;
        margin-bottom: 8px !important;
    }

    /* Full width buttons */
    .btn {
        width: 100% !important;
        margin-bottom: 8px !important;
    }

    /* Import CSV button adjustments */
    .import-csv-link,
    a[href*="import-csv"] {
        display: block !important;
        text-align: center !important;
        margin: 10px 0 !important;
    }
}

/* Landscape mobile */
@media (max-width: 991.98px) and (orientation: landscape) {
    .main-sidebar {
        width: 200px !important;
    }

    .sidebar-open .main-sidebar {
        left: 0 !important;
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger click targets for touch */
    .nav-sidebar .nav-link {
        min-height: 48px !important;
        display: flex !important;
        align-items: center !important;
    }

    /* Prevent text selection on navigation */
    .nav-sidebar {
        -webkit-user-select: none !important;
        user-select: none !important;
    }

    /* Smooth scrolling in sidebar */
    .sidebar {
        -webkit-overflow-scrolling: touch !important;
    }
}

/* Ensure sidebar toggle button is always accessible */
[data-widget="pushmenu"] {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent !important;
}
