/* ========================================
   COASTWISE ADMIN AREA STYLES
   Unified stylesheet for all admin components
   ======================================== */

/* ========================================
   ADMIN LAYOUT & NAVIGATION
   ======================================== */

.admin-navigation {
  background: linear-gradient(135deg, #004d97 0%, #cb3839 100%);
  color: white;
  padding: 2rem;
  min-height: 100vh;
  width: 300px;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
}

.admin-nav-header {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.admin-nav-header h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.8rem;
  font-weight: 700;
  display: flex;
  align-items: center;
}

.admin-nav-header h2::before {
  content: "🌊";
  margin-right: 0.5rem;
  font-size: 1.5rem;
}

.admin-nav-header p {
  margin: 0;
  opacity: 0.9;
  font-size: 0.95rem;
  line-height: 1.4;
}

.admin-nav-menu {
  margin-top: 0;
}

.admin-nav-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  margin: 0.25rem 0;
  color: white;
  text-decoration: none;
  border-radius: 12px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-weight: 500;
  position: relative;
  overflow: hidden;
}

.admin-nav-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left 0.5s;
}

.admin-nav-item:hover::before {
  left: 100%;
}

.admin-nav-item:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateX(8px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-nav-item.active {
  background: rgba(255, 255, 255, 0.25);
  border-left: 4px solid #f8d447;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateX(4px);
}

.admin-nav-item i {
  margin-right: 0.75rem;
  width: 20px;
  text-align: center;
  font-size: 1.1rem;
}

.admin-nav-item span {
  flex: 1;
}

.admin-nav-back {
  margin-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: 1rem;
}

.admin-nav-back:hover {
  background: rgba(255, 255, 255, 0.05);
}

/* Admin Content Layout */
.admin-content {
  margin-left: 300px;
  padding: 2rem;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  position: relative;
}

.admin-content::before {
  content: '';
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="%23ffffff" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="%23ffffff" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
  pointer-events: none;
  z-index: 0;
}

/* ========================================
   ADMIN HEADERS & DASHBOARD
   ======================================== */

.admin-header {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  padding: 2.5rem;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  margin-bottom: 2rem;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #004d97, #cb3839, #f8d447);
}

.admin-header h1 {
  margin: 0 0 0.5rem 0;
  color: #2c3e50;
  font-size: 2.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, #004d97, #cb3839);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-header h2 {
  color: #2c3e50;
  margin: 0 0 0.5rem 0;
  font-size: 2.2rem;
  font-weight: 700;
}

.admin-header p {
  margin: 0;
  color: #6c757d;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.5;
}

/* Dashboard Styles */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.stat-card:hover {
  transform: translateY(-2px);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 1rem;
  font-size: 1.5rem;
  color: white;
}

.stat-card:nth-child(1) .stat-icon {
  background: linear-gradient(135deg, #004d97 0%, #cb3839 100%);
}

.stat-card:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, #cb3839 0%, #f8d447 100%);
}

.stat-card:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, #004d97 0%, #f8d447 100%);
}

.stat-card:nth-child(4) .stat-icon {
  background: linear-gradient(135deg, #f8d447 0%, #cb3839 100%);
}

.stat-content h3 {
  margin: 0;
  font-size: 2rem;
  font-weight: 700;
  color: #2c3e50;
}

.stat-content p {
  margin: 0.25rem 0 0 0;
  color: #7f8c8d;
  font-weight: 500;
}

.stat-content small {
  color: #95a5a6;
  font-size: 0.85rem;
}

.dashboard-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2rem;
}

.action-section h3 {
  margin: 0 0 1rem 0;
  color: #2c3e50;
  font-size: 1.2rem;
}

.action-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.action-buttons .btn {
  justify-content: flex-start;
  text-align: left;
}

.activity-list {
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid #ecf0f1;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-item i {
  margin-right: 0.75rem;
  color: #3498db;
  width: 20px;
  text-align: center;
}

.activity-item span {
  flex: 1;
  color: #2c3e50;
}

.activity-item small {
  color: #95a5a6;
  font-size: 0.8rem;
}

/* ========================================
   ADMIN TABLES
   ======================================== */

.admin-table-container {
  background: white;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.admin-table thead {
  background: linear-gradient(135deg, #004d97 0%, #cb3839 100%);
  color: white;
}

.admin-table thead th {
  padding: 1.5rem 1rem;
  text-align: left;
  font-weight: 600;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: none;
}

.admin-table tbody tr {
  border-bottom: 1px solid #f1f3f4;
  transition: all 0.3s ease;
}

.admin-table tbody tr:hover {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  transform: scale(1.01);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.admin-table tbody tr.inactive {
  opacity: 0.6;
  background: #f8f9fa;
}

.admin-table tbody td {
  padding: 1.25rem 1rem;
  border: none;
  vertical-align: middle;
}

/* ========================================
   STATUS BADGES & INDICATORS
   ======================================== */

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* General Active/Inactive Status */
.status-badge.active {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.status-badge.inactive {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

/* Custom Message Status Colors */
.status-badge.status-active {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.status-badge.status-expired {
  background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
}

.status-badge.status-none {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.status.active {
  background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.status.inactive {
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.priority {
  background: #e2e3e5;
  color: #495057;
}

.audience {
  background: #d1ecf1;
  color: #0c5460;
}

/* ========================================
   BUTTONS & ACTIONS
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 12px;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  gap: 0.5rem;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

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

.btn-primary {
  background: linear-gradient(135deg, #004d97 0%, #cb3839 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 77, 151, 0.3);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 77, 151, 0.4);
}

.btn-secondary {
  background: linear-gradient(135deg, #f8d447 0%, #e6a800 100%);
  color: #000000;
  box-shadow: 0 4px 15px rgba(255, 188, 0, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(255, 188, 0, 0.4);
}

.btn-danger {
  background: linear-gradient(135deg, #cb3839 0%, #8b1e1a 100%);
  color: white;
  box-shadow: 0 4px 15px rgba(161, 45, 41, 0.3);
}

.btn-danger:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(161, 45, 41, 0.4);
}

.btn-outline {
  background: transparent;
  color: #004d97;
  border: 2px solid #004d97;
}

.btn-outline:hover:not(:disabled) {
  background: #004d97;
  color: white;
  transform: translateY(-2px);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.8rem;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.action-buttons {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.admin-actions {
  display: flex;
  gap: 1rem;
  margin: 2rem 0;
  flex-wrap: wrap;
  align-items: center;
}

/* ========================================
   FORMS & INPUTS
   ======================================== */

.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: #2c3e50;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 1rem;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  font-size: 1rem;
  transition: all 0.3s ease;
  background: white;
  box-sizing: border-box;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #004d97;
  box-shadow: 0 0 0 3px rgba(0, 77, 151, 0.1);
  transform: translateY(-1px);
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-row .form-group {
  margin-bottom: 0;
}

.checkbox-label {
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 500;
  color: #2c3e50;
}

.checkbox-label input[type="checkbox"] {
  width: auto;
  margin-right: 0.75rem;
  transform: scale(1.2);
}

.form-group input[type="checkbox"] {
  width: auto;
  margin-right: 8px;
}

.form-group input[type="file"] {
  padding: 8px;
  border: 2px dashed #ced4da;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-group input[type="file"]:hover {
  border-color: #007bff;
  background: #e7f3ff;
}

.form-group input[type="file"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.form-group small {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 0.85em;
}

.form-help {
  display: block;
  margin-top: 5px;
  color: #6c757d;
  font-size: 0.85em;
}

.form-actions {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding: 2rem;
  border-top: 1px solid #e9ecef;
  background: #f8f9fa;
  border-radius: 0 0 20px 20px;
}

/* ========================================
   ALERTS & NOTIFICATIONS
   ======================================== */

.alert {
  padding: 1rem 1.5rem;
  border-radius: 12px;
  margin: 1rem 0;
  display: flex;
  align-items: center;
  font-weight: 500;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  gap: 0.75rem;
}

.alert-error {
  background: linear-gradient(135deg, #cb3839 0%, #8b1e1a 100%);
  color: white;
}

.alert-success {
  background: linear-gradient(135deg, #f8d447 0%, #e6a800 100%);
  color: #000000;
}

.alert i {
  margin-right: 0.75rem;
  font-size: 1.1rem;
}

/* ========================================
   MODALS & OVERLAYS
   ======================================== */

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
}

.modal {
  background: white;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-50px) scale(0.9);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 2rem;
  border-bottom: 1px solid #e9ecef;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 20px 20px 0 0;
}

.modal-header h2,
.modal-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.5rem;
  font-weight: 700;
}

.modal-body {
  padding: 2rem;
}

.modal-body p {
  margin: 0 0 10px 0;
  color: #495057;
  line-height: 1.5;
}

.modal-body .warning {
  color: #dc3545;
  font-weight: 600;
  background: #f8d7da;
  padding: 10px 15px;
  border-radius: 4px;
  border: 1px solid #f5c6cb;
}

.modal-actions {
  padding: 15px 25px 25px;
  display: flex;
  gap: 15px;
  justify-content: flex-end;
  border-top: 1px solid #e9ecef;
}

/* ========================================
   LOADING & EMPTY STATES
   ======================================== */

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  color: #6c757d;
  font-size: 1.1rem;
}

.loading i {
  margin-right: 0.75rem;
  font-size: 1.2rem;
}

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: #6c757d;
}

.empty-state i {
  font-size: 4rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

.empty-state h3 {
  margin: 1rem 0;
  color: #2c3e50;
  font-size: 1.5rem;
}

.empty-state p {
  margin-bottom: 2rem;
  font-size: 1.1rem;
  line-height: 1.5;
}

/* ========================================
   CUSTOM MESSAGE ADMIN SPECIFIC
   ======================================== */

/* Custom message admin uses standard admin layout */

.custom-message-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-top: 20px;
}

.location-selector h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.4em;
  font-weight: 600;
}

.location-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  overflow-y: auto;
  padding-right: 10px;
}

.location-card {
  background: white;
  border: 2px solid #e9ecef;
  border-radius: 8px;
  padding: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.location-card:hover {
  border-color: #007bff;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.location-card.selected {
  border-color: #007bff;
  background: #f8f9ff;
  box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

/* Badge Container */
.badge-container {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
}

/* Message Type Badge */
.message-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.message-type-badge.warning {
  background-color: #cb3839;
  color: #ffffff;
}

.message-type-badge.info {
  background-color: #004d97;
  color: #ffffff;
}


.location-info h4 {
  color: #2c3e50;
  margin: 0 0 5px 0;
  font-size: 1.1em;
  font-weight: 600;
}

.location-coords {
  color: #6c757d;
  font-size: 0.9em;
  margin: 0;
}

.message-status {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e9ecef;
}

.message-preview {
  margin-top: 8px;
  font-size: 0.9em;
  color: #495057;
  line-height: 1.4;
}

.message-form {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 25px;
  border: 1px solid #e9ecef;
}

.message-form h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.4em;
  font-weight: 600;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}

.form-header h3 {
  margin: 0;
  color: #2c3e50;
  font-size: 1.4em;
  font-weight: 600;
}

/* ========================================
   ADVERT ADMIN SPECIFIC
   ======================================== */

/* Advert admin uses standard admin layout */

.admin-controls {
  margin-bottom: 30px;
}

.location-selector {
  display: flex;
  align-items: center;
  gap: 15px;
}

.location-selector label {
  font-weight: 600;
  color: #495057;
}

.location-selector select {
  padding: 8px 12px;
  border: 2px solid #ced4da;
  border-radius: 6px;
  font-size: 1em;
  background: white;
  min-width: 200px;
}

.location-selector select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.advert-form {
  background: white;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 30px;
}

.advert-form h3 {
  color: #2c3e50;
  margin-bottom: 25px;
  font-size: 1.8em;
  font-weight: 600;
}

/* File Upload Styles */
.file-preview {
  margin-top: 10px;
  padding: 15px;
  background: #f8f9fa;
  border: 2px dashed #ced4da;
  border-radius: 6px;
}

.file-preview p {
  margin: 0;
  color: #495057;
  font-weight: 500;
}

.upload-progress {
  margin-top: 10px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e9ecef;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 5px;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #007bff, #0056b3);
  transition: width 0.3s ease;
}

.upload-progress span {
  font-size: 0.9em;
  color: #6c757d;
  font-weight: 500;
}

.adverts-list h3 {
  color: #2c3e50;
  margin-bottom: 20px;
  font-size: 1.6em;
  font-weight: 600;
}

.adverts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 20px;
}

.advert-item {
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.advert-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.advert-item.selected {
  border: 2px solid #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.advert-preview {
  height: 200px;
  overflow: hidden;
  background: #f8f9fa;
}

.advert-preview img,
.advert-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.advert-info {
  padding: 20px;
}

.advert-info h4 {
  color: #2c3e50;
  margin: 0 0 10px 0;
  font-size: 1.3em;
  font-weight: 600;
}

.advert-info p {
  color: #6c757d;
  margin: 0 0 15px 0;
  line-height: 1.5;
}

.advert-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 15px;
}

.advert-meta span {
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 500;
}

.advert-actions {
  display: flex;
  gap: 10px;
}

.advert-selection {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 10;
  background: rgba(255, 255, 255, 0.9);
  padding: 5px;
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.advert-selection input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Mass Selection Styles */
.mass-selection-controls {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  margin-bottom: 20px;
}

.selection-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 15px;
}

.select-all {
  display: flex;
  align-items: center;
  gap: 10px;
}

.select-all label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: #495057;
  cursor: pointer;
  margin: 0;
}

.select-all input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.selected-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}

.selected-count {
  font-weight: 600;
  color: #007bff;
  background: #e7f3ff;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.coordinates {
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 0.85rem;
  color: #6c757d;
  line-height: 1.4;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .admin-navigation {
    width: 100%;
    height: auto;
    position: relative;
    min-height: auto;
  }
  
  .admin-content {
    margin-left: 0;
    padding: 1rem;
  }
  
  .dashboard-actions {
    grid-template-columns: 1fr;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .form-row {
    grid-template-columns: 1fr;
  }
  
  .admin-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-actions .btn {
    width: 100%;
    justify-content: center;
  }
  
  .modal {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  .admin-table-container {
    overflow-x: auto;
  }
  
  .admin-table {
    min-width: 600px;
  }
  
  .custom-message-layout {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .location-grid {
    grid-template-columns: 1fr;
  }
  
  .form-actions {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
  }
  
  .advert-admin {
    padding: 15px;
  }
  
  .admin-header {
    flex-direction: column;
    gap: 15px;
    align-items: stretch;
  }
  
  .adverts-grid {
    grid-template-columns: 1fr;
  }
  
  .location-selector {
    flex-direction: column;
    align-items: stretch;
  }
  
  .location-selector select {
    min-width: auto;
  }
  
  .selection-actions {
    flex-direction: column;
    align-items: stretch;
  }
  
  .selected-actions {
    flex-direction: column;
    gap: 10px;
  }
  
  .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .custom-message-admin {
    padding: 10px;
  }
  
  .admin-content {
    padding: 20px;
  }
  
  .location-card {
    padding: 12px;
  }
  
  .message-form {
    padding: 20px;
  }
  
  .advert-form {
    padding: 20px;
  }
  
  .advert-actions {
    flex-direction: column;
  }
}

/* ========================================
   USERS ADMIN STYLES
   ======================================== */

.users-admin {
  display: flex;
  min-height: 100vh;
  background: #f8fafc;
}

.users-admin .admin-content {
  margin-left: 300px;
  padding: 2rem;
  width: calc(100% - 300px);
  background: #f8fafc;
}

.users-admin .admin-filters {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
}

.users-admin .filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 200px;
}

.users-admin .filter-group label {
  font-weight: 600;
  color: #374151;
  font-size: 0.9rem;
}

.users-admin .form-input,
.users-admin .form-select {
  padding: 0.75rem 1rem;
  border: 2px solid #e2e8f0;
  border-radius: 8px;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  background: white;
}

.users-admin .form-input:focus,
.users-admin .form-select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.users-admin .admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.users-admin .stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  gap: 1rem;
  transition: all 0.2s ease;
}

.users-admin .stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.users-admin .stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  background: linear-gradient(135deg, #0066cc 0%, #004d97 100%);
}

.users-admin .stat-content h3 {
  margin: 0 0 0.25rem 0;
  font-size: 2rem;
  font-weight: 700;
  color: #1f2937;
}

.users-admin .stat-content p {
  margin: 0;
  color: #6b7280;
  font-size: 0.9rem;
  font-weight: 500;
}

.users-admin .admin-table-container {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

.users-admin .admin-table {
  width: 100%;
  border-collapse: collapse;
}

.users-admin .admin-table th {
  background: #f8fafc;
  padding: 1rem 1.5rem;
  text-align: left;
  font-weight: 600;
  color: #374151;
  border-bottom: 2px solid #e2e8f0;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.users-admin .admin-table td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}

.users-admin .admin-table tr:hover {
  background: #f8fafc;
}

.users-admin .user-email {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.users-admin .user-email strong {
  color: #1f2937;
  font-weight: 600;
}

.users-admin .user-email small {
  color: #6b7280;
  font-size: 0.8rem;
  font-family: monospace;
}

.users-admin .date-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.users-admin .date-info small {
  color: #6b7280;
  font-size: 0.8rem;
}

.users-admin .badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.users-admin .badge-admin {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fbbf24;
  white-space: nowrap;
}

.users-admin .badge-user {
  background: #dbeafe;
  color: #2563eb;
  border: 1px solid #60a5fa;
  white-space: nowrap;
}

.users-admin .badge-safety-officer {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #f87171;
  white-space: nowrap;
}

.users-admin .badge-success {
  background: #d1fae5;
  color: #059669;
  border: 1px solid #34d399;
}

.users-admin .badge-warning {
  background: #fef3c7;
  color: #d97706;
  border: 1px solid #fbbf24;
}

.users-admin .badge-default {
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #d1d5db;
}

.users-admin .loading-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 3rem;
  color: #6b7280;
  font-size: 1.1rem;
}

.users-admin .loading-spinner i {
  font-size: 1.5rem;
  color: #0066cc;
}

.users-admin .table-footer {
  padding: 1rem 1.5rem;
  background: #f8fafc;
  border-top: 1px solid #e2e8f0;
  color: #6b7280;
  font-size: 0.9rem;
}

.users-admin .text-center {
  text-align: center;
  color: #6b7280;
  font-style: italic;
  padding: 2rem;
}

/* Responsive design for users admin */
@media (max-width: 768px) {
  .users-admin .admin-content {
    margin-left: 0;
    width: 100%;
    padding: 1rem;
  }
  
  .users-admin .admin-filters {
    flex-direction: column;
    gap: 1rem;
  }
  
  .users-admin .admin-stats {
    grid-template-columns: 1fr;
  }
  
  .users-admin .admin-table {
    font-size: 0.9rem;
  }
  
  .users-admin .admin-table th,
  .users-admin .admin-table td {
    padding: 0.75rem 1rem;
  }
}

/* Role Edit Styles */
.users-admin .role-select {
  min-width: 100px;
  padding: 0.5rem 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.9rem;
  background: white;
  transition: all 0.2s ease;
}

.users-admin .role-select:focus {
  outline: none;
  border-color: #0066cc;
  box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1);
}

.users-admin .role-select:disabled {
  background: #f8fafc;
  color: #6b7280;
  cursor: not-allowed;
}

.users-admin .role-edit-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.users-admin .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  border: none;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  gap: 0.25rem;
}

.users-admin .btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.users-admin .btn-sm {
  padding: 0.375rem 0.5rem;
  font-size: 0.8rem;
  min-width: 32px;
  height: 32px;
}

.users-admin .btn-primary {
  background: #0066cc;
  color: white;
  border: 1px solid #0052a3;
}

.users-admin .btn-primary:hover:not(:disabled) {
  background: #0052a3;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.users-admin .btn-secondary {
  background: #6b7280;
  color: white;
  border: 1px solid #4b5563;
}

.users-admin .btn-secondary:hover:not(:disabled) {
  background: #4b5563;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(107, 114, 128, 0.3);
}

.users-admin .btn-outline {
  background: transparent;
  color: #0066cc;
  border: 1px solid #0066cc;
}

.users-admin .btn-outline:hover:not(:disabled) {
  background: #0066cc;
  color: white;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3);
}

.users-admin .btn i {
  font-size: 0.8rem;
}

/* Loading state for role edit */
.users-admin .btn:disabled .fa-spinner {
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Responsive role edit */
@media (max-width: 768px) {
  .users-admin .role-edit-actions {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .users-admin .btn-sm {
    min-width: 28px;
    height: 28px;
    padding: 0.25rem;
  }
}

/* Delete User Styles */
.users-admin .user-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.users-admin .btn-danger {
  background: #dc2626;
  color: white;
  border: 1px solid #b91c1c;
}

.users-admin .btn-danger:hover:not(:disabled) {
  background: #b91c1c;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(220, 38, 38, 0.3);
}

.users-admin .btn-danger:disabled {
  background: #fca5a5;
  border-color: #fca5a5;
  cursor: not-allowed;
}

/* Modal Styles */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-dialog {
  background: white;
  border-radius: 12px;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.5rem 1.5rem 0 1.5rem;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 1rem;
}

.modal-header h3 {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1f2937;
}

.modal-close {
  background: none;
  border: none;
  color: #6b7280;
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 6px;
  transition: all 0.2s ease;
}

.modal-close:hover:not(:disabled) {
  background: #f3f4f6;
  color: #374151;
}

.modal-close:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.modal-body {
  padding: 0 1.5rem 1rem 1.5rem;
}

.delete-warning {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.delete-warning i {
  font-size: 3rem;
  color: #f59e0b;
}

.delete-warning p {
  margin: 0;
  color: #374151;
  line-height: 1.5;
}

.delete-warning .warning-text {
  color: #6b7280;
  font-size: 0.9rem;
  background: #fef3c7;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid #fbbf24;
}

.modal-footer {
  display: flex;
  gap: 1rem;
  justify-content: flex-end;
  padding: 1rem 1.5rem 1.5rem 1.5rem;
  border-top: 1px solid #e5e7eb;
  margin-top: 1rem;
}

.modal-footer .btn {
  min-width: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

/* Responsive modal */
@media (max-width: 768px) {
  .modal-dialog {
    margin: 1rem;
    max-width: calc(100% - 2rem);
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }
  
  .modal-footer {
    flex-direction: column;
  }
  
  .modal-footer .btn {
    width: 100%;
  }
}
