﻿:root {
  /* Rich, deep background gradient matching the prototype */
  --bg-gradient: linear-gradient(135deg, #e0e7ff 0%, #cbd5e1 50%, #f1f5f9 100%);
  
  /* True Glassmorphism layers */
  --glass-bg: rgba(255, 255, 255, 0.45);
  --glass-border: rgba(255, 255, 255, 0.6);
  --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
  
  /* Sidebar and Cards specific glass */
  --sidebar-bg: rgba(255, 255, 255, 0.55);
  --card-bg: rgba(255, 255, 255, 0.7);
  --card-border: 1px solid rgba(255, 255, 255, 0.8);
  
  /* Colors */
  --primary: #0284c7; /* Deep prototype blue */
  --secondary: #0f172a; /* Slate dark */
  --text-main: #334155;
  --text-muted: #64748b;
  --accent: #38bdf8;
  
  /* Typography */
  --font-base: 'Inter', sans-serif;
}

body {
  font-family: var(--font-base);
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text-main);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  overflow-x: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  padding: 1rem;
  box-sizing: border-box;
  gap: 1rem;
}

/* --- SIDEBAR --- */
.glass-sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 2rem 1.5rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  z-index: 10;
  flex-shrink: 0;
}

.sidebar-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav-item {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.8rem 1rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all 0.3s ease;
}

.sidebar-nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.sidebar-nav-item:hover, .sidebar-nav-item.active {
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary);
  box-shadow: 0 2px 10px rgba(0,0,0,0.02);
  transform: translateX(4px);
}

/* --- MAIN CONTENT AREA --- */
.main-wrapper {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  overflow: hidden;
}

/* --- HEADER --- */
header {
  background: var(--glass-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 0.8rem 1.5rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 5;
}

/* Search Bar in Header */
.search-container {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  padding: 0.4rem 1rem;
  width: 300px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}

.search-container input {
  border: none;
  background: transparent;
  width: 100%;
  margin-left: 8px;
  font-family: var(--font-base);
  font-size: 0.9rem;
  outline: none;
  color: var(--text-main);
}

/* --- DASHBOARD WIDGETS --- */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-bottom: 1rem;
}

.glass-widget {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--card-border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

/* Add a subtle shine to widgets */
.glass-widget::after {
  content: '';
  position: absolute;
  top: 0; left: -100%; width: 50%; height: 100%;
  background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  animation: shine 6s infinite;
}

@keyframes shine {
  0% { left: -100%; }
  20% { left: 200%; }
  100% { left: 200%; }
}

/* --- THE VIEWPORT (Where the document/cards live) --- */
.app-main-view {
  flex: 1;
  overflow-y: auto;
  border-radius: 20px;
  /* Instead of a white box, it's a transparent scrollable area */
  padding-right: 10px;
}

/* Custom Scrollbar for the main view */
.app-main-view::-webkit-scrollbar {
  width: 8px;
}
.app-main-view::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.2);
  border-radius: 10px;
}
.app-main-view::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 10px;
}

/* --- THE CARDS (Prototype Style) --- */
.authorities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
  padding-bottom: 2rem;
}

.authority-card {
  background: var(--card-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: var(--card-border);
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.04);
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  overflow: hidden;
}

.authority-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
}

/* Card inner layout mimicking prototype */
.authority-card .card-header {
  display: flex;
  gap: 15px;
  align-items: flex-start;
  margin-bottom: 15px;
}

.authority-card .card-avatar {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: #e2e8f0;
  border: 2px solid white;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  flex-shrink: 0;
}

.authority-card .card-info {
  flex: 1;
}

.authority-name {
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--secondary);
  line-height: 1.2;
  margin-bottom: 4px;
}

.authority-role {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

/* Contact info rows */
.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--text-main);
  margin-bottom: 8px;
}
.contact-row i {
  color: var(--primary);
  width: 16px;
  text-align: center;
  opacity: 0.7;
}

/* --- OBTUSIVE STYLES TO REMOVE (Targeting the old Document Box) --- */
.document-container {
  /* We only want a white box if we are explicitly in "A4 Print Preview" mode. 
     For the standard web view, it should blend completely. */
  background: transparent !important;
  box-shadow: none !important;
  border: none !important;
  padding: 0 !important;
}

/* --- BUTTONS --- */
.btn-primary {
  background: linear-gradient(135deg, #0ea5e9, #0284c7);
  color: white;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.2s;
  box-shadow: 0 4px 15px rgba(2, 132, 199, 0.3);
}
.btn-primary:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

/* Hide standard hierarchy titles unless explicitly browsing the tree, 
   the prototype focuses heavily on the raw data cards. */
.organ-title-box, .dept-title-box {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: var(--card-border);
  border-radius: 15px;
  padding: 1rem 1.5rem;
  margin: 2rem 0 1rem 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.organ-title h2 {
  font-size: 1.4rem;
  color: var(--secondary);
  margin: 0;
}

