/**
 * Franchise Manager Dashboard Styles
 * Extends user_area.css with administration-specific styling
 */

/* ===== FRANCHISE MANAGER OVERRIDES ===== */

.franchise-manager-area {
  --franchise-primary: #8b5cf6;
  --franchise-secondary: #6366f1;
  --franchise-success: #10b981;
  --franchise-warning: #f59e0b;
  --franchise-danger: #ef4444;
  --franchise-info: #3b82f6;
}

/* Franchise Manager Profile Badge */
.franchise-manager-profile .ua-profile-avatar.franchise-badge {
  background: linear-gradient(135deg, var(--franchise-primary), var(--franchise-secondary));
  font-size: 1.5rem;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.franchise-manager-profile .ua-profile-avatar.franchise-badge i {
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.1);
    opacity: 0.8;
  }
}

/* Status Badge Variants */
.ua-nav-badge-success {
  background: var(--franchise-success);
}

.ua-nav-badge-warning {
  background: var(--franchise-warning);
}

.ua-nav-badge-danger {
  background: var(--franchise-danger);
  animation: pulse-badge 2s ease-in-out infinite;
}

.ua-nav-badge-info {
  background: var(--franchise-info);
}

@keyframes pulse-badge {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(239, 68, 68, 0);
  }
}

/* ===== DASHBOARD STATS CARDS ===== */

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

.fm-stat-card {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.4);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
  padding: 1.5rem;
  transition: all var(--transition, 0.3s ease);
}

.fm-stat-card:hover {
  transform: translateY(-4px);
  border-color: var(--business-primary, #df691a);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.fm-stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.fm-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md, 20px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
}

.fm-stat-icon.success {
  background: linear-gradient(135deg, var(--franchise-success), #059669) !important;
}

.fm-stat-icon.warning {
  background: linear-gradient(135deg, var(--franchise-warning), #d97706) !important;
}

.fm-stat-icon.danger {
  background: linear-gradient(135deg, var(--franchise-danger), #dc2626) !important;
}

.fm-stat-icon.info {
  background: linear-gradient(135deg, var(--franchise-info), #2563eb) !important;
}

.fm-stat-icon.primary {
  background: linear-gradient(135deg, var(--franchise-primary), var(--franchise-secondary)) !important;
}

.fm-stat-trend {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.fm-stat-trend.up {
  color: var(--franchise-success);
}

.fm-stat-trend.down {
  color: var(--franchise-danger);
}

.fm-stat-label {
  font-size: 0.875rem;
  color: var(--business-text-muted, #a8b2bd);
  margin-bottom: 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 500;
}

.fm-stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--business-text, #ffffff);
  line-height: 1;
}

.fm-stat-footer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
  font-size: 0.8rem;
  color: var(--business-text-muted, #a8b2bd);
}

/* ===== QUICK ACTIONS ===== */

.fm-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.fm-quick-action {
  position: relative;
  background: linear-gradient(145deg, rgba(50, 55, 62, 0.9) 0%, rgba(35, 39, 45, 0.95) 100%);
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: var(--business-text, #ffffff);
  overflow: hidden;
  min-height: 140px;
}

/* Gradient overlay on hover */
.fm-quick-action::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 120%, rgba(223, 105, 26, 0.15) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Animated border gradient */
.fm-quick-action::after {
  content: '';
  position: absolute;
  inset: -1px;
  background: linear-gradient(135deg, rgba(223, 105, 26, 0.5) 0%, transparent 50%, rgba(223, 105, 26, 0.3) 100%);
  border-radius: 17px;
  z-index: -1;
  opacity: 0;
  transition: opacity 0.4s ease;
}

.fm-quick-action:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(223, 105, 26, 0.4);
  box-shadow: 
    0 20px 40px rgba(0, 0, 0, 0.4),
    0 0 60px rgba(223, 105, 26, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.fm-quick-action:hover::before {
  opacity: 1;
}

.fm-quick-action:hover::after {
  opacity: 1;
}

.fm-quick-action i {
  font-size: 1.75rem;
  background: linear-gradient(135deg, #df691a 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 4px 12px rgba(223, 105, 26, 0.4));
  transition: all 0.4s ease;
}

.fm-quick-action:hover i {
  transform: scale(1.15);
  filter: drop-shadow(0 6px 20px rgba(223, 105, 26, 0.6));
}

.fm-quick-action-content {
  text-align: center;
}

.fm-quick-action-content h4 {
  font-size: 0.85rem;
  font-weight: 600;
  margin: 0;
  letter-spacing: 0.02em;
  transition: color 0.3s ease;
}

.fm-quick-action:hover .fm-quick-action-content h4 {
  color: #f59e0b;
}

.fm-quick-action-content p {
  font-size: 0.75rem;
  color: var(--business-text-muted, #a8b2bd);
  margin: 0.25rem 0 0 0;
}

/* ===== PENDING APPROVALS TABLE ===== */

.fm-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.fm-section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--business-text, #ffffff);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-right: 2rem;
}

.fm-section-title i {
  color: var(--business-primary, #df691a);
}

.fm-table-wrapper {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.4);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg, 24px);
  border: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
  overflow: hidden;
}

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

.fm-table thead {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.6);
  border-bottom: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
}

.fm-table th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--business-text-muted, #a8b2bd);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.fm-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
  color: var(--business-text, #ffffff);
}

.fm-table tr:hover {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.3);
}

.fm-table tr:last-child td {
  border-bottom: none;
}

/* Clickable Table Rows */
.fm-clickable-row {
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.fm-clickable-row:hover {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.5);
}

/* Table Thumbnails */
.fm-table-thumb {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.05);
  display: flex;
  align-items: center;
  justify-content: center;
}

.fm-table-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fm-table-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--business-text-muted, #a8b2bd);
  font-size: 1.25rem;
}

/* Table Title */
.fm-table-title {
  font-weight: 500;
  color: var(--business-text, #ffffff);
}

/* Table Muted Text */
.fm-table-muted {
  color: var(--business-text-muted, #a8b2bd);
}

/* Status Badges */
.fm-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 0.75rem;
  border-radius: var(--radius-sm, 12px);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.fm-status-badge.pending {
  background: rgba(245, 158, 11, 0.15);
  color: var(--franchise-warning);
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.fm-status-badge.approved {
  background: rgba(16, 185, 129, 0.15);
  color: var(--franchise-success);
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.fm-status-badge.offline {
  background: rgba(107, 114, 128, 0.15);
  color: #6b7280;
  border: 1px solid rgba(107, 114, 128, 0.3);
}

.fm-status-badge.notInUse {
  background: rgba(156, 163, 175, 0.15);
  color: #9ca3af;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

.fm-status-badge.reported {
  background: rgba(239, 68, 68, 0.15);
  color: var(--franchise-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse-badge 2s ease-in-out infinite;
}

.fm-status-badge.rejected {
  background: rgba(239, 68, 68, 0.15);
  color: var(--franchise-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.fm-status-badge.flagged {
  background: rgba(239, 68, 68, 0.15);
  color: var(--franchise-danger);
  border: 1px solid rgba(239, 68, 68, 0.3);
  animation: pulse-badge 2s ease-in-out infinite;
}

/* Action Buttons */
.fm-action-btns {
  display: flex;
  gap: 0.5rem;
}

.fm-btn {
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm, 12px);
  font-size: 0.85rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all var(--transition-fast, 0.15s);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.fm-btn-approve {
  background: var(--franchise-success);
  color: white;
}

.fm-btn-approve:hover {
  background: #059669;
  transform: translateY(-2px);
}

.fm-btn-reject {
  background: var(--franchise-danger);
  color: white;
}

.fm-btn-reject:hover {
  background: #dc2626;
  transform: translateY(-2px);
}

.fm-btn-primary {
  background: var(--business-primary, #df691a);
  color: white;
}

.fm-btn-primary:hover {
  background: #c55a15;
  transform: translateY(-2px);
}

.fm-btn-view {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.6);
  color: var(--business-text, #ffffff);
  border: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
}

.fm-btn-view:hover {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.8);
  border-color: var(--business-primary, #df691a);
  transform: translateY(-2px);
}

.fm-btn.disabled,
.fm-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
  transform: none !important;
}

/* ===== FILTERS & SEARCH ===== */

.fm-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.fm-search-box {
  flex: 1;
  min-width: 300px;
  position: relative;
  margin-left: auto;
}

.fm-search-box input {
  width: 100%;
  padding: 1rem 1.25rem 1rem 3.5rem;
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.6);
  backdrop-filter: blur(20px);
  border: 2px solid var(--business-border, rgba(255, 255, 255, 0.1));
  border-radius: var(--radius-lg, 16px);
  color: var(--business-text, #ffffff);
  font-size: 1rem;
  font-weight: 400;
  transition: all var(--transition, 0.3s ease);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.fm-search-box input::placeholder {
  color: var(--business-text-muted, #a8b2bd);
  opacity: 0.7;
}

.fm-search-box input:hover {
  border-color: rgba(255, 255, 255, 0.15);
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.7);
}

.fm-search-box input:focus {
  outline: none;
  border-color: var(--business-primary, #df691a);
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.8);
  box-shadow: 0 4px 16px rgba(223, 105, 26, 0.2), 0 0 0 4px rgba(223, 105, 26, 0.1);
}

.fm-search-box i {
  position: absolute;
  left: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--business-primary, #df691a);
  font-size: 1.1rem;
  transition: all var(--transition, 0.3s ease);
  pointer-events: none;
  z-index: 1;
}

.fm-search-box input:focus + i,
.fm-search-box:hover i {
  color: var(--business-primary-light, #fd7e14);
  transform: translateY(-50%) scale(1.1);
}

.fm-filter-btn {
  padding: 0.875rem 1.25rem;
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
  border-radius: var(--radius-sm, 12px);
  color: var(--business-text, #ffffff);
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition, 0.3s ease);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.fm-filter-btn:hover,
.fm-filter-btn.active {
  background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.6);
  border-color: var(--business-primary, #df691a);
}

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

@media (max-width: 1200px) {
  .fm-quick-actions {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .fm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
}

@media (max-width: 991px) {
  .fm-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .fm-section-title {
    padding-right: 0;
    font-size: 1.25rem;
  }
  
  .fm-filters {
    width: 100%;
    justify-content: flex-start;
  }
  
  .fm-quick-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
  }
  
  .fm-quick-action {
    padding: 1.25rem 1rem;
    min-height: 100px;
  }
  
  .fm-quick-action i {
    font-size: 1.5rem;
  }
  
  .fm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .fm-stat-card {
    padding: 1rem;
  }
  
  .fm-stat-icon {
    width: 40px;
    height: 40px;
    font-size: 1.25rem;
  }
  
  .fm-stat-value {
    font-size: 1.5rem;
  }
  
  .fm-stat-label {
    font-size: 0.75rem;
  }
}

@media (max-width: 768px) {
  .fm-section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .fm-section-title {
    font-size: 1.1rem;
    justify-content: center;
  }
  
  .fm-filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.5rem;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  
  .fm-filters::-webkit-scrollbar {
    display: none;
  }
  
  .fm-filter-btn {
    flex-shrink: 0;
    padding: 0.625rem 1rem;
    font-size: 0.75rem;
    white-space: nowrap;
  }
  
  .fm-quick-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
  }
  
  .fm-quick-action {
    padding: 1rem 0.5rem;
    min-height: 90px;
    gap: 0.5rem;
  }
  
  .fm-quick-action i {
    font-size: 1.25rem;
  }
  
  .fm-quick-action-content h4 {
    font-size: 0.7rem;
  }
  
  .fm-quick-action-content p {
    display: none;
  }
  
  .fm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  
  .fm-stat-card {
    padding: 0.875rem;
  }
  
  .fm-stat-icon {
    width: 36px;
    height: 36px;
    font-size: 1rem;
    border-radius: 10px;
  }
  
  .fm-stat-value {
    font-size: 1.25rem;
  }
  
  .fm-stat-label {
    font-size: 0.65rem;
    margin-bottom: 0.25rem;
  }
  
  .fm-stat-footer {
    font-size: 0.7rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  .fm-search-box {
    min-width: 100%;
  }
  
  .fm-search-box input {
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    font-size: 0.9rem;
  }
  
  .fm-search-box i {
    left: 1rem;
    font-size: 1rem;
  }

  /* Mobile Card Layout for Tables */
  .fm-table-wrapper {
    overflow: visible;
    background: transparent;
    border: none;
    border-radius: 0;
  }

  .fm-table {
    display: block;
    width: 100%;
  }
  
  .fm-table thead {
    display: none;
  }
  
  .fm-table tbody {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .fm-table tr {
    display: flex;
    flex-direction: column;
    background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.5);
    backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .fm-table tr:hover {
    background: rgba(var(--card-bg-rgb, 58, 63, 68), 0.6);
  }
  
  .fm-table td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0;
    border: none;
    font-size: 0.9rem;
  }
  
  .fm-table td::before {
    content: attr(data-label);
    font-weight: 600;
    font-size: 0.75rem;
    color: var(--business-text-muted, #a8b2bd);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    margin-right: 1rem;
  }
  
  .fm-table td:first-child {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .fm-table td:first-child::before {
    display: none;
  }
  
  .fm-table td:last-child {
    justify-content: flex-end;
    padding-top: 0.5rem;
    border-top: 1px solid var(--business-border, rgba(255, 255, 255, 0.08));
    margin-top: 0.25rem;
  }
  
  .fm-table td:last-child::before {
    display: none;
  }
  
  .ua-listing-cell {
    width: 100%;
  }
  
  .ua-listing-thumb {
    width: 60px;
    height: 45px;
  }
  
  .ua-listing-info h4 {
    font-size: 0.95rem;
  }
  
  .fm-action-btns {
    width: 100%;
    justify-content: flex-end;
  }
  
  .fm-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .fm-quick-actions {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }
  
  .fm-quick-action {
    padding: 0.75rem 0.4rem;
    min-height: 80px;
    border-radius: 12px;
  }
  
  .fm-quick-action i {
    font-size: 1.1rem;
  }
  
  .fm-quick-action-content h4 {
    font-size: 0.65rem;
  }
  
  .fm-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.4rem;
  }
  
  .fm-stat-card {
    padding: 0.65rem;
  }
  
  .fm-stat-icon {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    border-radius: 8px;
  }
  
  .fm-stat-value {
    font-size: 1rem;
  }
  
  .fm-stat-label {
    font-size: 0.55rem;
    letter-spacing: 0.3px;
  }
  
  .fm-stat-trend {
    font-size: 0.65rem;
  }
  
  .fm-stat-footer {
    display: none;
  }
  
  .fm-table tr {
    padding: 0.875rem;
  }
  
  .fm-table td {
    font-size: 0.85rem;
  }
  
  .fm-filter-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.7rem;
  }
}



