/* ==========================================================================
   Zynaptic Apps Hub - Style System
   Premium High-Tech Dark Theme
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  /* Color System */
  --bg-primary: #080c16;
  --bg-secondary: #0d1527;
  --bg-card: rgba(18, 28, 51, 0.6);
  --bg-input: #121c32;
  
  --accent-cyan: #00f0ff;
  --accent-purple: #8b5cf6;
  --accent-blue: #3b82f6;
  
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dark: #64748b;
  
  --border-color: rgba(255, 255, 255, 0.06);
  --border-neon: rgba(0, 240, 255, 0.15);
  --border-neon-hover: rgba(0, 240, 255, 0.4);
  
  --shadow-neon: 0 0 20px rgba(0, 240, 255, 0.1);
  --shadow-neon-hover: 0 0 30px rgba(0, 240, 255, 0.25);
  
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  
  /* Font Families */
  --font-title: 'Outfit', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;
}

/* Reset & Base Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(139, 92, 246, 0.08) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(0, 240, 255, 0.06) 0%, transparent 40%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-body);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: inherit;
  text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-title);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Main Container Layout */
.app-container {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  padding: 0 24px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

/* Header & Navigation */
.navbar {
  background: rgba(8, 12, 22, 0.8);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.brand-accent {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-dot {
  width: 8px;
  height: 8px;
  background-color: var(--accent-cyan);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent-cyan);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
  padding: 6px 12px;
  border-radius: 6px;
}

.nav-link:hover, .nav-link.active {
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.05);
}

/* Glassmorphism Panel / Form Card */
.glass-panel {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.glass-panel:hover {
  border-color: rgba(255, 255, 255, 0.1);
}

/* User Dashboard Cards Grid */
.dashboard-header {
  margin: 40px 0 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-title {
  font-size: 28px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

/* App Card Component */
.app-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  height: 100%;
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  opacity: 0.8;
}

.app-card:hover {
  transform: translateY(-5px);
  border-color: var(--border-neon-hover);
  box-shadow: var(--shadow-neon-hover);
}

.app-icon {
  width: 48px;
  height: 48px;
  background: rgba(0, 240, 255, 0.1);
  border: 1px solid rgba(0, 240, 255, 0.2);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
  color: var(--accent-cyan);
  font-size: 20px;
}

.app-card:hover .app-icon {
  background: rgba(0, 240, 255, 0.2);
  transform: scale(1.05);
}

.app-title {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 8px;
}

.app-desc {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 24px;
  flex-grow: 1;
}

.app-meta {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  padding-top: 16px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-family: var(--font-body);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #040814;
}

.btn-primary:hover {
  opacity: 0.9;
  box-shadow: 0 0 15px rgba(0, 240, 255, 0.35);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

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

.btn-danger {
  background: var(--error);
  color: white;
}

.btn-danger:hover {
  opacity: 0.9;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 6px;
}

/* Form Styles */
.form-card {
  max-width: 450px;
  width: 100%;
  margin: 60px auto;
}

.form-title {
  font-size: 26px;
  text-align: center;
  margin-bottom: 8px;
}

.form-subtitle {
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.input-control {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px 16px;
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 14px;
}

.input-control:focus {
  outline: none;
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 240, 255, 0.15);
}

.form-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.form-link {
  color: var(--accent-cyan);
}

.form-link:hover {
  text-decoration: underline;
}

/* Alerts and Notifications */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-bottom: 20px;
  border: 1px solid transparent;
}

.alert-danger {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.2);
  color: var(--success);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-active {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.badge-inactive {
  background: rgba(239, 68, 68, 0.1);
  color: var(--error);
}

.badge-admin {
  background: rgba(139, 92, 246, 0.15);
  color: var(--accent-purple);
}

.badge-user {
  background: rgba(59, 130, 246, 0.15);
  color: var(--accent-blue);
}

/* Admin Panels (Tables, Layouts) */
.admin-header {
  margin: 40px 0 24px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--bg-card);
  margin-bottom: 40px;
}

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

.admin-table th {
  background: rgba(8, 12, 22, 0.5);
  padding: 16px 20px;
  font-weight: 600;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border-color);
}

.admin-table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: middle;
}

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

.admin-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.actions-cell {
  display: flex;
  gap: 10px;
  align-items: center;
}

.inline-form {
  display: inline;
}

/* Access Control Specific Styles */
.access-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

.access-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.access-card:hover {
  border-color: rgba(255, 255, 255, 0.08);
}

.access-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.access-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  accent-color: var(--accent-cyan);
}

/* Footer styling */
.footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  text-align: center;
  color: var(--text-dark);
  font-size: 13px;
  background: rgba(8, 12, 22, 0.4);
}

.footer-link {
  color: var(--accent-cyan);
}

/* Denied Page Styling */
.denied-panel {
  text-align: center;
  max-width: 550px;
  margin: 80px auto;
}

.denied-icon {
  font-size: 64px;
  color: var(--error);
  margin-bottom: 20px;
}

.denied-title {
  font-size: 28px;
  margin-bottom: 12px;
}

.denied-text {
  color: var(--text-muted);
  margin-bottom: 30px;
}

/* Modal Form Styles */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(4, 8, 20, 0.85);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
}

.modal-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-content {
  max-width: 500px;
  width: 90%;
  transform: scale(0.9);
}

.modal-backdrop.active .modal-content {
  transform: scale(1);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-muted);
}

.modal-close:hover {
  color: var(--text-main);
}
