/* Modern School Website Styles */

:root {
  --primary-color: #4f46e5;
  --secondary-color: #10b981;
  --danger-color: #ef4444;
  --warning-color: #f59e0b;
  --success-color: #22c55e;
  --bg-color: #f9fafb;
  --sidebar-bg: #1f2937;
  --text-color: #111827;
  --border-color: #e5e7eb;
}

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

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

/* Welcome Page */
.welcome-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.welcome-container {
  text-align: center;
  color: white;
}

.welcome-content h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.welcome-content p {
  font-size: 1.2rem;
  margin-bottom: 2rem;
}

/* Login Page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

.login-box {
  background: white;
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  width: 100%;
  max-width: 400px;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-header h2 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Admin Layout */
.admin-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: var(--sidebar-bg);
  color: white;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
}

.sidebar-header {
  padding: 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
  font-size: 1.3rem;
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0;
}

.sidebar-menu li a {
  display: block;
  padding: 0.8rem 1.5rem;
  color: #d1d5db;
  text-decoration: none;
  transition: all 0.3s;
}

.sidebar-menu li a:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.main-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem;
  width: calc(100% - 260px);
}

/* Dashboard */
.dashboard-container {
  max-width: 1400px;
}

.page-header {
  margin-bottom: 2rem;
}

.page-header h1 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: white;
  padding: 1.5rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.stat-icon {
  font-size: 2.5rem;
}

.stat-info h3 {
  font-size: 0.9rem;
  color: #6b7280;
  margin-bottom: 0.5rem;
}

.stat-number {
  font-size: 2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.85rem;
  color: #9ca3af;
}

/* Forms */
.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: #374151;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 1rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border: none;
  border-radius: 5px;
  font-size: 1rem;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
}

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

.btn-primary:hover {
  background: #4338ca;
}

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

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

.btn-sm {
  padding: 0.4rem 1rem;
  font-size: 0.9rem;
}

.btn-block {
  width: 100%;
}

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

.data-table thead {
  background: var(--primary-color);
  color: white;
}

.data-table th,
.data-table td {
  padding: 1rem;
  text-align: left;
}

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

/* Alerts */
.alert {
  padding: 1rem;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 4px solid var(--success-color);
}

.alert-error {
  background: #fee2e2;
  color: #991b1b;
  border-left: 4px solid var(--danger-color);
}

.alert-info {
  background: #dbeafe;
  color: #1e40af;
  border-left: 4px solid var(--primary-color);
}

/* Cards */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  margin-bottom: 1.5rem;
}

.card-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.card-body {
  padding: 1.5rem;
}

.card-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  background: #f9fafb;
}

/* Widgets */
.dashboard-widgets {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 1.5rem;
}

.widget {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.widget-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
}

.widget-body {
  padding: 1.5rem;
}

/* Quick Actions */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
}

.quick-action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  transition: all 0.3s;
}

.quick-action-btn:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

.quick-action-btn .icon {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* AI Chat */
.ai-chat-container {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  height: 600px;
  display: flex;
  flex-direction: column;
}

.chat-messages {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
}

.message {
  margin-bottom: 1rem;
  max-width: 70%;
}

.user-message {
  background: var(--primary-color);
  color: white;
  padding: 1rem;
  border-radius: 10px;
  margin-left: auto;
}

.ai-message {
  background: #f3f4f6;
  padding: 1rem;
  border-radius: 10px;
}

.message-time {
  font-size: 0.8rem;
  margin-top: 0.5rem;
  opacity: 0.7;
}

.chat-input-container {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
}

.chat-input-container form {
  display: flex;
  gap: 0.5rem;
}

.chat-input-container input {
  flex: 1;
  padding: 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

/* Utility Classes */
.text-success {
  color: var(--success-color);
}
.text-danger {
  color: var(--danger-color);
}
.text-warning {
  color: var(--warning-color);
}
.text-muted {
  color: #6b7280;
}
.no-data {
  text-align: center;
  padding: 2rem;
  color: #9ca3af;
}

/* Guardian Dashboard */
.children-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 1.5rem;
}

.child-card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
}

.child-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.child-header img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
}

.child-stats {
  margin: 1rem 0;
}

.stat-item {
  display: flex;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.child-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background: white;
  margin: 5% auto;
  padding: 2rem;
  border-radius: 10px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 800px;
}

.close {
  float: right;
  font-size: 2rem;
  font-weight: bold;
  cursor: pointer;
  color: #9ca3af;
}

.close:hover {
  color: #000;
}

/* Search Bar */
.search-bar {
  margin-bottom: 1.5rem;
}

.search-bar form {
  display: flex;
  gap: 0.5rem;
}

.search-bar input {
  flex: 1;
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

/* Filters Bar */
.filters-bar {
  margin-bottom: 1.5rem;
}

.filter-form {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-form input,
.filter-form select {
  padding: 0.6rem;
  border: 1px solid var(--border-color);
  border-radius: 5px;
}

.filter-form input {
  flex: 1;
  min-width: 200px;
}

/* Badge Styles */
.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-success {
  background: #d1fae5;
  color: #065f46;
}

.badge-danger {
  background: #fee2e2;
  color: #991b1b;
}

.badge-warning {
  background: #fef3c7;
  color: #92400e;
}

.badge-info {
  background: #dbeafe;
  color: #1e40af;
}

/* Button Small */
.btn-small {
  padding: 0.3rem 0.8rem;
  font-size: 0.85rem;
  border-radius: 4px;
  text-decoration: none;
  display: inline-block;
  border: none;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-info {
  background: #3b82f6;
  color: white;
}

.btn-info:hover {
  background: #2563eb;
}

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

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

.btn-secondary {
  background: #6b7280;
  color: white;
}

.btn-secondary:hover {
  background: #4b5563;
}

/* Responsive */
@media (max-width: 768px) {
  .sidebar {
    width: 0;
    transform: translateX(-100%);
  }

  .main-content {
    margin-left: 0;
    width: 100%;
  }

  .stats-grid,
  .dashboard-widgets,
  .children-grid {
    grid-template-columns: 1fr;
  }
}
