/**
 * ==========================================
 * 2. COMPONENTS
 * Navbar, Cards, Buttons, Forms, etc.
 * ==========================================
 */

/* ============================================================
   NAVBAR
   ============================================================ */
.navbar-custom {
    background: rgba(15, 23, 42, 0.95) !important;
    backdrop-filter: blur(15px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition-base);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.navbar-custom .navbar-brand {
    color: #fff;
    font-weight: 700;
    font-size: 1.3rem;
    transition: all var(--transition-fast);
}

.navbar-custom .navbar-brand:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8) !important;
    padding: 0.5rem 1rem !important;
    transition: all var(--transition-fast);
    position: relative;
    border-radius: 6px;
    display: flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--primary-color) !important;
    background: rgba(99, 102, 241, 0.1) !important;
    padding-left: 1.1rem !important;
}

.nav-link.active {
    color: #fff !important;
    background: rgba(99, 102, 241, 0.15) !important;
    border-radius: 8px;
    border-left: 3px solid var(--primary-color);
}

.navbar-toggler-white .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23ffffff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.5' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
    opacity: 1;
}

.user-dropdown-toggle {
    transition: all var(--transition-fast);
}

.user-dropdown-toggle:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}


/* ============================================================
   BUTTONS
   ============================================================ */
.button,
.btn {
    border-radius: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button {
    display: inline-block;
    padding: 12px 28px;
    margin-top: 10px;
    background: var(--primary-gradient);
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    position: relative;
    overflow: hidden;
}

.button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

.button:active::before {
    width: 300px;
    height: 300px;
}

.btn-modern {
    position: relative;
    overflow: hidden;
    transition: all var(--transition-base);
    border: none;
    font-weight: 600;
}

.btn-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transition: left var(--transition-base);
    z-index: 1;
}

.btn-modern:hover::before {
    left: 100%;
}

.btn-modern span {
    position: relative;
    z-index: 2;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.btn-search,
.btn-filter,
.btn-service-action {
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    border: none;
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
    color: white;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-search:hover,
.btn-filter:hover,
.btn-service-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.btn-search:active,
.btn-filter:active,
.btn-service-action:active {
    transform: translateY(0);
}

.btn-block {
    padding: 12px;
    font-weight: 500;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.85rem;
}

.btn-sm.rounded-circle {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-theme-toggle {
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.8);
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all var(--transition-fast);
    position: relative;
}

.btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-color: rgba(255, 255, 255, 0.4);
}

.btn-theme-toggle i:nth-child(1) {
    position: absolute;
    opacity: 1;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

.btn-theme-toggle i:nth-child(2) {
    position: absolute;
    opacity: 0;
    transition: opacity var(--transition-fast), transform var(--transition-fast);
}

/* ============================================================
   FORMS
   ============================================================ */
.form-control,
.form-select {
    background-color: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 0.5rem;
    padding: 0.625rem 1rem;
    color: #1e293b;
    transition: all 0.2s ease;
}

.form-control:focus,
.form-select:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.15);
}

.form-control::placeholder {
    color: #6c757d;
}

.form-label {
    margin-bottom: 0.5rem;
    color: #495057;
}

.form-control-lg {
    font-size: 1rem;
    padding: 0.75rem 1rem;
}

.input-group-text {
    border-radius: 0.5rem 0 0 0.5rem;
    border: 1px solid #e0e0e0;
}

.input-group .form-control {
    border-radius: 0 0.5rem 0.5rem 0;
}

.input-group .btn {
    border: 1px solid #ced4da;
}

.input-group .btn:hover {
    background-color: #f8f9fa;
}

.search-input {
    flex: 1;
    padding: 0.75rem 1.25rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
}

.search-input:focus {
    outline: none;
    border-color: #007bff;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

.search-input::placeholder {
    color: #999;
}

.filter-select {
    padding: 0.65rem 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 50px;
    font-size: 0.9rem;
    background-color: #f9f9f9;
    color: #333;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23333' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.5rem;
}

.filter-select:hover {
    border-color: #007bff;
    background-color: #fff;
}

.filter-select:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1);
}

/* Select2 Styles */
.select2-selection--multiple {
    min-height: 40px;
    border-radius: 0.5rem !important;
    border: 1px solid #80bdff !important;
    padding: 4px 6px !important;
    background-color: #f0f8ff;
    transition: border-color 0.3s, box-shadow 0.3s;
}

.select2-selection--multiple:focus {
    border-color: #1b72ca !important;
    box-shadow: 0 0 0 0.2rem rgba(27, 114, 202, 0.25);
}

.select2-selection--multiple .select2-selection__choice {
    background-color: #cce5ff !important;
    border: 1px solid #1b72ca !important;
    color: #0d3b66 !important;
    border-radius: 25px !important;
    padding: 4px 12px !important;
    font-size: 0.875rem !important;
    margin-top: 4px !important;
    margin-right: 6px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all 0.2s;
}

.select2-selection--multiple .select2-selection__choice:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 6px rgba(0,0,0,0.15);
}

.select2-selection--multiple .select2-selection__choice__remove {
    color: #0d3b66 !important;
    margin-right: 6px;
    cursor: pointer;
    transition: color 0.2s;
}

.select2-selection--multiple .select2-selection__choice__remove:hover {
    color: #ff4d4f !important;
}

.select2-container--default .select2-selection--single {
    border-radius: 0.5rem !important;
    border: 1px solid #1b72ca !important;
    height: 40px;
    line-height: 38px;
    background-color: #f0f8ff;
}

.strength-meter {
    height: 5px;
    background-color: #e9ecef;
    border-radius: 3px;
    overflow: hidden;
}

/* ============================================================
   BADGES
   ============================================================ */
.badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    transition: all var(--transition-fast);
}

/* Content card overlay badge (compact, aligned with bootstrap badges) */
.content-card-badget {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    padding: 0.35rem 0.65rem;
    line-height: 1;
}

.content-card-badget i {
    font-size: 0.9em;
    line-height: 1;
}

/* Ensure image container is positioned so overlays (badges) can be absolutely placed */
.card-image-section {
    position: relative;
}

/* Bottom-left variant for image overlay badges */
.content-card-badget.bottom-left {
    position: absolute;
    bottom: 0.75rem;
    left: 0.75rem;
    z-index: 12;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Top-left / Top-right / Bottom-right variants */
.content-card-badget.top-left {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    z-index: 12;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.content-card-badget.top-right {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 12;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}
.content-card-badget.bottom-right {
    position: absolute;
    bottom: 0.75rem;
    right: 0.75rem;
    z-index: 12;
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Status color helpers */
.content-card-badget.status-active { background: #16a34a; color: #fff; }
.content-card-badget.status-inactive { background: #f59e0b; color: #000; }
.content-card-badget.status-archived { background: #6b7280; color: #fff; }

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
  .content-card-badget.top-left,
  .content-card-badget.top-right,
  .content-card-badget.bottom-right,
  .content-card-badget.bottom-left {
    box-shadow: 0 6px 18px rgba(0,0,0,0.4);
  }

  .content-card-badget.status-active { background: #16a34a; color: #fff; }
  .content-card-badget.status-inactive { background: #d97706; color: #fff; }
  .content-card-badget.status-archived { background: #4b5563; color: #fff; }
}

/* Responsive: smaller badges and tighter offsets on small screens */
@media (max-width: 576px) {
  .content-card-badget { font-size: 0.65rem; padding: 0.25rem 0.5rem; }
  .content-card-badget.top-left,
  .content-card-badget.top-right,
  .content-card-badget.bottom-left,
  .content-card-badget.bottom-right { top: 0.5rem; left: 0.5rem; right: 0.5rem; bottom: 0.5rem; }
}

/* Bottom-left primary badge visual polish */
.content-card-badget.bottom-left.bg-primary {
  background: linear-gradient(135deg, #2563eb 0%, #6366f1 100%);
  color: #fff !important;
  border: 1px solid rgba(255,255,255,0.06);
}

@media (prefers-color-scheme: dark) {
  .content-card-badget.bottom-left.bg-primary {
    background: linear-gradient(135deg, #1e40af 0%, #4f46e5 100%);
    color: #fff !important;
    border: 1px solid rgba(0,0,0,0.4);
  }
  .content-card-badget.bottom-left { box-shadow: 0 6px 18px rgba(0,0,0,0.6); }
}

/* Dark-mode contrast tweaks for badge backgrounds applied to overlay badges */
@media (prefers-color-scheme: dark) {
  .content-card-badget.bg-warning { color: #111 !important; }
  .content-card-badget.bg-info { color: #fff !important; }
  .content-card-badget.bg-success { color: #fff !important; }
}

.badge-modern {
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    display: inline-block;
}

.badge-primary-modern {
    background: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%);
    color: white;
}

.badge-success-modern {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 100%);
    color: white;
}

.badge-danger-modern {
    background: linear-gradient(135deg, #ef4444 0%, #f97316 100%);
    color: white;
}

.badge-premium {
    position: relative;
    background: linear-gradient(135deg, #ffd700 0%, #ffed4e 100%);
    color: #000 !important;
    animation: pulse-glow 2s ease-in-out infinite;
}

.bg-primary-subtle {
    background-color: rgba(13, 110, 253, 0.1) !important;
}

.bg-success-subtle {
    background-color: rgba(25, 135, 84, 0.1) !important;
}

.bg-danger-subtle {
    background-color: rgba(220, 53, 69, 0.1) !important;
}

.bg-info-subtle {
    background-color: rgba(23, 162, 184, 0.1) !important;
}

.bg-secondary-subtle {
    background-color: rgba(108, 117, 125, 0.1) !important;
}

.text-success {
    color: #198754 !important;
}

.text-danger {
    color: #dc3545 !important;
}

.text-info {
    color: #17a2b8 !important;
}

.text-primary {
    color: #667eea !important;
}

/* ============================================================
   DROPDOWN
   ============================================================ */
.dropdown-menu {
    background-color: #fff;
    border-color: #dee2e6;
}

.dropdown-item {
    color: #212529;
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f8f9fa;
    color: #212529;
}

.dropdown-divider {
    border-color: #dee2e6;
}

/* ============================================================
   FOOTER
   ============================================================ */
footer {
    text-align: center;
    padding: 40px 0 20px;
    background: #1f2937;
    color: #fff;
    margin-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
    transition: all var(--transition-base);
}

footer a {
    color: rgba(255, 255, 255, 0.65);
    text-decoration: none;
    transition: color var(--transition-fast);
}

footer a:hover {
    color: var(--primary-color);
}

.hover-text-primary:hover {
    color: var(--primary-color) !important;
}