/* ==========================================================================
   Tutor Dashboard Styles - TutorMatch
   ========================================================================== */

/* Root Variables & Colors */
:root {
  --primary-blue: #2563eb;
  --primary-blue-dark: #1d4ed8;
  --primary-blue-light: #eff6ff;
  --bg-main: #f8fafc;
  --bg-card: #ffffff;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --border-color: #e2e8f0;

  /* Widget Soft Colors */
  --indigo-bg: #e0e7ff;
  --indigo-text: #4338ca;
  --sky-bg: #e0f2fe;
  --sky-text: #0369a1;
  --amber-bg: #fef3c7;
  --amber-text: #b45309;
  --emerald-bg: #d1fae5;
  --emerald-text: #047857;

  --sidebar-width: 260px;
  --header-height: 70px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.08);
  --transition: all 0.2s ease-in-out;
}

/* Reset & Base Body */
body.tm-dashboard-body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* Wrapper & Sidebar Layout */
.tm-dashboard-wrapper {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.tm-dashboard-sidebar {
  width: var(--sidebar-width);
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.tm-sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px 24px;
  text-decoration: none;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 20px;
  color: var(--primary-blue);
  border-bottom: 1px solid var(--border-color);
}

.tm-sidebar-logo img {
  width: 32px;
  height: 32px;
}

.tm-sidebar-nav-wrap {
  flex: 1;
  padding: 20px 16px;
  overflow-y: auto;
}

.tm-sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tm-sidebar-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}

.tm-sidebar-nav a i {
  font-size: 18px;
}

.tm-sidebar-nav a:hover {
  background-color: var(--primary-blue-light);
  color: var(--primary-blue);
}

.tm-sidebar-nav a.active {
  background-color: var(--primary-blue);
  color: #ffffff;
}

.tm-sidebar-badge {
  margin-left: auto;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
}

.tm-sidebar-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #94a3b8;
  letter-spacing: 0.05em;
  margin: 16px 0 8px 12px;
}

.tm-sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.tm-sidebar-footer a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  color: #dc2626;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.tm-sidebar-footer a:hover {
  background-color: #fee2e2;
}

/* Main Content Layout */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* Top Header */
.top-header {
  height: var(--header-height);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 90;
}

.tm-dashboard-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-main);
}

.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-left: auto;
}

.icon-btn {
  background: none;
  border: 1px solid var(--border-color);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition);
}

.icon-btn:hover {
  background-color: var(--bg-main);
  color: var(--text-main);
}

.notification-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  background-color: #ef4444;
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg-card);
}

.header-user-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.header-user-profile:hover {
  background-color: var(--bg-main);
}

.avatar-small {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--border-color);
}

.profile-meta {
  display: flex;
  flex-direction: column;
}

.profile-meta .name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-main);
}

.profile-meta .role {
  font-size: 12px;
  color: var(--text-muted);
}

/* Dashboard Content */
.tm-dashboard-content {
  padding: 32px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

/* Welcome Block Header */
.tm-welcome-block {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  background: var(--bg-card);
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.tm-welcome-accent {
  width: 48px;
  height: 48px;
  background: var(--primary-blue-light);
  color: var(--primary-blue);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
}

.tm-welcome-block h1 {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 4px 0;
}

.tm-welcome-block p {
  margin: 0;
  color: var(--text-muted);
  font-size: 14px;
}

/* Stats Widgets Grid */
.tm-stat-widgets {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 36px;
}

.tm-stat-widget {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.tm-stat-widget:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tm-stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.tm-stat-icon--indigo { background-color: var(--indigo-bg); color: var(--indigo-text); }
.tm-stat-icon--sky { background-color: var(--sky-bg); color: var(--sky-text); }
.tm-stat-icon--amber { background-color: var(--amber-bg); color: var(--amber-text); }
.tm-stat-icon--emerald { background-color: var(--emerald-bg); color: var(--emerald-text); }

.tm-stat-widget h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 2px 0;
}

.tm-stat-widget span {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

/* Dashboard Section */
.tm-dashboard-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tm-dashboard-section-header h2 {
  font-size: 18px;
  font-weight: 700;
  margin: 0;
}

.tm-dashboard-section-header a {
  color: var(--primary-blue);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.tm-dashboard-section-header a:hover {
  color: var(--primary-blue-dark);
}

/* Tuitions Grid Layout */
.tuitions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
}

/* Overlay for Mobile Sidebar */
.tm-sidebar-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.5);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.tm-sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* ==========================================================================
   Responsive Styles
   ========================================================================== */

@media (max-width: 1024px) {
  .tm-stat-widgets {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .tm-dashboard-sidebar {
    transform: translateX(-100%);
  }

  .tm-dashboard-sidebar.active {
    transform: translateX(0);
  }

  .main-content {
    margin-left: 0;
  }

  .tm-dashboard-menu-toggle {
    display: block;
  }

  .top-header {
    padding: 0 16px;
  }

  .tm-dashboard-content {
    padding: 20px 16px;
  }

  .tm-stat-widgets {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .profile-meta {
    display: none;
  }
}
