@import url('admin-themes.css');

/* Admin specific overriding styles */
body {
  background: var(--bg-primary);
  background-attachment: fixed;
  color: var(--text-primary);
  font-family: 'Outfit', sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.admin-container {
  flex: 1;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
  box-sizing: border-box;
}

/* Auth Screen styling */
.auth-overlay {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 100px);
}

.auth-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px rgba(255, 255, 255, 0.08) solid;
  border-radius: 24px;
  padding: 50px 40px;
  width: 100%;
  max-width: 480px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4);
  animation: fadeInUp 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-logo {
  width: 90px;
  height: 90px;
  margin: 0 auto 30px;
}

.auth-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 12px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  color: rgba(255, 255, 255, 0.6);
  font-size: 15px;
  margin-bottom: 40px;
  line-height: 1.5;
}

.btn-google {
  background: #ffffff;
  color: #1f2937;
  border: none;
  border-radius: 12px;
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  width: 100%;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-google:hover {
  background: #f3f4f6;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.btn-google i {
  font-size: 18px;
}

/* Admin Dashboard Panel styling */
.dashboard-panel {
  display: none; /* toggled via JS */
  animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding-bottom: 20px;
  border-bottom: 1px rgba(255, 255, 255, 0.08) solid;
}

.dashboard-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.dashboard-brand .logo-icon {
  width: 48px;
  height: 48px;
}

.dashboard-brand h1 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin: 0;
}

.dashboard-brand h1 span {
  color: var(--orange-primary);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-photo {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px var(--orange-primary) solid;
  background: #1f2937;
}

.user-details {
  text-align: right;
}

.user-name {
  font-weight: 600;
  font-size: 15px;
  margin: 0;
}

.user-email {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
  margin: 2px 0 0 0;
}

.btn-signout {
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.8);
  border: 1px rgba(255, 255, 255, 0.1) solid;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  margin-left: 10px;
}

.btn-signout:hover {
  background: rgba(255, 81, 47, 0.1);
  border-color: rgba(255, 81, 47, 0.3);
  color: #ff512f;
}

/* Metrics Grid */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

.metric-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px rgba(255, 255, 255, 0.05) solid;
  border-radius: 18px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  position: relative;
  overflow: hidden;
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, rgba(243,122,34,0.05) 0%, transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.metric-card:hover::before {
  opacity: 1;
}

.metric-icon {
  width: 54px;
  height: 54px;
  border-radius: 12px;
  background: rgba(243, 122, 34, 0.1);
  color: var(--orange-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
}

.metric-card.status-mode .metric-icon {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}

.metric-info h3 {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 6px 0;
}

.metric-number {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 32px;
  font-weight: 700;
  margin: 0;
}

.metric-number.status-text {
  font-size: 16px;
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
}

/* Content Area & Tabs */
.tabs-nav {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  border-bottom: 1px rgba(255, 255, 255, 0.08) solid;
  padding-bottom: 12px;
}

.tab-btn {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 16px;
  font-weight: 600;
  padding: 10px 20px;
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.3s;
  position: relative;
}

.tab-btn:hover {
  color: rgba(255, 255, 255, 0.9);
}

.tab-btn.active {
  color: var(--orange-primary);
  background: rgba(243, 122, 34, 0.05);
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -13px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--orange-gradient);
}

.controls-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 400px;
}

.search-wrapper i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.4);
  font-size: 14px;
}

.search-input {
  width: 100%;
  background: rgba(255, 255, 255, 0.03);
  border: 1px rgba(255, 255, 255, 0.08) solid;
  border-radius: 10px;
  padding: 12px 16px 12px 44px;
  box-sizing: border-box;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: all 0.3s;
}

.search-input:focus {
  outline: none;
  border-color: rgba(243, 122, 34, 0.4);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 4px rgba(243, 122, 34, 0.15);
}

.actions-wrapper {
  display: flex;
  gap: 12px;
}

.btn-export {
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  border: 1px rgba(255, 255, 255, 0.08) solid;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s;
}

.btn-export:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.2);
}

/* Data Table Container */
.table-container {
  background: rgba(255, 255, 255, 0.01);
  border: 1px rgba(255, 255, 255, 0.05) solid;
  border-radius: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  overflow: hidden;
  width: 100%;
}

.table-wrapper {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

th {
  background: rgba(255, 255, 255, 0.02);
  border-bottom: 1px rgba(255, 255, 255, 0.08) solid;
  padding: 18px 24px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
}

td {
  padding: 18px 24px;
  border-bottom: 1px rgba(255, 255, 255, 0.04) solid;
  color: rgba(255, 255, 255, 0.85);
  vertical-align: middle;
}

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

tr:hover td {
  background: rgba(255, 255, 255, 0.01);
}

table th:first-child, table td:first-child {
  padding-left: 16px;
  padding-right: 16px;
  width: 40px;
}

/* Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
  text-transform: capitalize;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.status-badge.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}
.status-badge.pending::before {
  background: #f59e0b;
}

.status-badge.confirmed {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.status-badge.confirmed::before {
  background: #3b82f6;
}

.status-badge.completed {
  background: rgba(16, 185, 129, 0.1);
  color: #10b981;
}
.status-badge.completed::before {
  background: #10b981;
}

.status-badge.quoted {
  background: rgba(139, 92, 246, 0.1);
  color: #8b5cf6;
}
.status-badge.quoted::before {
  background: #8b5cf6;
}

/* Action Selectors */
.action-select {
  background: rgba(255,255,255,0.03);
  border: 1px rgba(255,255,255,0.1) solid;
  color: #fff;
  border-radius: 6px;
  padding: 6px 10px;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  outline: none;
  transition: all 0.3s;
}

.action-select option {
  background: #12141a;
  color: #fff;
}

.action-select:focus {
  border-color: var(--orange-primary);
}

.btn-delete {
  background: none;
  border: none;
  color: rgba(239, 68, 68, 0.6);
  cursor: pointer;
  padding: 6px;
  font-size: 14px;
  border-radius: 6px;
  transition: all 0.3s;
  margin-left: 8px;
}

.btn-delete:hover {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 60px 40px;
  color: rgba(255,255,255,0.4);
}

.empty-state i {
  font-size: 40px;
  margin-bottom: 16px;
  color: rgba(255,255,255,0.1);
}

.empty-state p {
  margin: 0;
  font-size: 15px;
}

/* Access Denied overlay */
.denied-overlay {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 100px);
  text-align: center;
  padding: 20px;
  box-sizing: border-box;
  animation: fadeIn 0.5s;
}

.denied-card {
  background: rgba(239, 68, 68, 0.05);
  border: 1px rgba(239, 68, 68, 0.15) solid;
  border-radius: 20px;
  padding: 40px 30px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.denied-card i {
  font-size: 48px;
  color: #ef4444;
  margin-bottom: 20px;
}

.denied-card h2 {
  font-family: 'Space Grotesk', sans-serif;
  margin: 0 0 12px 0;
  color: #ef4444;
}

.denied-card p {
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  font-size: 15px;
  margin-bottom: 30px;
}

.denied-card .btn-signout {
  margin-left: 0;
  padding: 12px 24px;
  background: rgba(255,255,255,0.08);
  font-size: 14px;
}

/* Back link button */
.back-home-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  font-size: 14px;
  margin-bottom: 30px;
  transition: color 0.3s;
}

.back-home-link:hover {
  color: var(--orange-primary);
}

/* Responsiveness */
@media (max-width: 768px) {
  .dashboard-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
  }
  
  .user-profile {
    width: 100%;
    justify-content: space-between;
  }

  .controls-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .search-wrapper {
    max-width: none;
  }

  .btn-export {
    width: 100%;
    justify-content: center;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ==========================================================================
   Light Mode Portal Overrides
   ========================================================================== */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-tertiary: #f1f5f9;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --border-color: rgba(15, 23, 42, 0.08);
  --border-hover: rgba(15, 23, 42, 0.15);

  background: #f8fafc !important;
  color: #0f172a !important;
}

/* Light mode overrides for inline style colors */
body.light-theme [style*="color: #fff"],
body.light-theme [style*="color: rgb(255, 255, 255)"],
body.light-theme [style*="color:#fff"] {
  color: var(--text-primary) !important;
}

body.light-theme [style*="color: rgba(255,255,255"],
body.light-theme [style*="color:rgba(255,255,255"],
body.light-theme [style*="color: rgba(255, 255, 255"] {
  color: var(--text-secondary) !important;
}

body.light-theme [style*="background: rgba(255,255,255,0.02)"],
body.light-theme [style*="background:rgba(255,255,255,0.02)"],
body.light-theme [style*="background: rgba(255, 255, 255, 0.02)"] {
  background: var(--bg-tertiary) !important;
  border-color: var(--border-color) !important;
}

body.light-theme [style*="background: rgba(255,255,255,0.01)"],
body.light-theme [style*="background:rgba(255,255,255,0.01)"] {
  background: transparent !important;
}

body.light-theme .action-select {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.15) !important;
  color: #0f172a !important;
}

body.light-theme .action-select option {
  background: #ffffff !important;
  color: #0f172a !important;
}

body.light-theme .auth-card {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .auth-title {
  color: #0f172a !important;
}

body.light-theme .auth-subtitle {
  color: #475569 !important;
}

body.light-theme .btn-google {
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05) !important;
}

body.light-theme .dashboard-header {
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .dashboard-brand h1 {
  color: #0f172a !important;
}

body.light-theme .user-email {
  color: rgba(15, 23, 42, 0.5) !important;
}

body.light-theme .btn-signout {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .btn-signout:hover {
  background: rgba(243, 122, 34, 0.05) !important;
  border-color: rgba(243, 122, 34, 0.2) !important;
  color: var(--orange-primary) !important;
}

body.light-theme .tab-btn {
  color: rgba(15, 23, 42, 0.5) !important;
}

body.light-theme .tab-btn:hover {
  color: #0f172a !important;
}

body.light-theme .tab-btn.active {
  color: var(--orange-primary) !important;
  background: rgba(243, 122, 34, 0.05) !important;
}

body.light-theme .metric-card {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.02) !important;
}

body.light-theme .metric-info h3 {
  color: rgba(15, 23, 42, 0.5) !important;
}

body.light-theme .search-input {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.1) !important;
  color: #0f172a !important;
}

body.light-theme .search-input:focus {
  border-color: var(--orange-primary) !important;
  box-shadow: 0 0 0 4px rgba(243, 122, 34, 0.15) !important;
}

body.light-theme .search-wrapper i {
  color: rgba(15, 23, 42, 0.4) !important;
}

body.light-theme .btn-export {
  background: #ffffff !important;
  color: #475569 !important;
  border: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.light-theme .btn-export:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

body.light-theme .table-container {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.06) !important;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.02) !important;
}

body.light-theme th {
  color: rgba(15, 23, 42, 0.6) !important;
  background: rgba(15, 23, 42, 0.02) !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08) !important;
}

body.light-theme td {
  color: #0f172a !important;
  border-bottom: 1px solid rgba(15, 23, 42, 0.04) !important;
}

body.light-theme tr:hover td {
  background: rgba(15, 23, 42, 0.01) !important;
}

body.light-theme .empty-state {
  color: rgba(15, 23, 42, 0.4) !important;
}

body.light-theme .empty-state i {
  color: rgba(15, 23, 42, 0.1) !important;
}

body.light-theme .denied-card {
  background: rgba(239, 68, 68, 0.02) !important;
  border: 1px rgba(239, 68, 68, 0.1) solid !important;
  box-shadow: 0 10px 30px rgba(239, 68, 68, 0.03) !important;
}

body.light-theme .denied-card p {
  color: #475569 !important;
}

body.light-theme .back-home-link {
  color: rgba(15, 23, 42, 0.5) !important;
}

body.light-theme .back-home-link:hover {
  color: var(--orange-primary) !important;
}

body.light-theme .user-photo {
  background: #e2e8f0 !important;
  border-color: var(--orange-primary) !important;
}
