/* /css/users_management.css */

/* ===============================
   User Cards Layout
=============================== */
.user-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(400px, 1fr));
    gap: 1.5rem;
}

.user-card {
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.user-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1), 0 4px 12px rgba(0, 0, 0, 0.08);
}

[data-bs-theme="dark"] .user-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3), 0 4px 16px rgba(0, 0, 0, 0.25);
}

/* ===============================
   User Card Header
=============================== */
.user-card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--sidebar-border-color);
    margin-bottom: 1.5rem;
}

.user-card-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--user-avatar-bg-color);
    color: var(--user-avatar-text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.user-card-info .full-name {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0;
}

.user-card-info .username {
    font-size: 0.9rem;
    color: var(--bs-secondary-color);
    margin: 0;
}

/* ===============================
   Card Body & Roles
=============================== */
.user-card .card-body {
    flex-grow: 1;
}

.role-badge-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.role-badge .form-check-input {
    display: none;
}

.role-badge .form-check-label {
    display: inline-block;
    padding: 0.35em 0.75em;
    font-size: 0.8rem;
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    border: 1px solid var(--apple-card-border-light);
    background-color: var(--apple-card-bg-light);
    transition: all 0.2s ease;
    user-select: none;
}

[data-bs-theme="dark"] .role-badge .form-check-label {
    border-color: var(--apple-card-border-dark);
    background-color: var(--apple-card-bg-dark);
}

.role-badge .form-check-input:checked + .form-check-label {
    background-color: var(--apple-accent-color);
    color: white;
    border-color: var(--apple-accent-color) !important;
    box-shadow: 0 0 10px var(--button-glow);
}

[data-bs-theme="dark"] .role-badge .form-check-input:checked + .form-check-label {
    color: #1c1c1e;
}

/* ===============================
   Card Footer
=============================== */
.user-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--sidebar-border-color);
}

/* ===============================
   TAGIFY DROPDOWN STYLING
=============================== */
.tagify__dropdown {
    border-radius: 0.75rem;
    border: none !important;
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}

/* Dark Theme */
[data-bs-theme="dark"] .tagify__dropdown {
/* Define Tagify's dropdown variables using your theme's colors */
  --tagify-dd-bg-color: var(--apple-card-bg-dark) !important;
  --tagify-dd-text-color: var(--sidebar-text-color) !important;
  --tagify-dd-color-primary: var(--apple-accent-color) !important;
  /* You might need this if the border wasn't inheriting correctly */
  --tagify-dd-border-color: var(--apple-card-border-dark) !important;
  background-color: rgba(30, 30, 30, 0.75);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Remove unwanted borders */
body .tagify__dropdown,
body .tagify__dropdown__wrapper {
    border: none !important;
    outline: none !important;
}

/* Dropdown item style */
.tagify__dropdown__item {
    color: var(--sidebar-text-color);
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    margin: 4px;
    transition: all 0.15s ease;
}

/* Dark theme text & active color correction */
[data-bs-theme="dark"] .tagify__dropdown__item {
    color: var(--apple-text-color);
}

.tagify__dropdown__item--active {
    background-color: var(--apple-accent-color);
    color: white !important;
}

/* Dark theme active override (accent-on-dark fix) */
[data-bs-theme="dark"] .tagify__dropdown__item--active {
    background-color: var(--apple-accent-color);
    color: #1c1c1e !important;
}

/* Hide scrollbars */
.tagify__dropdown__wrapper {
    overflow-y: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.tagify__dropdown__wrapper::-webkit-scrollbar {
    display: none;
}

/* Dark theme input text & placeholder */
[data-bs-theme="dark"] #userFilterForm .tagify .tagify__input {
    color: var(--apple-text-color) !important;
}

[data-bs-theme="dark"] #userFilterForm .tagify .tagify__input::before {
    color: var(--apple-placeholder-color) !important;
    opacity: 1 !important;
}

[data-bs-theme="dark"] #userFilterForm .tagify__input:not(:empty)::before {
    display: none !important;
}



/* ===============================
   CARD & BOOTSTRAP DROPDOWNS
=============================== */
.dropdown-menu {
    border: none !important;
    border-radius: 12px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.2s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

/* Light theme */
[data-bs-theme="light"] .dropdown-menu {
    background-color: rgba(255, 255, 255, 0.85) !important;
    color: #333;
}

[data-bs-theme="light"] .dropdown-item {
    color: #333;
    transition: all 0.15s ease;
}

[data-bs-theme="light"] .dropdown-item:hover,
[data-bs-theme="light"] .dropdown-item:focus {
    background-color: rgba(0, 0, 0, 0.07);
    font-weight: 500;
    border-radius: 8px;
}

/* Dark theme */
[data-bs-theme="dark"] .dropdown-menu {
    background-color: rgba(30, 30, 30, 0.75) !important;
    color: #eee;
}

[data-bs-theme="dark"] .dropdown-item {
    color: #eee;
    transition: all 0.15s ease;
}

[data-bs-theme="dark"] .dropdown-item:hover,
[data-bs-theme="dark"] .dropdown-item:focus {
    background-color: rgba(255, 255, 255, 0.12);
    font-weight: 500;
    border-radius: 8px;
}
