/* Custom admin styles */

/* Replace moon icon with bat SVG for Soorten menu item */
.menu-item:has([href*="Species"]) .fa-moon::before,
.menu-item a[href*="Species"] .fa-moon::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cellipse cx='12' cy='14' rx='1.5' ry='3'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3Cpath d='M9.5 6.5 C9.5 5.5, 10 4.5, 10.5 4.5 C10.8 4.5, 11 5, 11 5.5 L10.5 7.5 Z'/%3E%3Cpath d='M14.5 6.5 C14.5 5.5, 14 4.5, 13.5 4.5 C13.2 4.5, 13 5, 13 5.5 L13.5 7.5 Z'/%3E%3Ccircle cx='10.5' cy='8.5' r='0.4' fill='white'/%3E%3Ccircle cx='13.5' cy='8.5' r='0.4' fill='white'/%3E%3Cpath d='M9.5 11 C7 10, 4 11, 2 13 C1 14, 1 15, 2 16 C3 17, 5 16.5, 7 15.5 C8.5 14.5, 9.5 13, 9.5 11 Z'/%3E%3Cpath d='M14.5 11 C17 10, 20 11, 22 13 C23 14, 23 15, 22 16 C21 17, 19 16.5, 17 15.5 C15.5 14.5, 14.5 13, 14.5 11 Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* More specific selectors for EasyAdmin */
.sidebar .menu-item a[href*="Species"] i.fa-moon::before,
.main-sidebar .menu-item a[href*="Species"] i.fa-moon::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23666'%3E%3Cellipse cx='12' cy='14' rx='1.5' ry='3'/%3E%3Ccircle cx='12' cy='9' r='2.5'/%3E%3Cpath d='M9.5 6.5 C9.5 5.5, 10 4.5, 10.5 4.5 C10.8 4.5, 11 5, 11 5.5 L10.5 7.5 Z'/%3E%3Cpath d='M14.5 6.5 C14.5 5.5, 14 4.5, 13.5 4.5 C13.2 4.5, 13 5, 13 5.5 L13.5 7.5 Z'/%3E%3Ccircle cx='10.5' cy='8.5' r='0.4' fill='white'/%3E%3Ccircle cx='13.5' cy='8.5' r='0.4' fill='white'/%3E%3Cpath d='M9.5 11 C7 10, 4 11, 2 13 C1 14, 1 15, 2 16 C3 17, 5 16.5, 7 15.5 C8.5 14.5, 9.5 13, 9.5 11 Z'/%3E%3Cpath d='M14.5 11 C17 10, 20 11, 22 13 C23 14, 23 15, 22 16 C21 17, 19 16.5, 17 15.5 C15.5 14.5, 14.5 13, 14.5 11 Z'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

/* Fallback: hide the moon icon and show emoji */
.menu-item a[href*="Species"] i.fa-moon {
    font-size: 0;
}

.menu-item a[href*="Species"] i.fa-moon::after {
    content: "🦇";
    font-size: 14px;
    font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* Fix leesbaarheid van outline-light knoppen in dark theme */
.btn-outline-light {
    color: #f8f9fa !important;
    border-color: #f8f9fa !important;
}

.btn-outline-light:hover,
.btn-outline-light:focus,
.btn-outline-light:active,
.btn-outline-light.active,
.show > .btn-outline-light.dropdown-toggle {
    color: #212529 !important;              /* donkere tekst op lichte achtergrond */
    background-color: #f8f9fa !important;   /* lichte achtergrond */
    border-color: #f8f9fa !important;
}

/* Maak de registratie-details modal breder */
.modal-dialog.edit-registratie-modal {
    /* Bootstrap 5 gebruikt --bs-modal-width als basis voor de breedte */
    --bs-modal-width: 90vw;
    max-width: 90vw !important;
}

@media (min-width: 1600px) {
    .modal-dialog.edit-registratie-modal {
        --bs-modal-width: 75vw;
        max-width: 75vw !important;
    }
}

/* Compactere header + tab-teksten voor de registratie-details wizard */
.edit-registratie-modal .modal-header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.edit-registratie-modal .nav-pills .nav-link {
    font-size: 0.9rem;
    padding-top: 0.4rem;
    padding-bottom: 0.4rem;
    margin-right: 0.5rem;
}

/* Flash messages moeten boven modals verschijnen */
.alert {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1060 !important;
    width: auto;
    min-width: 300px;
    max-width: 520px;
    margin: 0 !important; /* Override inline margin styles */
}

/* Registratie modal 30px lager op desktop */
@media (min-width: 992px) {
    /* Pas de modal container aan om de modal lager te positioneren */
    body #editRegistratieModal.modal.show,
    body #editRegistratieModal.modal.show.show {
        align-items: flex-start !important;
        padding-top: 30px !important;
    }
    
    /* Zorg dat de modal-dialog niet wordt getransformeerd door Bootstrap's centrering */
    body #editRegistratieModal.modal.show .modal-dialog.edit-registratie-modal,
    body #editRegistratieModal.modal.show.show .modal-dialog.edit-registratie-modal {
        margin-top: 0 !important;
        margin-bottom: auto !important;
        transform: none !important;
    }
}

/* Fix voor modal footer knoppen in portrait mode op mobiel */
@media (max-width: 768px) and (orientation: portrait) {
    #editRegistratieModal .modal-footer {
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        justify-content: flex-start !important;
    }
    
    /* Annuleren knop blijft volle breedte */
    #editRegistratieModal .modal-footer .btn-secondary[data-bs-dismiss="modal"] {
        width: 100% !important;
        margin-bottom: 0 !important;
        flex: 0 0 100% !important;
    }
    
    /* Vorige en Volgende knoppen naast elkaar, elk ongeveer 50% breed */
    #editRegistratieModal .modal-footer #edit-prev-step,
    #editRegistratieModal .modal-footer #edit-next-step {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        width: auto !important;
        max-width: none !important;
    }
    
    /* Zorg dat beide knoppen samen de beschikbare ruimte vullen */
    #editRegistratieModal .modal-footer #edit-prev-step {
        flex-basis: calc(50% - 0.25rem) !important;
    }
    
    #editRegistratieModal .modal-footer #edit-next-step {
        flex-basis: calc(50% - 0.25rem) !important;
    }
    
    /* Opslaan knop volle breedte */
    #editRegistratieModal .modal-footer #edit-save-btn {
        width: 100% !important;
        flex: 0 0 100% !important;
    }
}

/* Badge met aantal gebruikers bij 'Beheer gebruikers' knoppen beter zichtbaar maken */
#manage-gebruikers-btn,
#manage-gebruikers-btn-modal {
    overflow: visible !important;
}

/* Zorg dat parent containers ook overflow visible hebben */
.d-flex.align-items-center.gap-2 {
    overflow: visible !important;
}

#manage-gebruikers-btn .badge,
#manage-gebruikers-btn-modal .badge {
    position: absolute !important;
    top: -0.5rem !important;
    right: -0.5rem !important;
    left: auto !important;
    transform: none !important;
    font-size: 0.65rem !important;
    z-index: 10 !important;
    min-width: 1.25rem !important;
    padding: 0.15rem 0.35rem !important;
    display: inline-block !important;
}

/* Meer horizontale padding voor alle buttons met type="button" - 5px extra */
button[type="button"].btn,
button[type="button"].btn-sm,
.btn.btn-sm,
button.btn-sm {
    padding-left: calc(0.5rem + 5px) !important;
    padding-right: calc(0.5rem + 5px) !important;
}

/* Extra padding voor specifieke action buttons - 5px extra */
button[type="button"]#open-dier-wizard,
button[type="button"].save-dier-details,
button[type="button"]#edit-header-save-btn,
button[type="button"]#edit-save-btn,
#open-dier-wizard,
.save-dier-details,
#edit-header-save-btn,
#edit-save-btn {
    padding-left: calc(0.5rem + 5px) !important;
    padding-right: calc(0.5rem + 5px) !important;
}

/* Dashboard tile colors - Windows tile style, dark mode friendly */
.dashboard-tile {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    height: 100%;
    border: none !important;
    border-radius: 8px !important;
}

.dashboard-tile:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    text-decoration: none;
}

.dashboard-tile:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

.dashboard-tile .card-body {
    padding: 1.5rem;
}

/* Nieuwe Registratie - Indigo/Purple */
.dashboard-tile-indigo,
.dashboard-tile-indigo.card {
    background-color: #6366f1 !important;
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%) !important;
    color: white !important;
    border-color: #6366f1 !important;
}

.dashboard-tile-indigo:hover,
.dashboard-tile-indigo.card:hover {
    background-color: #4f46e5 !important;
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%) !important;
}

/* Mijn Registraties - Teal/Cyan */
.dashboard-tile-teal,
.dashboard-tile-teal.card {
    background-color: #14b8a6 !important;
    background: linear-gradient(135deg, #14b8a6 0%, #06b6d4 100%) !important;
    color: white !important;
    border-color: #14b8a6 !important;
}

.dashboard-tile-teal:hover,
.dashboard-tile-teal.card:hover {
    background-color: #0d9488 !important;
    background: linear-gradient(135deg, #0d9488 0%, #0891b2 100%) !important;
}

/* Formulier Beheer - Emerald Green */
.dashboard-tile-emerald,
.dashboard-tile-emerald.card {
    background-color: #10b981 !important;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white !important;
    border-color: #10b981 !important;
}

.dashboard-tile-emerald:hover,
.dashboard-tile-emerald.card:hover {
    background-color: #059669 !important;
    background: linear-gradient(135deg, #059669 0%, #047857 100%) !important;
}

/* Soorten - Amber/Orange */
.dashboard-tile-amber,
.dashboard-tile-amber.card {
    background-color: #f59e0b !important;
    background: linear-gradient(135deg, #f59e0b 0%, #f97316 100%) !important;
    color: white !important;
    border-color: #f59e0b !important;
}

.dashboard-tile-amber:hover,
.dashboard-tile-amber.card:hover {
    background-color: #d97706 !important;
    background: linear-gradient(135deg, #d97706 0%, #ea580c 100%) !important;
}

/* Override any EasyAdmin dark mode card backgrounds */
.ea-dark-scheme .dashboard-tile,
.ea-dark-scheme .dashboard-tile.card,
body.ea-dark-scheme .dashboard-tile,
body.ea-dark-scheme .dashboard-tile.card {
    background-color: inherit !important;
}

/* Ensure text stays white */
.dashboard-tile,
.dashboard-tile.card,
.dashboard-tile .card-title,
.dashboard-tile .card-text {
    color: white !important;
}


/* User select dark mode styling - ondersteun zowel .dark als .ea-dark-scheme */
.ea-dark-scheme .user-select-dropdown,
body.ea-dark-scheme .user-select-dropdown,
.dark .user-select-dropdown {
    background: #212529 !important;
    border-color: #495057 !important;
}

.ea-dark-scheme .user-select-item,
body.ea-dark-scheme .user-select-item,
.dark .user-select-item {
    border-bottom-color: #343a40 !important;
    color: #f8fafc !important;
}

.ea-dark-scheme .user-select-item:hover,
body.ea-dark-scheme .user-select-item:hover,
.dark .user-select-item:hover {
    background-color: #343a40 !important;
}

.ea-dark-scheme .user-select-item.selected,
body.ea-dark-scheme .user-select-item.selected,
.dark .user-select-item.selected {
    background-color: #1e3a5f !important;
}

.ea-dark-scheme .user-select-results,
body.ea-dark-scheme .user-select-results,
.dark .user-select-results {
    background: #212529 !important;
    color: #f8fafc !important;
}

.ea-dark-scheme .user-select-loading,
body.ea-dark-scheme .user-select-loading,
.dark .user-select-loading {
    color: #adb5bd !important;
}

.ea-dark-scheme .user-select-item .fw-semibold,
body.ea-dark-scheme .user-select-item .fw-semibold,
.dark .user-select-item .fw-semibold {
    color: #f8fafc !important;
}