/* Bangladesh Election Commission - Main Stylesheet */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+Bengali:wght@300;400;500;600;700&display=swap');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a5632;
  --primary-dark: #0d3b1f;
  --primary-light: #2d8a4e;
  --accent: #c8102e;
  --bg: #f0f4f1;
  --card-bg: #ffffff;
  --text: #1a1a2e;
  --text-light: #5a5a7a;
  --border: #d4e0d8;
  --success: #28a745;
  --danger: #dc3545;
  --warning: #ffc107;
  --info: #17a2b8;
  --shadow: 0 2px 15px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 10px;
}

body {
  font-family: 'Noto Sans Bengali', 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-brand .logo-icon {
  width: 42px;
  height: 42px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}

.header-brand h1 {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.3;
}

.header-brand small {
  font-size: 11px;
  opacity: 0.8;
  display: block;
}

.header-nav {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.header-nav a {
  color: #fff;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
  background: rgba(255,255,255,0.1);
}

.header-nav a:hover, .header-nav a.active {
  background: rgba(255,255,255,0.25);
}

.header-nav .btn-logout {
  background: var(--accent);
}

.header-nav .btn-logout:hover {
  background: #a80d24;
}

/* Container */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 15px;
}

/* Cards */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  margin-bottom: 20px;
  overflow: hidden;
}

.card-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 15px 20px;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 10px;
}

.card-body {
  padding: 20px;
}

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
  margin-bottom: 20px;
}

.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  text-align: center;
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-card .stat-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
  font-size: 22px;
}

.stat-card .stat-icon.green { background: #e8f5e9; color: var(--primary); }
.stat-card .stat-icon.blue { background: #e3f2fd; color: #1976d2; }
.stat-card .stat-icon.orange { background: #fff3e0; color: #e65100; }
.stat-card .stat-icon.red { background: #ffebee; color: var(--accent); }

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-dark);
}

.stat-card .stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

/* Forms */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  transition: border-color 0.2s;
  background: #fff;
  color: var(--text);
}

.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26,86,50,0.1);
}

select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 12px;
  padding-right: 36px;
}

textarea.form-control {
  min-height: 100px;
  resize: vertical;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  line-height: 1.4;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
}

.btn-primary:hover { background: var(--primary-dark); color: #fff; }

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-danger:hover { background: #c82333; }

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-success:hover { background: #218838; }

.btn-warning {
  background: var(--warning);
  color: #333;
}

.btn-info {
  background: var(--info);
  color: #fff;
}

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

.btn-block {
  width: 100%;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
}

table th, table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

table th {
  background: #f8faf9;
  font-weight: 600;
  color: var(--primary-dark);
  white-space: nowrap;
}

table tr:hover {
  background: #f8faf9;
}

/* Badges */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.badge-success { background: #d4edda; color: #155724; }
.badge-danger { background: #f8d7da; color: #721c24; }
.badge-warning { background: #fff3cd; color: #856404; }
.badge-info { background: #d1ecf1; color: #0c5460; }

/* Auth Pages */
.auth-wrapper {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: linear-gradient(135deg, #0d3b1f 0%, #1a5632 50%, #2d8a4e 100%);
}

.auth-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.auth-header {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 30px 25px;
  text-align: center;
}

.auth-header .auth-logo {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  font-size: 28px;
}

.auth-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 4px;
}

.auth-header p {
  font-size: 13px;
  opacity: 0.85;
}

.auth-body {
  padding: 30px 25px;
}

.auth-footer {
  text-align: center;
  padding: 0 25px 25px;
  font-size: 13px;
  color: var(--text-light);
}

.auth-footer a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

/* Alerts */
.alert {
  padding: 12px 18px;
  border-radius: 8px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success { background: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
.alert-danger { background: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
.alert-warning { background: #fff3cd; color: #856404; border: 1px solid #ffeeba; }
.alert-info { background: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

/* Toast Notification */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
}

.toast {
  padding: 14px 20px;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 8px;
  box-shadow: var(--shadow-lg);
  animation: slideIn 0.3s ease;
  max-width: 350px;
}

.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* NID Result Card */
.nid-result {
  background: #fff;
  border: 2px solid var(--primary);
  border-radius: 12px;
  padding: 25px;
  margin-top: 20px;
}

.nid-result .nid-photo {
  width: 120px;
  height: 140px;
  border: 3px solid var(--primary);
  border-radius: 8px;
  object-fit: cover;
  margin: 0 auto 15px;
  display: block;
}

.nid-result .nid-info {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.nid-result .nid-field {
  padding: 8px 12px;
  background: #f8faf9;
  border-radius: 6px;
}

.nid-result .nid-field label {
  font-size: 11px;
  color: var(--text-light);
  text-transform: uppercase;
  font-weight: 600;
}

.nid-result .nid-field span {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-top: 2px;
}

/* Search Type Selector */
.search-type-selector {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.search-type-btn {
  flex: 1;
  min-width: 100px;
  padding: 12px;
  text-align: center;
  border: 2px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  background: #fff;
  transition: all 0.2s;
  font-weight: 600;
  font-size: 13px;
}

.search-type-btn:hover {
  border-color: var(--primary-light);
}

.search-type-btn.active {
  border-color: var(--primary);
  background: #e8f5e9;
  color: var(--primary-dark);
}

.search-type-btn .digit-num {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  display: block;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #fff;
  border-radius: 12px;
  width: 100%;
  max-width: 450px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-header {
  background: var(--primary);
  color: #fff;
  padding: 15px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 { font-size: 16px; }

.modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 15px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* Print styles */
@media print {
  .header, .header-nav, .btn, .no-print { display: none !important; }
  .nid-result { border: 2px solid #000; }
  body { background: #fff; }
}

/* Responsive */
@media (max-width: 768px) {
  .header-inner {
    flex-direction: column;
    text-align: center;
  }
  
  .header-brand h1 { font-size: 15px; }
  
  .header-nav {
    width: 100%;
    justify-content: center;
  }
  
  .header-nav a {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .nid-result .nid-info {
    grid-template-columns: 1fr;
  }
  
  .search-type-selector {
    flex-direction: column;
  }
  
  .modal-box { max-width: 100%; }
  
  table th, table td {
    padding: 8px 10px;
    font-size: 12px;
  }
  
  .container { padding: 12px 10px; }
  
  .card-body { padding: 15px; }
  
  .stat-card { padding: 15px; }
  .stat-card .stat-value { font-size: 22px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .auth-card { border-radius: 12px; }
  .auth-body { padding: 20px 18px; }
  .auth-header { padding: 22px 18px; }
}

/* Utility */
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-10 { gap: 10px; }
