/* ===============================
   CHEMYUKTI - MAIN STYLESHEET
   =============================== */

/* Base Styles */
body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif, Georgia, 'Times New Roman';
  margin: 0;
  background: linear-gradient(135deg, #ec1d2e, #f85656);
  color: #222;
}

/* ===============================
   HEADER SECTION
   =============================== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #49f305;
  padding: 15px 20px;
  box-shadow: 0 2px 5px rgba(161, 240, 16, 0.1);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.logo {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  flex-shrink: 0;
}

.tagline-content {
  flex: 1;
}

.hero-title {
  font-size: 1.5rem;
  font-weight: bold;
  margin: 0 0 5px 0;
  color: #333;
  line-height: 1.2;
}

.hero-subtitle {
  font-size: 0.9rem;
  margin: 0;
  color: #555;
  line-height: 1.3;
  opacity: 0.9;
}

nav {
  display: flex;
  gap: 15px;
  flex-shrink: 0;
}

nav a {
  text-decoration: none;
  color: #333;
  font-weight: bold;
  transition: color 0.3s;
  white-space: nowrap;
}

nav a:hover {
  color: #007bff;
}

/* ===============================
   LAYOUT COMPONENTS
   =============================== */
.container {
  padding: 20px;
  max-width: 900px;
  margin: 20px auto;
}

.card {
  background: #ffffff;
  padding: 18px;
  margin: 15px 0;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

/* ===============================
   BUTTON STYLES
   =============================== */
button {
  background: #007bff;
  color: white;
  border: none;
  padding: 10px 18px;
  border-radius: 8px;
  margin: 5px 5px 5px 0;
  cursor: pointer;
  transition: background 0.3s;
  font-size: 14px;
}

button:hover {
  background: #0056b3;
}

.btn-primary {
  background: #007bff;
}

.btn-primary:hover {
  background: #0056b3;
}

.btn-secondary {
  background: #6c757d;
}

.btn-secondary:hover {
  background: #545b62;
}

.btn-danger {
  background: #dc3545;
}

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

.btn-download {
  background: #28a745;
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-weight: bold;
  cursor: pointer;
  transition: background 0.3s;
}

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

.btn-delete-small {
  background: #dc3545;
  padding: 4px 8px;
  font-size: 12px;
  margin-left: 10px;
}

.button-group {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

/* ===============================
   FORM STYLES
   =============================== */
input, textarea {
  width: 100%;
  padding: 10px;
  margin: 6px 0;
  border: 1px solid #ccc;
  border-radius: 8px;
  box-sizing: border-box;
}

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

.form-group label {
  display: block;
  margin-bottom: 5px;
  font-weight: bold;
  color: #333;
}

.form-input {
  width: 100%;
}

.help-text {
  color: #666;
  font-size: 12px;
  margin-top: 5px;
  display: block;
}

/* ===============================
   PRACTICE TEST SECTION
   =============================== */
.profile-info {
  background: #f8f9fa;
  padding: 10px;
  border-radius: 7px;
  margin-bottom: 10px;
}

.profile-form {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 8px;
  margin: 20px 0;
}

.error-msg {
  color: #dc3545;
  background: #f8d7da;
  padding: 10px;
  border-radius: 5px;
  margin: 10px 0;
  border: 1px solid #f5c6cb;
}

.timer-display {
  background: #e7f3ff;
  padding: 15px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  border-radius: 8px;
  margin-bottom: 20px;
  color: #0066cc;
}

.question-card {
  background: #f8f9fa;
  padding: 15px;
  margin: 15px 0;
  border-radius: 8px;
  border-left: 4px solid #007bff;
}

.question-text {
  margin-bottom: 15px;
  font-size: 16px;
}

.choices {
  margin-left: 20px;
}

.choice-option {
  margin: 8px 0;
}

.choice-option label {
  cursor: pointer;
  display: flex;
  align-items: center;
}

.choice-option input {
  margin-right: 10px;
  width: auto;
}

.result-display {
  background: #d4edda;
  color: #155724;
  padding: 15px;
  text-align: center;
  border-radius: 8px;
  margin: 20px 0;
  font-size: 18px;
}

.result-actions {
  text-align: center;
  margin-top: 15px;
}

/* ===============================
   FORUM SECTION
   =============================== */
.post-form {
  margin-bottom: 20px;
}

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

.divider {
  border: none;
  border-top: 1px solid #dee2e6;
  margin: 20px 0;
}

.posts-container {
  max-height: 400px;
  overflow-y: auto;
}

.post-card {
  background: #f8f9fa;
  padding: 15px;
  margin: 10px 0;
  border-radius: 8px;
  border-left: 3px solid #28a745;
}

.post-author {
  font-weight: bold;
  color: #007bff;
  margin-bottom: 8px;
}

.post-content {
  color: #333;
  line-height: 1.5;
}

/* ===============================
   CHAT SECTION
   =============================== */
.chat-controls {
  display: flex;
  gap: 15px;
  margin-bottom: 15px;
  align-items: center;
}

.search-input {
  flex: 1;
  margin: 0;
}

.search-results {
  background: #f8f9fa;
  border-radius: 8px;
  max-height: 150px;
  overflow-y: auto;
}

.search-result-item {
  padding: 10px;
  cursor: pointer;
  border-bottom: 1px solid #dee2e6;
}

.search-result-item:hover {
  background: #e9ecef;
}

.chat-messages {
  max-height: 300px;
  overflow-y: auto;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
}

.chat-message {
  margin: 10px 0;
  padding: 8px;
  background: white;
  border-radius: 5px;
  display: flex;
  align-items: center;
}

.message-sender {
  font-weight: bold;
  color: #007bff;
  margin-right: 10px;
}

.message-text {
  flex: 1;
}

.chat-input-area {
  display: flex;
  gap: 10px;
  align-items: center;
}

.chat-input {
  flex: 1;
  margin: 0;
}

/* ===============================
   ADMIN SECTION
   =============================== */
.admin-login {
  text-align: center;
  padding: 70px;
}

.admin-content {
  margin-top: 20px;
}

/* Admin Dashboard */
.admin-dashboard {
  display: grid;
  gap: 20px;
  margin-bottom: 30px;
}

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

.stat-card {
  background: linear-gradient(135deg, #007bff, #0056b3);
  color: white;
  padding: 20px;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 4px 15px rgba(0,123,255,0.3);
}

.stat-number {
  font-size: 2em;
  font-weight: bold;
  display: block;
}

.stat-label {
  font-size: 0.9em;
  opacity: 0.9;
  margin-top: 5px;
}

/* Admin Tabs */
.admin-tabs {
  display: flex;
  border-bottom: 2px solid #dee2e6;
  margin-bottom: 20px;
  overflow-x: auto;
}

.admin-tab {
  padding: 12px 24px;
  cursor: pointer;
  border: none;
  background: none;
  font-weight: bold;
  color: #666;
  white-space: nowrap;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
}

.admin-tab:hover {
  color: #007bff;
  background: #f8f9fa;
}

.admin-tab.active {
  color: #007bff;
  border-bottom-color: #007bff;
  background: #f8f9fa;
}

/* Admin Cards */
.admin-card {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 2px solid #f0f0f0;
}

.admin-card-title {
  font-size: 1.3em;
  font-weight: bold;
  color: #333;
  margin: 0;
}

/* Data Tables */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.data-table th {
  background: #007bff;
  color: white;
  padding: 12px;
  text-align: left;
  font-weight: bold;
}

.data-table td {
  padding: 12px;
  border-bottom: 1px solid #dee2e6;
}

.data-table tr:hover {
  background: #f8f9fa;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}

.pagination button {
  min-width: 35px;
  height: 35px;
  border-radius: 6px;
}

.pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.page-info {
  color: #666;
  font-size: 14px;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  gap: 15px;
  align-items: center;
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  min-width: 150px;
}

.filter-group label {
  font-size: 12px;
  color: #666;
  margin-bottom: 3px;
}

.filter-input {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 6px;
  font-size: 14px;
}

/* Bulk Actions */
.bulk-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 15px;
  padding: 10px;
  background: #fff3cd;
  border-radius: 6px;
  border: 1px solid #ffeaa7;
}

/* Question Form */
.question-form {
  background: white;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.question-textarea {
  min-height: 80px;
  resize: vertical;
  font-family: inherit;
}

/* Collapsible Sections */
.collapsible-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  cursor: pointer;
  margin-bottom: 10px;
  transition: background 0.3s;
}

.collapsible-header:hover {
  background: #e9ecef;
}

.collapsible-content {
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

.collapsible-content.collapsed {
  max-height: 0;
}

.collapsible-content.expanded {
  max-height: 2000px;
}

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

.modal-content {
  background: white;
  padding: 30px;
  border-radius: 12px;
  max-width: 90vw;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Chat Management */
.chat-threads {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.chat-thread {
  background: white;
  padding: 15px;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.thread-header {
  font-weight: bold;
  color: #007bff;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 1px solid #dee2e6;
}

.thread-messages {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 15px;
}

.admin-message {
  display: flex;
  align-items: center;
  margin: 8px 0;
  padding: 8px;
  background: #f8f9fa;
  border-radius: 5px;
}

.message-sender-admin {
  font-weight: bold;
  color: #28a745;
  margin-right: 10px;
  min-width: 80px;
}

.message-text-admin {
  flex: 1;
  color: #333;
}

.admin-reply {
  display: flex;
  gap: 10px;
  align-items: center;
}

.reply-input {
  flex: 1;
  margin: 0;
}

/* ===============================
   STATUS INDICATORS
   =============================== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
}

.status-badge.active {
  background: #d4edda;
  color: #155724;
}

.status-badge.inactive {
  background: #f8d7da;
  color: #721c24;
}

.status-badge.warning {
  background: #fff3cd;
  color: #856404;
}

/* ===============================
   LOADING STATES
   =============================== */
.loading {
  text-align: center;
  padding: 40px;
  color: #666;
}

.loading-spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid #f3f3f3;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 10px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ===============================
   FOOTER
   =============================== */
footer {
  text-align: center;
  padding: 15px;
  margin-top: 20px;
  background: #f9f9f9;
  border-top: 1px solid #ddd;
  font-size: 14px;
  color: #555;
}

/* ===============================
   RESPONSIVE DESIGN
   =============================== */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .data-table {
    font-size: 14px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 15px;
    margin: 10px;
  }
  
  .topbar {
    flex-direction: column;
    gap: 15px;
    padding: 15px;
  }
  
  .header-left {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
  
  .hero-title {
    font-size: 1.3rem;
  }
  
  .hero-subtitle {
    font-size: 0.8rem;
  }
  
  nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
  }
  
  nav a {
    margin: 0;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .chat-controls {
    flex-direction: column;
    align-items: stretch;
  }
  
  .admin-reply {
    flex-direction: column;
  }
  
  .chat-input-area {
    flex-direction: column;
  }

  .admin-tabs {
    justify-content: center;
  }

  .admin-tab {
    padding: 8px 16px;
    font-size: 14px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .data-table th,
  .data-table td {
    padding: 8px;
    font-size: 12px;
  }
}
/* ===============================
   new
   =============================== */

.device-type-badge {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 12px;
  background: #28a745;
  color: white;
  margin-left: 10px;
}

.device-type-badge.legacy {
  background: #ffc107;
  color: #212529;
}

.fingerprint-code {
  font-family: 'Courier New', monospace;
  font-size: 11px;
  background: #f8f9fa;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid #dee2e6;
}

.thread-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

