/* VITALE1913 - Admin Styles */

/* Import shared styles */
@import url('variables.css');
@import url('buttons.css');

/* Admin-specific styles, extending the main stylesheet */
.admin-header {
  background-color: var(--dark-color);
  color: white;
  padding: 1.5rem 0;
  margin-bottom: 0; /* Remove margin to match main site */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.admin-title {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
  font-family: var(--primary-font);
  font-weight: 700;
  color: var(--light-color);
  letter-spacing: 0.5px;
}

.admin-subtitle {
  font-size: 1rem;
  opacity: 0.8;
  font-family: var(--secondary-font);
  letter-spacing: 0.5px;
  color: var(--light-color);
}

/* Admin Dashboard Cards */
.stat-card {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 1.5rem;
  text-align: center;
  transition: var(--transition);
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-icon {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.stat-title {
  font-size: 1rem;
  color: var(--secondary-color);
}

/* Admin tables */
.admin-table {
  width: 100%;
  margin-bottom: 1.5rem;
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  padding: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.admin-table th {
  background-color: var(--primary-color);
  color: white;
  font-weight: 600;
  text-align: left;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background-color: #f8f9fa;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
}

/* Admin Diamond Cards - Clean Design */
.admin-diamond-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid var(--gray-200);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    min-height: 320px;
}

.admin-diamond-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.admin-diamond-card .diamond-status-badges {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.admin-diamond-card .diamond-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-diamond-card .diamond-status-badge.status-in-safe {
    background-color: rgba(40, 167, 69, 0.15);
    color: #28a745;
    border: 1px solid rgba(40, 167, 69, 0.3);
}

.admin-diamond-card .diamond-status-badge.status-removed {
    background-color: rgba(220, 53, 69, 0.15);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.3);
}

.admin-diamond-card .blockchain-badge {
    background-color: rgba(23, 162, 184, 0.15);
    color: #17a2b8;
    border: 1px solid rgba(23, 162, 184, 0.3);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 4px;
}

.admin-diamond-card .diamond-placeholder {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-100);
    color: var(--gray-500);
    position: relative;
}

.admin-diamond-card .diamond-image {
    width: 100%;
    height: 140px;
    object-fit: cover;
}

.admin-diamond-card .diamond-details {
    padding: 16px;
    text-align: center;
}

.admin-diamond-card .registered-label {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 1px;
    margin-bottom: 8px;
    display: inline-block;
}

.admin-diamond-card .diamond-status-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 8px;
}

.admin-diamond-card .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

.admin-diamond-card .status-dot.in-safe {
    background-color: #28a745;
    box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
}

.admin-diamond-card .status-dot.removed {
    background-color: #dc3545;
    box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
}

.admin-diamond-card .status-text {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-700);
}

.admin-diamond-card .diamond-id {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 12px;
}

.admin-diamond-card .diamond-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 12px;
}

.admin-diamond-card .spec-item {
    text-align: center;
}

.admin-diamond-card .spec-value {
    display: block;
    font-weight: 600;
    color: var(--gray-800);
    font-size: 0.9rem;
}

.admin-diamond-card .spec-label {
    display: block;
    font-size: 0.7rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 2px;
}

.admin-diamond-card .last-seen {
    font-size: 0.75rem;
    color: var(--gray-600);
    margin-bottom: 12px;
    display: block;
}

.admin-diamond-card .diamond-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
}

.admin-diamond-card .btn-action {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.admin-diamond-card .btn-action.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.admin-diamond-card .btn-action.btn-primary:hover {
    background-color: var(--secondary-color);
    transform: translateY(-1px);
    color: white;
    text-decoration: none;
}

.admin-diamond-card .btn-action.btn-outline-primary {
    background-color: transparent;
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.admin-diamond-card .btn-action.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-1px);
}

/* Diamond Grid Layout */
.diamonds-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

@media (max-width: 768px) {
    .diamonds-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 16px;
    }
    
    .admin-diamond-card {
        min-height: 300px;
    }
}

/* Pulse animation for status dots */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(40, 167, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(40, 167, 69, 0);
    }
}

.admin-diamond-card .status-dot.removed {
    animation-name: pulse-red;
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(220, 53, 69, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(220, 53, 69, 0);
    }
}

/* Admin forms */
.admin-form {
  background-color: white;
  border-radius: var(--border-radius);
  box-shadow: var(--box-shadow);
  padding: 2rem;
  max-width: 800px;
  margin: 0 auto;
}

.form-title {
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e9ecef;
}

.form-section {
  margin-bottom: 2rem;
}

.form-section-title {
  font-size: 1.2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -0.5rem;
}

.form-col {
  flex: 1;
  padding: 0 0.5rem;
  min-width: 250px;
}

/* File upload with enhanced preview */
.file-upload {
  margin-bottom: 1.5rem;
}

.file-upload-label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.file-preview {
  width: 100%;
  height: 250px;
  margin-top: 1rem;
  background-color: #f8f9fa;
  border-radius: var(--border-radius);
  border: 2px dashed var(--gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
  transition: all 0.3s ease;
  cursor: pointer;
}

.file-preview.drag-over {
  background-color: #e3f2fd;
  border-color: var(--primary-color);
}

.file-preview.has-image {
  border-style: solid;
  border-color: var(--gray-300);
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: var(--gray-600);
  text-align: center;
  transition: all 0.3s ease;
}

.drop-zone-prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.drop-zone-prompt svg {
  margin-bottom: 10px;
  color: var(--gray-500);
}

.preview-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-image {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.preview-controls {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 5px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.preview-wrapper:hover .preview-controls {
  opacity: 1;
}

.preview-zoom-btn,
.preview-remove-btn {
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
}

.preview-zoom-btn:hover,
.preview-remove-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* Image zoom modal */
.image-zoom-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.image-zoom-content {
  position: relative;
  max-width: 90%;
  max-height: 90%;
}

.image-zoom-content img {
  max-width: 100%;
  max-height: 90vh;
  object-fit: contain;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.zoom-close-btn {
  position: absolute;
  top: -40px;
  right: 0;
  background: none;
  border: none;
  color: white;
  font-size: 24px;
  cursor: pointer;
}

/* Log styling */
.log-entry {
  padding: 0.75rem;
  margin-bottom: 0.5rem;
  border-radius: var(--border-radius);
  background-color: #f8f9fa;
}

.log-entry:nth-child(even) {
  background-color: #e9ecef;
}

.log-timestamp {
  font-size: 0.85rem;
  color: var(--secondary-color);
  margin-bottom: 0.25rem;
}

.log-message {
  font-family: monospace;
}

.log-added {
  border-left: 4px solid var(--success-color);
}

.log-removed {
  border-left: 4px solid var(--danger-color);
}

/* Admin navigation - Bootstrap Navbar */
.admin-nav {
  background-color: var(--primary-color);
  padding: 0.5rem 0;
  margin-bottom: 2rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Make hamburger menu white for better visibility */
.navbar-toggler {
  border-color: rgba(255, 255, 255, 0.5);
  padding: 0.25rem 0.5rem;
}

.navbar-toggler:focus {
  box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.25);
}

/* Admin navigation link styling */
.admin-nav-link {
  color: white;
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  position: relative;
  transition: var(--transition);
  text-decoration: none;
  display: block;
  font-family: var(--secondary-font);
  font-size: 0.9rem;
}

.admin-nav-link:hover {
  color: var(--accent-color);
}

.admin-nav-link.active {
  color: var(--accent-color);
}

.admin-nav-link.active:after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--accent-color);
}

/* Dropdown toggle caret spacing */
.admin-nav-link.dropdown-toggle::after {
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Dropdown menu styling */
.dropdown-menu {
  background-color: white;
  border-radius: 10px;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  padding: 0.7rem 0;
  min-width: 220px;
  z-index: 1000;
  margin-top: 0.6rem;
}

/* Dropdown item styling */
.dropdown-item {
  padding: 0.6rem 1.2rem;
  font-size: 0.9rem;
  color: var(--gray-700);
  transition: all 0.2s;
  font-family: var(--secondary-font);
  font-weight: 500;
  position: relative;
}

.dropdown-item:hover {
  background-color: rgba(26, 35, 126, 0.05);
  color: var(--primary-color);
}

.dropdown-item.active {
  background-color: rgba(26, 35, 126, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}

.dropdown-item i {
  width: 20px;
  text-align: center;
  color: var(--primary-color);
  opacity: 0.8;
  margin-right: 8px;
}

/* Diamond Grid Layout */
.view-toggle {
  display: flex;
  gap: 10px;
}

.view-toggle-btn {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-toggle-btn.active {
  background-color: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.diamond-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 2.5rem;
  justify-items: center; /* Center cards in grid */
}

.diamond-card {
  max-width: 370px; /* Prevents card from being too wide */
  width: 100%;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(230, 230, 230, 0.7);
  height: 100%;
}

.diamond-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
  border-color: rgba(200, 200, 200, 0.5);
}

.diamond-status-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  color: white;
}

.status-in-safe {
  background-color: var(--success-color);
}

.status-removed {
  background-color: var(--danger-color);
}

/* Blockchain verification badge and status badge container */
.diamond-status-badges {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
}

.blockchain-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  background-color: rgba(33, 150, 243, 0.9);
  color: white;
}

/* Table view blockchain badge */
table .blockchain-badge {
  display: inline-flex;
  background-color: var(--primary-color);
  color: white;
}

.diamond-image-container {
  position: relative;
  height: 200px;
  overflow: hidden;
  background-color: var(--gray-100);
}

.diamond-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s;
}

.diamond-card:hover .diamond-image {
  transform: scale(1.05);
}

.diamond-zoom-btn {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  border: none;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s, transform 0.3s;
}

.diamond-card:hover .diamond-zoom-btn {
  opacity: 1;
  transform: translateY(0);
}

.diamond-zoom-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.diamond-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--gray-500);
}

.diamond-placeholder svg {
  margin-bottom: 10px;
}

.diamond-placeholder p {
  margin: 0;
  font-size: 0.9rem;
}

.diamond-content {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.diamond-title {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: var(--primary-color);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
  border-bottom: 1px solid rgba(230, 230, 230, 0.7);
  padding-bottom: 12px;
}

.diamond-specs {
  flex: 1;
  margin-bottom: 15px;
}

.spec-group {
  display: flex;
  margin-bottom: 12px;
  gap: 15px;
}

.spec-item {
  flex: 1;
  margin-bottom: 8px;
  background-color: #f8f9fa;
  padding: 8px 12px;
  border-radius: 8px;
  transition: background-color 0.2s;
}

.spec-item:hover {
  background-color: #f0f2f5;
}

.spec-label {
  font-weight: 600;
  color: var(--gray-600);
  font-size: 0.8rem;
  display: block;
  margin-bottom: 3px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.spec-value {
  color: var(--gray-900);
  font-size: 0.95rem;
  font-weight: 500;
}

.diamond-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 10px;
  border-top: 1px solid var(--gray-200);
}

.last-seen {
  font-size: 0.8rem;
  color: var(--gray-600);
  display: flex;
  align-items: center;
  gap: 5px;
}

.diamond-actions {
  display: flex;
  gap: 5px;
}

/* Responsive admin layout */
@media (max-width: 992px) {
  .stat-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .diamond-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .dashboard-container {
    padding: 1.5rem 2rem;
  }
}

@media (max-width: 768px) {
  .admin-table {
    display: block;
    overflow-x: auto;
  }
  
  /* Mobile navbar adjustments */
  .admin-nav {
    padding: 0.5rem 0;
  }
  
  /* Make navbar items display vertically on mobile */
  .navbar-nav {
    width: 100%;
    padding: 0.5rem 0;
  }
  
  /* Adjust spacing of nav items on mobile */
  .navbar-nav .nav-item {
    margin: 0.25rem 0;
  }
  
  /* Ensure dropdown menus appear properly on mobile */
  .navbar-nav .dropdown-menu {
    width: 100%;
    max-width: 100%;
    margin-top: 0.25rem;
    margin-bottom: 0.5rem;
    position: static;
    float: none;
    box-shadow: none;
    border: 1px solid rgba(0,0,0,0.1);
  }
  
  /* Make dropdown items more tappable on mobile */
  .dropdown-item {
    padding: 0.75rem 1.2rem;
  }
  
  /* Adjust active indicator for mobile */
  .admin-nav-link.active:after {
    height: 3px;
  }
  
  .form-row {
    flex-direction: column;
  }
  
  .form-col {
    margin-bottom: 1rem;
  }
}

@media (max-width: 768px) {
  .diamond-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }
  
  .dashboard-container {
    padding: 1rem;
  }
  
  /* Quick Actions buttons on mobile */
  .card-body .row [class*="col-"] {
    margin-bottom: 0.75rem;
  }
  
  /* Admin header with better spacing */
  .admin-header {
    padding: 1.2rem 0;
    margin-bottom: 1.5rem;
    text-align: center;
  }
  
  .admin-title {
    font-size: 1.6rem;
  }
  
  /* Better spacing for notification section */
  .card-header {
    padding: 0.75rem 1rem;
  }
  
  .card-body {
    padding: 1rem;
  }
  
  /* Diamond select dropdown */
  #diamond-select {
    margin-bottom: 1rem;
  }
  
  /* Better table display on mobile */
  .table-responsive {
    margin-bottom: 0;
    border: none;
  }
  
  .admin-table th, .admin-table td {
    padding: 0.75rem;
    white-space: nowrap;
  }
}

@media (max-width: 576px) {
  .stat-cards {
    grid-template-columns: 1fr;
  }
  
  .admin-form {
    padding: 1.25rem;
  }
  
  .diamond-grid {
    grid-template-columns: 1fr;
  }
  
  /* Further refinements for very small screens */
  .dashboard-container {
    padding: 0.75rem;
  }
  
  /* Ensure the cards have proper spacing */
  .stat-card {
    margin-bottom: 1rem;
  }
  
  /* Ensure admin buttons are properly sized in responsive layout */
  .admin-responsive .btn {
    display: block;
    width: 100%;
  }
  
  /* Adjust notification preview */
  .notification-preview {
    padding: 0.75rem !important;
  }
}

/* ===== DASHBOARD REFINEMENT - ENHANCED ===== */

/* Overall Page/Container */
.dashboard-container { 
    /* Increased padding for more 'air' */
    padding: 2.5rem 4rem; 
    background-color: transparent !important; /* Make dashboard area transparent */
}

.dashboard-header { 
    margin-bottom: 3rem; /* More space below header */
}

.dashboard-title {
    font-family: var(--primary-font); 
    font-size: clamp(2.4rem, 5vw, 2rem); /* Slightly larger */
    color: var(--primary-color);
    margin-bottom: 2rem; /* More space below title */
    margin-top: 2rem; /* More space below title */
    font-weight: 300;
    text-align: center;
}

/* Search/Filter Bar - REFINED for Harmony */
.search-filter-bar {
    background-color: #ffffff; 
    padding: 0.75rem 1rem; /* Slightly adjusted padding */
    border-radius: 12px; /* Consistent soft corners for the container */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05); 
    display: flex;
    gap: 0.75rem; /* Slightly reduced gap between items */
    align-items: center; /* Vertically align all items */
    border: 1px solid var(--gray-200); /* Optional: Very subtle border for definition */
}

/* Common styles for input, select, and button for height/font consistency */
.search-filter-bar .form-control,
.search-filter-bar .form-select,
.search-filter-bar .btn { /* Target all relevant elements */
    font-family: var(--secondary-font);
    font-size: 0.9rem; /* Consistent font size */
    padding-top: 0.7rem;    /* Consistent vertical padding */
    padding-bottom: 0.7rem; /* Consistent vertical padding */
    height: auto; /* Allow padding to determine height */
    line-height: 1.5; /* Consistent line height */
    border-radius: 8px; /* Consistent corner radius for inner elements */
    border: none; /* Remove individual borders initially */
    margin: 0; /* Remove any default margins */
    vertical-align: middle; /* Helps with alignment */
    margin-top: 0.5rem;
}

/* Specific styles for input and select */
.search-filter-bar .form-control,
.search-filter-bar .form-select { 
    background-color: var(--gray-100); /* Subtle background */
    color: var(--gray-700);
    padding-left: 1rem;
    padding-right: 1rem;
    /* Optional: Add back a subtle border if needed */
    /* border: 1px solid var(--gray-200); */ 
}
.search-filter-bar .form-control::placeholder {
    color: var(--gray-500);
    opacity: 1;
}
.search-filter-bar .form-control:focus,
.search-filter-bar .form-select:focus {
    background-color: #ffffff; /* White on focus */
    box-shadow: 0 0 0 2px rgba(26, 35, 126, 0.2); /* Focus ring */
    outline: none;
    /* border-color: var(--primary-color); /* Optional: if using border */
}
.search-filter-bar input[type="search"] {
    flex-grow: 1; /* Allow search input to take most space */
}

/* Custom adjustments for search filter buttons */
.search-filter-bar .btn {
    padding-left: 1.75rem; 
    padding-right: 1.75rem;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
    white-space: nowrap; /* Prevent text wrapping */
}

/* Adjust default select arrow appearance if needed (browser specific) */
.search-filter-bar .form-select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e"); /* Default Bootstrap arrow */
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    appearance: none; /* Remove default system appearance */
    padding-right: 2.5rem; /* Make space for the custom arrow */
}

/* Diamond Grid */
.diamond-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
    gap: 2.5rem;
    justify-items: center; /* Center cards in grid */
}

/* Refined Diamond Card */
.diamond-card {
    background-color: #ffffff; 
    border-radius: 16px; /* Softer corners */
    /* More diffused shadow */
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04), 0 10px 40px rgba(0, 0, 0, 0.06); 
    overflow: hidden; 
    display: flex;
    flex-direction: column; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--gray-200); /* Very subtle border */
}

.diamond-card:hover {
    transform: translateY(-6px);
    /* Slightly enhanced shadow on hover */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.05), 0 15px 50px rgba(0, 0, 0, 0.08);
}

/* Placeholder Area */
.diamond-placeholder {
    background-color: var(--gray-100); 
    height: 180px; 
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400); 
    border-bottom: 1px solid var(--gray-200); /* Separator */
}
.diamond-placeholder svg { 
    width: 55px; /* Adjusted size */
    height: 55px;
    opacity: 0.7;
    stroke-width: 1.2; /* Thinner stroke for elegance */
}

/* Card Details Section */
.diamond-details {
    padding: 1.25rem 1.5rem; /* Adjusted padding */
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}

/* Status Indicator - Refined */
.diamond-status-indicator {
    display: flex;
    align-items: center;
    margin-bottom: 0.75rem;
    /* Optional: Position top-right (requires parent relative positioning) */
    /* position: absolute; top: 1.25rem; right: 1.5rem; */
}

.status-dot {
    width: 8px; /* Smaller dot */
    height: 8px;
    border-radius: 50%;
    margin-right: 0.4rem; /* Reduced margin */
    display: inline-block;
    flex-shrink: 0; /* Prevent dot from shrinking */
}
.status-dot.in-safe { background-color: var(--success-color); }
.status-dot.removed { background-color: var(--danger-color); }

.status-text {
    font-family: var(--secondary-font);
    font-size: 0.7rem; /* Smaller text */
    font-weight: 600;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.8px; /* More spacing */
    line-height: 1;
}

/* Diamond Title (ID) */
.diamond-title {
    font-family: var(--primary-font); 
    font-size: 1.3rem; /* Adjusted size */
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.6rem; /* Adjusted spacing */
    line-height: 1.3;
}

/* Diamond Specs */
.diamond-specs {
    font-family: var(--secondary-font);
    font-size: 0.85rem; /* Slightly smaller */
    color: var(--gray-700);
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.diamond-specs span { 
    margin: 0 0.3em;
}
.diamond-specs span:first-child { margin-left: 0; }
.diamond-specs span:last-child { margin-right: 0; }

/* Timestamp */
.diamond-last-seen {
    font-family: var(--secondary-font);
    font-size: 0.75rem; /* Slightly smaller */
    color: var(--gray-500); 
    margin-top: auto; 
    padding-top: 1rem; 
    margin-bottom: 1.25rem; /* More space before buttons */
}

/* Action Buttons Container - Added for alignment */
.diamond-actions {
    margin-top: auto; /* Push to bottom */
    text-align: right; /* Align buttons to the right */
}

/* Diamond card action buttons - custom styling */
.diamond-card .btn { 
    margin-left: 0.5rem; /* Space between buttons if multiple */
    font-size: 0.8rem; /* Smaller text */
    padding: 0.6rem 1.2rem; /* Adjusted padding */
}

.diamond-card .btn svg { 
    width: 14px; /* Smaller icon */
    height: 14px;
    margin-right: 0.4rem; /* Adjusted icon margin */
}

/* Custom button variants for diamond simulation */
.btn-simulate-removal {
    background-color: transparent;
    border: 1.5px solid var(--gray-400);
    color: var(--gray-700);
}

.btn-simulate-removal:hover {
    background-color: var(--gray-100);
    border-color: var(--gray-500);
    color: var(--gray-900);
}

.btn-simulate-return {
    background-color: var(--primary-color);
    border: 1.5px solid var(--primary-color);
    color: var(--light-color);
}

.btn-simulate-return:hover {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

/* Pagination Refinement */
.pagination { 
    justify-content: center; 
    margin-top: 4rem; /* More space above pagination */
}
.pagination .page-item .page-link {
    font-family: var(--secondary-font);
    color: var(--primary-color);
    border: 1px solid var(--gray-300);
    margin: 0 0.25rem; /* Slightly more space */
    border-radius: 8px; /* Consistent rounding */
    transition: all 0.3s ease;
    padding: 0.6rem 0.9rem; /* Adjusted padding */
    font-size: 0.9rem;
}
.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--light-color);
    z-index: 3;
}
.pagination .page-item .page-link:hover {
    background-color: var(--gray-200);
    border-color: var(--gray-400);
    z-index: 2;
}
.pagination .page-item.disabled .page-link {
    color: var(--gray-400);
    background-color: transparent;
    border-color: var(--gray-300);
}

/* Modal styles for RFID history and other popups */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1050;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-container {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    padding: 1rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.modal-close-btn:hover {
    color: #343a40;
}

.modal-body {
    padding: 1rem;
    overflow-y: auto;
    max-height: calc(90vh - 130px);
}

.modal-footer {
    padding: 1rem;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
}

/* CVC History container styles */
.rfid-history-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.history-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    border-radius: 8px;
    background-color: #f8f9fa;
    border-left: 4px solid #dee2e6;
}

.history-item.added {
    border-left-color: var(--success-color);
    background-color: rgba(46, 204, 113, 0.05);
}

.history-item.removed {
    border-left-color: var(--danger-color);
    background-color: rgba(231, 76, 60, 0.05);
}

.history-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
}

.history-content {
    flex: 1;
}

.history-event {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.history-time {
    font-size: 0.875rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.history-user {
    font-size: 0.875rem;
    color: #495057;
}

.history-transaction {
    font-size: 0.75rem;
    word-break: break-all;
}

/* Diamond card data attribute */
.diamond-card {
    position: relative;
}

.diamond-card[data-diamond-id] {
    position: relative;
}

/* Status Indicators with Animation */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.875rem;
}

.status-indicator .status-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

.status-indicator.in-safe {
    color: var(--success-color);
    background-color: rgba(46, 204, 113, 0.1);
}

.status-indicator.removed {
    color: var(--danger-color);
    background-color: rgba(231, 76, 60, 0.1);
}

.status-indicator.in-safe .status-dot {
    background-color: var(--success-color);
}

.status-indicator.removed .status-dot {
    background-color: var(--danger-color);
}

/* Pulsing animation for status indicators */
.status-dot.pulse::before {
    content: "";
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
    z-index: -1;
}

.status-indicator.in-safe .status-dot.pulse::before {
    box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    animation: pulse-green 1.5s infinite;
}

.status-indicator.removed .status-dot.pulse::before {
    box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    animation: pulse-red 1.5s infinite;
}

@keyframes pulse-green {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

@keyframes pulse-red {
    0% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(231, 76, 60, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(231, 76, 60, 0);
    }
}

