/* === admin_styles.css content merged with dashboard-specific styles === */

/* CSS VARIABLES */
:root {
  --pink-primary: #eb658e; /* fertility center pink */
  --pink-dark: #c74874;    /* darker pink */
  --gray-text: #333;
  --gray-light: #777;
  --bg-soft-pink: #fff7fb; /* soft pinkish-white */
  --box-shadow-pink-light: rgba(235, 101, 142, 0.15);
  --box-shadow-pink-medium: rgba(235, 101, 142, 0.25);
  --box-shadow-pink-strong: rgba(199, 72, 116, 0.7);
}

/* Basic body and font */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg-soft-pink);
  color: var(--gray-text);
}

.main-container {
  display: flex;
  min-height: 100vh;
  transition: margin-left 0.3s ease;
}

/* SIDEBAR */
.admin-sidebar {
  width: 250px;
  background-color: var(--pink-primary);
  color: white;
  padding: 1.5rem 1rem;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: width 0.3s ease;
  box-shadow: 3px 0 10px var(--box-shadow-pink-light);
  z-index: 999;
}

.admin-sidebar.collapsed {
  width: 70px;
  padding: 1.5rem 0.5rem;
}

.admin-sidebar .logo {
  text-align: center;
  margin-bottom: 2rem;
  user-select: none;
}

.admin-sidebar .logo img {
  max-width: 100%;
  height: 50px;
  object-fit: contain;
  margin-bottom: 0.5rem;
}

.admin-sidebar .logo h2 {
  font-size: 1.3rem;
  color: white;
  margin: 0;
  transition: opacity 0.3s ease;
}

.admin-sidebar.collapsed .logo h2 {
  opacity: 0;
  pointer-events: none;
  height: 0;
}

.admin-sidebar .menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.admin-sidebar .menu li {
  margin: 1rem 0;
}

.admin-sidebar .menu a {
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  font-weight: 600;
  font-size: 1rem;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  white-space: nowrap;
}

.admin-sidebar .menu a i {
  margin-right: 1rem;
  font-size: 1.2rem;
  width: 25px;
  text-align: center;
  min-width: 25px;
}

.admin-sidebar .menu a:hover,
.admin-sidebar .menu a.active {
  background-color: var(--pink-dark);
  box-shadow: 0 0 10px var(--box-shadow-pink-strong);
}

.admin-sidebar .menu a:focus {
  outline: 2px solid var(--pink-primary);
  outline-offset: 2px;
}

.admin-sidebar.collapsed .menu a {
  justify-content: center;
  padding: 0.5rem 0;
}

.admin-sidebar.collapsed .menu a span {
  display: none;
}

/* MAIN CONTENT */
.main-content {
  margin-left: 250px;
  padding: 2rem 2.5rem;
  flex: 1;
  transition: margin-left 0.3s ease;
}

.main-container.sidebar-collapsed .main-content {
  margin-left: 70px;
  padding: 2rem 1rem;
}

/* HEADER & TOGGLE */
.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.sidebar-toggle {
  font-size: 1.6rem;
  color: var(--pink-primary);
  cursor: pointer;
  background: none;
  border: none;
  transition: color 0.3s ease;
}

.sidebar-toggle:hover {
  color: var(--pink-dark);
}

.sidebar-toggle:focus {
  outline: 2px solid var(--pink-primary);
  outline-offset: 2px;
}

/* DASHBOARD STATS GRID */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.8rem;
  margin-bottom: 2rem;
}

/* CARD */
.card {
  background-color: white;
  border-left: 6px solid var(--pink-primary);
  padding: 1.5rem 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--box-shadow-pink-light);
  display: flex;
  align-items: center;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 6px 18px var(--box-shadow-pink-medium);
}

.card-icon {
  font-size: 2.5rem;
  margin-right: 1.5rem;
  color: var(--pink-primary);
  flex-shrink: 0;
}

.card-info h3 {
  margin: 0;
  font-size: 1.75rem;
  color: var(--gray-text);
}

.card-info p {
  margin: 0.3rem 0 0;
  color: var(--gray-light);
  font-size: 0.95rem;
}

/* BUTTONS */
.btn {
  background-color: var(--pink-primary);
  border: none;
  color: white;
  padding: 0.7rem 1.3rem;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
  text-decoration: none;
  display: inline-block;
  user-select: none;
}

.btn:hover {
  background-color: var(--pink-dark);
}

.btn:focus {
  outline: 2px solid var(--pink-primary);
  outline-offset: 2px;
}

/* Optional export button style */
.btn-download {
  box-shadow: 0 2px 6px var(--box-shadow-pink-light);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.btn-download:hover {
  box-shadow: 0 4px 12px var(--box-shadow-pink-strong);
  transform: scale(1.05);
}

/* TABLES */
table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 10px;
  box-shadow: 0 3px 10px var(--box-shadow-pink-light);
  overflow: hidden;
}

table thead {
  background-color: var(--pink-primary);
  color: white;
}

table thead th {
  padding: 1rem 1.2rem;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

table tbody td {
  padding: 0.9rem 1.2rem;
  border-bottom: 1px solid #f4c5d8;
  vertical-align: middle;
  color: #444;
  font-size: 0.95rem;
  word-break: break-word;
}

/* Prevent wrapping for important columns */
table tbody td.id-col,
table tbody td.user-col,
table tbody td.filename-col {
  white-space: nowrap;
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Actions buttons inside table */
.btn-edit {
  background-color: #ff77a9;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  margin-right: 0.5rem;
  border-radius: 6px;
  transition: background-color 0.3s ease;
  text-decoration: none;
  color: white;
  cursor: pointer;
}

.btn-edit:hover {
  background-color: #e65c89;
}

.btn-edit:focus {
  outline: 2px solid #ff77a9;
  outline-offset: 2px;
}

.btn-delete {
  background-color: #f39ca9;
  padding: 0.4rem 0.8rem;
  font-size: 0.9rem;
  border-radius: 6px;
  color: white;
  text-decoration: none;
  cursor: not-allowed;
  opacity: 0.5;
  pointer-events: none; /* disable */
}

/* Responsive Table */
@media (max-width: 768px) {
  .main-content {
    padding: 1rem;
    margin-left: 0;
  }
  .admin-sidebar {
    position: fixed;
    z-index: 1000;
    height: 100%;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }
  .admin-sidebar.active {
    transform: translateX(0);
  }
  .main-container.sidebar-collapsed .main-content {
    margin-left: 0;
  }
  table thead th,
  table tbody td {
    font-size: 0.85rem;
  }
}

/* Scrollbar for sidebar */
.admin-sidebar::-webkit-scrollbar {
  width: 6px;
}
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.3);
  border-radius: 3px;
}

/* Utility */
.text-center {
  text-align: center;
}

/* Sticky, Clickable, Animated Logo */
.admin-sidebar .sticky-logo {
  position: sticky;
  top: 0;
  z-index: 1001;
  background: var(--pink-primary);
  padding: 1rem 0.5rem;
  border-radius: 10px;
  text-align: center;
  animation: fadeInSlide 0.6s ease-out;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.admin-sidebar .sticky-logo a {
  display: block;
  text-decoration: none;
}

.logo-img {
  max-width: 100%;
  max-height: 60px;
  object-fit: contain;
  margin: 0 auto;
  transition: transform 0.3s ease;
}

.logo-img:hover {
  transform: scale(1.05);
}

.logo-title {
  font-size: 1.3rem;
  color: white;
  margin-top: 0.5rem;
  transition: opacity 0.3s ease;
}

/* Collapse behavior */
.admin-sidebar.collapsed .logo-title {
  opacity: 0;
  pointer-events: none;
  height: 0;
  overflow: hidden;
}

/* Entry animation */
@keyframes fadeInSlide {
  0% {
    opacity: 0;
    transform: translateY(-10px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Limit pie chart size and center */
#deviceChart {
  max-width: 300px !important;
  max-height: 300px !important;
  margin: 0 auto 30px auto;
  display: block;
}

/* Space between Download button and table */
section h2 + button {
  margin-bottom: 15px;
}

section table {
  width: 100%;
  border-collapse: collapse;
}

section table th, section table td {
  padding: 10px;
  text-align: left;
  border: 1px solid #ddd;
}

/* Recordings Dashboard Filters */

.filters {
  background: white;
  padding: 1rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--box-shadow-pink-light);
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

.filters label {
  font-weight: 600;
  color: var(--pink-primary);
  min-width: 110px;
}

.filters select,
.filters input[type="date"] {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  min-width: 160px;
  transition: border-color 0.3s ease;
}

.filters select:focus,
.filters input[type="date"]:focus {
  outline: none;
  border-color: var(--pink-primary);
}

/* Responsive filters */
@media (max-width: 600px) {
  .filters {
    flex-direction: column;
    align-items: flex-start;
  }
  .filters label, .filters select, .filters input[type="date"] {
    min-width: 100%;
  }
}

/* Table container with overflow */
.table-container {
  overflow-x: auto;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--box-shadow-pink-light);
  background: white;
  padding: 1rem;
  margin-bottom: 2rem;
}

/* Date Range Picker input style */
.daterange-picker {
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  border: 1px solid #ccc;
  font-size: 1rem;
  min-width: 200px;
  transition: border-color 0.3s ease;
}

.daterange-picker:focus {
  outline: none;
  border-color: var(--pink-primary);
}
