/* admin/assets/css/style.css */

/* ==========================================
   1. CORE VARIABLES & RESET
   ========================================== */
:root {
  --bg: #0f172a;
  --panel: rgba(17,24,39,.75);
  --panel2: rgba(15,23,42,.60);
  --field: rgba(5,8,22,.55);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --brand: #3b82f6;
  --danger: #ef4444;
  --border: #1f2937;
  --shadow: 0 10px 25px rgba(0,0,0,.35);
  --radius: 14px; /* Increased for a "Rich" look */
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  transition: background 0.4s ease;
  overflow-x: hidden;
}

/* ==========================================
   2. HEADER & TOPBAR
   ========================================== */
.page-title h1 { margin: 0; font-size: 20px; font-weight: 700; }
.page-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }

.topbar {
  height: 56px; 
  display: flex; 
  align-items: center; 
  justify-content: space-between;
  padding: 0 16px; 
  border-bottom: 1px solid var(--border); 
  background: var(--panel);
  backdrop-filter: blur(15px); /* Rich GUI Blur */
  position: sticky; 
  top: 0; 
  z-index: 10;
}

.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }

/* ==========================================
   3. LAYOUT & SIDEBAR
   ========================================== */
.layout { display: flex; min-height: calc(100vh - 56px); width: 100%; }

.sidebar {
  width: 240px; 
  flex-shrink: 0; 
  background-color: var(--panel);
  border-right: 1px solid var(--border);
  padding: 15px 8px; 
  backdrop-filter: blur(20px) saturate(160%); /* Deep glass effect */
}

.content {
  flex: 1; 
  padding: 20px; 
  min-width: 0; 
  display: flex; 
  flex-direction: column;
}

/* ==========================================
   4. CARDS (The Rich Glow System)
   ========================================== */
.card {
  background: var(--panel); 
  border: 1px solid var(--border);
  border-radius: var(--radius); 
  box-shadow: var(--shadow);
  padding: 18px; 
  width: 100%; 
  margin-bottom: 20px;
  backdrop-filter: blur(10px);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  border-color: var(--brand);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25), 0 0 10px var(--brand);
  transform: translateY(-4px);
}

.card-h {
  padding: 0 0 12px 0;
  border-bottom: 1px solid var(--border);
  font-size: 15px; 
  font-weight: 600;
  color: var(--text); 
  margin-bottom: 15px;
}

/* ==========================================
   5. SIDEBAR NAVIGATION
   ========================================== */
.group-title {
  color: var(--muted); 
  font-size: 10px; 
  font-weight: 600;
  text-transform: uppercase; 
  letter-spacing: 1.2px;
  margin: 20px 0 8px 12px; 
  opacity: 0.7;
}

.sidebar-link {
  display: flex; 
  align-items: center; 
  padding: 10px 12px; 
  color: var(--text); 
  border-radius: 8px; 
  margin-bottom: 4px; 
  font-size: 13.5px;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}

.sidebar-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 3px;
  height: 60%;
  background: var(--brand);
  border-radius: 0 4px 4px 0;
  transition: transform 0.3s ease;
  box-shadow: 0 0 8px var(--brand);
}

.sidebar-link:hover {
  background: var(--panel2);
  color: var(--brand);
  transform: translateX(5px);
}

.sidebar-link:hover::before,
.sidebar-link.active::before {
  transform: translateY(-50%) scaleY(1);
}

.sidebar-link.active {
  background: var(--panel2);
  color: var(--brand);
  border-left: 3px solid var(--brand);
  font-weight: 600;
}

.sidebar-link .icon {
  width: 22px;
  margin-right: 10px;
  display: flex;
  justify-content: center;
  transition: transform 0.3s ease;
}

.sidebar-link:hover .icon {
  transform: scale(1.15);
}

/* ==========================================
   6. TABLES & FORMS
   ========================================== */
.table { width: 100%; border-collapse: separate; border-spacing: 0; }
.table th, .table td { padding: 14px 12px; text-align: left; border-bottom: 1px solid var(--border); }
.table th { color: var(--muted); font-size: 12.5px; font-weight: 600; border-bottom: 2px solid var(--border); }
.table tr:nth-child(even) { background: rgba(255, 255, 255, 0.02); }

.filter-bar { display: flex; gap: 10px; margin-bottom: 15px; width: 100%; flex-wrap: wrap; }
.filter-bar input { flex: 2; min-width: 180px; }
.filter-bar select { flex: 1; min-width: 130px; }

input, select, textarea {
  background: var(--field); 
  color: var(--text); 
  border: 1px solid var(--border);
  padding: 10px 12px; 
  border-radius: 8px; 
  outline: none; 
  font-size: 13.5px;
  transition: border-color 0.2s ease;
}

input:focus, select:focus { border-color: var(--brand); }

/* ==========================================
   7. UI COMPONENTS (Buttons, Chips, Modals)
   ========================================== */
.btn {
  border: 1px solid var(--border); 
  background: var(--panel2); 
  color: var(--text);
  padding: 7px 14px; 
  border-radius: 6px; 
  cursor: pointer; 
  text-decoration: none;
  display: inline-flex; 
  align-items: center; 
  gap: 6px; 
  font-weight: 600; 
  font-size: 13px;
  transition: all 0.2s ease;
}

.btn:hover {
  border-color: var(--brand);
  box-shadow: 0 0 10px var(--brand);
  transform: translateY(-1px);
}

.btn.primary { background: var(--brand); color: #fff; border: none; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--panel2); font-size: 12px; }

.pc-modal { border: none; background: transparent; padding: 0; }
.pc-modal::backdrop { background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(4px); }
.pc-modal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  box-shadow: var(--shadow);
  width: 500px;
  max-height: 90vh;
  overflow: hidden;
  animation: modalFadeIn 0.3s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.pc-modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel2);
}

.pc-modal-title { margin: 0; font-size: 18px; color: var(--brand); }
.pc-modal-body { padding: 20px; background: var(--bg); color: var(--text); }
.pc-modal-actions {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  background: var(--panel2);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.pc-modal-close { background: transparent; border: none; color: var(--muted); font-size: 20px; cursor: pointer; }
.pc-modal-close:hover { color: var(--danger); }

/* ==========================================
   8. LOGIN PAGE REFINEMENT
   ========================================== */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 30px;
  backdrop-filter: blur(12px);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5), 0 0 10px var(--brand);
}

.login-card h1 { margin: 0 0 10px; font-size: 22px; text-align: center; }
.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 14px; text-align: center; }
.login-card .btn.primary { width: 100%; justify-content: center; padding: 12px; margin-top: 10px; }

/* ==========================================
   9. SPECIAL ELEMENTS (Logout, Zoho, Selects)
   ========================================== */
.sidebar-link[href*="logout"]:hover { color: var(--danger); border-color: var(--danger); }
.sidebar-link[href*="logout"]::before { background: var(--danger); box-shadow: 0 0 8px var(--danger); }

.logout-btn { text-decoration: none; display: inline-flex; align-items: center; gap: 6px; transition: all 0.3s ease; border: 1px solid var(--border); }
.logout-btn:hover {
  color: var(--danger) !important;
  border-color: var(--danger) !important;
  box-shadow: 0 0 10px var(--danger);
  transform: translateY(-1px);
}

.theme-selector {
  outline: none;
  appearance: none;
  padding-right: 24px !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 5 3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  background-color: var(--panel2);
  color: var(--text);
  border: 1px solid var(--border);
}

.chip.zoho-sync .dot { width: 8px; height: 8px; border-radius: 50%; }
.chip.zoho-sync.on { border-left: 3px solid #4caf50; }
.chip.zoho-sync.on .dot { background: #4caf50; box-shadow: 0 0 8px #4caf50; }
.chip.zoho-sync.off { border-left: 3px solid #f44336; }
.chip.zoho-sync.off .dot { background: #f44336; box-shadow: 0 0 8px #f44336; }
.sidebar-link-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 2px 8px;
    margin-bottom: 4px;
    border-radius: 8px;
    position: relative;
    transition: all 0.3s ease;
}

.sidebar-link-row:hover {
    background: var(--panel2);
}

.sidebar-link-row.active {
    background: var(--panel2);
    border-left: 4px solid var(--brand);
}

.sidebar-link-inner {
    display: flex;
    align-items: center;
    flex-grow: 1;
    text-decoration: none;
    color: var(--text);
    padding: 8px 4px;
    font-size: 13.5px;
}

.icon-setting-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s, transform 0.2s;
}

.icon-setting-btn:hover {
    color: var(--brand);
    transform: rotate(30deg);
}

/* Ensure the emoji logic from components.css still targets the dashboard icon */
.sidebar-link-inner .icon i {
    font-size: 0 !important;
}
/* Styling for Logout Chip */
.logout-btn {
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    border-color: var(--border);
    /* FIX: Force it to use theme color, overriding browser defaults */
    color: var(--text) !important; 
}

.logout-btn .label, .logout-btn .icon i {
    color: inherit; /* Ensures internal spans follow the parent color */
}

.logout-btn:hover {
    color: var(--danger) !important;
    border-color: var(--danger) !important;
    box-shadow: 0 0 10px var(--danger);
    transform: translateY(-1px);
}
/* Enhanced Hover Effects */

/* 1. Role Block Hover: Adds a subtle brand-colored glow and lift */
.role-block {
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.role-block:hover {
    transform: translateY(-4px);
    border-color: var(--brand);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(var(--brand-rgb), 0.2);
}

/* 2. List Item Focus: Makes the specific user row pop on hover */
.admin-list-item {
    transition: background 0.2s ease, padding-left 0.2s ease;
}

.admin-list-item:hover {
    background: rgba(255, 255, 255, 0.08);
    padding-left: 15px; /* Subtle slide effect */
}

/* 3. Action Buttons: Adds the "Glow" effect to Save and Permission buttons */
.btn.primary, .js-view-permissions {
    transition: all 0.2s ease;
}

.btn.primary:hover {
    box-shadow: 0 0 12px var(--brand);
    filter: brightness(1.1);
    transform: scale(1.05);
}

.js-view-permissions:hover {
    background: var(--brand) !important;
    color: white !important;
    border-color: var(--brand);
}

/* 4. Stat Cards: Adds depth to the dashboard row */
.dashboard-stat-card {
    transition: border-color 0.3s ease;
}

.dashboard-stat-card:hover {
    border-color: rgba(255, 255, 255, 0.15);
}
/* --- ENHANCED HOVER STATES --- */

/* Event Item Hover: Adds lift, background shift, and brand glow */
.event-item {
    transition: transform 0.3s ease, background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
    cursor: default;
}

.event-item:hover {
    transform: translateY(-3px); /* Subtle lift effect */
    background: rgba(255, 255, 255, 0.05) !important;
    border-color: var(--brand) !important;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.3), 0 0 10px rgba(var(--brand-rgb), 0.2);
}

/* Image zoom effect inside the list item */
.event-item:hover img {
    filter: brightness(1.2);
    transform: scale(1.05);
    transition: all 0.3s ease;
}

/* Location Card Glow */
.location-card {
    transition: border-color 0.4s ease, box-shadow 0.4s ease;
}

.location-card:hover {
    border-color: rgba(var(--brand-rgb), 0.5) !important;
}

/* Button Hover: Modern ProClub Glow */
.btn.primary {
    transition: all 0.2s ease-in-out;
    position: relative;
    overflow: hidden;
}

.btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 15px var(--brand); /* Brand-colored glow */
    filter: brightness(1.1);
}

.btn.primary:active {
    transform: translateY(0);
}

/* Icon Buttons (✎ and ✕) */
.event-item .btn-sm {
    transition: all 0.2s ease;
    border: 1px solid transparent !important;
}

.event-item .btn-sm:hover {
    background: rgba(255, 255, 255, 0.1) !important;
    border-color: var(--border) !important;
    transform: scale(1.1);
}