/* ============================================================
   NewsIndia24 — Ultra Modern Dashboard (TravBizz Template Port)
   ============================================================ */

@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
  --primary:        #3b82f6;
  --primary-hover:  #2563eb;
  --app-bg:         linear-gradient(135deg, #e0e7ff, #f0f9ff);
  --surface:        rgba(255, 255, 255, 0.7);
  
  --text-main:      #1e293b;
  --text-muted:     #475569;
  --text-light:     #94a3b8;
  
  --border-light:   rgba(255, 255, 255, 0.5);
  --border-strong:  rgba(255, 255, 255, 0.8);

  --sidebar-w:      260px;
  --header-h:       80px;
  --radius:         20px;
  --shadow-sm:      0 2px 10px rgba(0, 0, 0, 0.05);
  --shadow-lg:      0 10px 30px rgba(0, 0, 0, 0.08);
  
  --transition:     0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   Animations & Keyframes
   ============================================================ */
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slide-up {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes pulse-soft {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* Base Resets */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
  background: var(--app-bg);
  background-attachment: fixed;
  color: var(--text-main);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  animation: fade-in 0.6s ease-out forwards;
}
a { text-decoration: none; color: inherit; }
button, input, select, textarea { font-family: inherit; }

/* Layout Grid */
.crm-layout {
  display: flex;
  min-height: 100vh;
}

/* Sidebar Styling (Premium Dark/Light Hybrid) */
.crm-sidebar {
  width: var(--sidebar-w);
  background: var(--surface);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-light);
  position: fixed; top: 0; left: 0; bottom: 0;
  display: flex; flex-direction: column;
  z-index: 100;
  animation: slide-in-left 0.5s ease-out forwards;
}

.sidebar-logo {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: center;
  border-bottom: 1px solid var(--border-light);
  font-size: 24px; font-weight: 800; color: var(--primary);
  letter-spacing: -0.5px;
}

.sidebar-logo span { color: #FFFFFF; }

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

.sidebar-nav-label {
  font-size: 11px; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 1px;
  margin: 24px 0 12px 12px;
}

.sidebar-nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; border-radius: 12px;
  color: var(--text-muted); font-weight: 600;
  transition: all var(--transition);
  margin-bottom: 4px;
  font-size: 14px;
}

.sidebar-nav a i {
  font-size: 18px; width: 20px; text-align: center; color: var(--text-light);
  transition: all var(--transition);
}

.sidebar-nav a:hover, 
.sidebar-nav a.active {
  background: rgba(72, 127, 255, 0.08); /* Primary Wash */
  color: var(--primary);
}
.sidebar-nav a:hover i, 
.sidebar-nav a.active i {
  color: var(--primary);
}

.sidebar-footer {
  padding: 24px 20px;
  border-top: 1px solid var(--border-light);
}

/* Main Content Area */
.crm-main-wrap {
  flex: 1; margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
}

/* Topbar Header */
.crm-topbar {
  height: var(--header-h);
  background: transparent;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 40px;
  position: sticky; top: 0; z-index: 90;
}

.topbar-title {
  font-size: 20px; font-weight: 700; color: var(--text-main);
  letter-spacing: -0.3px;
}

.btn-outline {
  border: 1px solid var(--border-strong);
  background: transparent; color: var(--text-main);
  padding: 10px 20px; border-radius: 8px;
  font-weight: 600; font-size: 13px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all var(--transition);
}
.btn-outline:hover {
  border-color: var(--primary); color: var(--primary);
  background: rgba(72, 127, 255, 0.05);
}

/* Content Container */
.crm-content {
  padding: 40px;
  max-width: 1440px;
  margin: 0 auto;
  width: 100%;
}

/* Cards */
.crm-card {
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 32px; margin-bottom: 32px;
  transition: transform var(--transition), box-shadow var(--transition);
  animation: slide-up 0.6s ease-out forwards;
}
.crm-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.crm-card-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px; padding-bottom: 16px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.crm-card-title {
  font-size: 18px; font-weight: 700; color: var(--text-main);
}

/* Buttons */
.btn-primary {
  background: linear-gradient(45deg, #3b82f6, #6366f1);
  color: #fff; border: none;
  padding: 10px 20px; border-radius: 10px;
  font-weight: 600; font-size: 14px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  transition: all var(--transition);
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.btn-primary:active {
  transform: scale(0.96);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.6);
  animation: pulse-soft 1.5s infinite;
}

/* Forms */
.form-group { 
  margin-bottom: 24px; 
  animation: slide-up 0.6s ease-out backwards;
}
.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

.form-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--text-muted); margin-bottom: 8px;
  text-transform: uppercase; letter-spacing: 0.5px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.form-group:focus-within .form-label {
  color: var(--primary);
  transform: translateX(4px);
}

.form-control {
  width: 100%; border: 1px solid rgba(255,255,255,0.8);
  border-radius: 12px; padding: 16px 20px;
  font-size: 14px; color: var(--text-main); font-weight: 600;
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.02), 0 4px 12px rgba(0,0,0,0.03);
  transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy physics */
}
.form-control:focus {
  outline: none; border-color: var(--primary); 
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 25px rgba(59, 130, 246, 0.25), 0 0 0 4px rgba(59, 130, 246, 0.1);
  transform: translateY(-4px) scale(1.02);
}
textarea.form-control { resize: vertical; min-height: 120px; }

/* Tables - High End Styling */
.crm-table { width: 100%; border-collapse: separate; border-spacing: 0; }
.crm-table th, .crm-table td {
  padding: 14px 20px; text-align: left;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.crm-table th {
  font-size: 12px; font-weight: 700; color: var(--text-light);
  text-transform: uppercase; letter-spacing: 0.5px;
}
.crm-table tr { transition: background var(--transition), transform var(--transition); }
.crm-table tr:hover td { 
  background: rgba(255,255,255,0.9);
  transform: scale(1.01);
}
.crm-table td { font-size: 14px; color: var(--text-main); font-weight: 500; }

.td-actions { display: flex; gap: 10px; }
.btn-icon {
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--text-muted); background: var(--bg-color);
  transition: all 0.2s; font-size: 13px;
}
.btn-icon:hover { background: var(--border-strong); color: var(--text-main); }
.btn-icon.edit:hover { background: rgba(72, 127, 255, 0.1); color: var(--primary); }
.btn-icon.delete:hover { background: #fee2e2; color: #dc2626; }

/* Badges - Workflow Status */
.badge {
  display: inline-flex; align-items: center; padding: 4px 12px;
  border-radius: 20px; font-size: 11px; font-weight: 700; line-height: 1;
}
.badge.published  { background: #DCFCE7; color: #166534; }
.badge.approved   { background: #D1FAE5; color: #065F46; }
.badge.draft      { background: #F1F5F9; color: #475569; }
.badge.pending, .badge.pending_sub_editor { background: #FEF3C7; color: #92400E; }
.badge.pending_editor { background: #FFF7ED; color: #9a3412; }
.badge.rejected   { background: #FEE2E2; color: #991B1B; }
.badge.archived   { background: #F1F5F9; color: #6B7280; }

/* Sidebar notification badge */
.nav-badge {
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 800; padding: 2px 6px;
  border-radius: 10px; margin-left: auto; animation: pulse-soft 2s infinite;
}

/* Dashboard Stat Grid Matrix */
.stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 20px; margin-bottom: 32px;
}
.stat-card {
  padding: 24px;
  border-radius: 20px;
  color: #fff;
  display: flex; flex-direction: column; justify-content: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-sm); transition: all var(--transition);
  position: relative; overflow: hidden;
}
.stat-card:hover {
  transform: translateY(-5px); box-shadow: var(--shadow-lg);
}

.stat-card.card-blue { background: linear-gradient(135deg, #60a5fa, #3b82f6); }
.stat-card.card-red { background: linear-gradient(135deg, #f87171, #ef4444); }
.stat-card.card-yellow { background: linear-gradient(135deg, #fbbf24, #f59e0b); }
.stat-card.card-green { background: linear-gradient(135deg, #34d399, #10b981); }
.stat-card.card-purple { background: linear-gradient(135deg, #c084fc, #9333ea); }

.stat-card i { font-size: 32px; opacity: 0.8; margin-bottom: 16px; transition: transform var(--transition); }
.stat-card:hover i { transform: scale(1.2) rotate(5deg); opacity: 1; }
.stat-card h4 { font-size: 16px; font-weight: 500; opacity: 0.9; margin-bottom: 4px; }
.stat-card h2 { font-size: 36px; font-weight: 800; margin: 0; line-height: 1; }

/* stat-icon + stat-value (white card variant) */
.stat-card .stat-icon {
  width: 48px; height: 48px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; margin-bottom: 12px;
}
.stat-card .stat-value { font-size: 28px; font-weight: 800; color: var(--text-main); }
.stat-card .stat-label { font-size: 12px; color: var(--text-light); font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }

/* Avatar / User Footer */
.avatar-circle {
  width: 40px; height: 40px; border-radius: 10px; /* Squircle style */
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 16px;
}

/* Alert Boxes */
.alert { padding: 16px 20px; border-radius: 12px; margin-bottom: 24px; font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 12px;}
.alert-error { background: #FEF2F2; color: #991B1B; border: 1px solid #FECACA; }
.alert-success { background: #F0FDF4; color: #166534; border: 1px solid #BBF7D0; }

/* Responsive Adjustments */
@media (max-width: 1024px) {
  .crm-layout { display: block; }
  .crm-sidebar { width: 100%; height: auto; position: static; box-shadow: none; border-bottom: 1px solid var(--border-light); }
  .sidebar-nav { display: flex; overflow-x: auto; padding: 16px; }
  .sidebar-nav-label { display: none; }
  .sidebar-nav a { white-space: nowrap; margin-bottom: 0; margin-right: 12px; padding: 8px 16px;}
  .sidebar-footer { display: none; }
  .crm-main-wrap { margin-left: 0; }
  .crm-topbar { padding: 0 20px; }
  .crm-content { padding: 20px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  
  /* Fallbacks for internal grid layouts */
  div[style*="grid-template-columns"] { grid-template-columns: 1fr !important; }
}

@media (max-width: 600px) {
  .crm-topbar { height: auto; padding: 16px 20px; flex-direction: column; align-items: flex-start; gap: 12px;}
  .stats-grid { grid-template-columns: 1fr; }
  .crm-card { padding: 20px; }
  .crm-table { display: block; overflow-x: auto; white-space: nowrap; }
}
