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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  direction: rtl;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

form#info-form {
    display: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

/* כותרת */
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 30px;
  text-align: center;
}

.header h1 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.header .user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.header .user-name {
  font-size: 1.1em;
}

.header .logout-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid white;
  color: white;
  padding: 10px 20px;
  border-radius: 25px;
  cursor: pointer;
  transition: all 0.3s;
}

.header .logout-btn:hover {
  background: white;
  color: #667eea;
}

/* טופס התחברות */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  padding: 40px;
}

.login-container h1 {
  text-align: center;
  color: #667eea;
  margin-bottom: 30px;
}

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

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

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid #e0e0e0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #667eea;
}

.form-group textarea {
  resize: vertical;
  min-height: 80px;
}

/* כפתורים */
.btn {
  padding: 12px 30px;
  border: none;
  border-radius: 25px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
  margin: 5px;
}

.btn-primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  width: 100%;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.btn-success {
  background: #28a745;
  color: white;
}

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

.btn-danger {
  background: #dc3545;
  color: white;
}

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

.btn-warning {
  background: #ffc107;
  color: #333;
}

.btn-warning:hover {
  background: #e0a800;
}

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

.btn-secondary:hover {
  background: #5a6268;
}

/* הודעות */
.alert {
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
}

.alert-error {
  background: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.alert-success {
  background: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

/* טאבים */
.tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  background: #f8f9fa;
  padding: 0 20px;
}

.tab {
  padding: 15px 30px;
  cursor: pointer;
  border: none;
  background: transparent;
  font-size: 16px;
  transition: all 0.3s;
}

.tab:hover {
  background: rgba(102, 126, 234, 0.1);
}

.tab.active {
  border-bottom: 3px solid #667eea;
  color: #667eea;
  font-weight: bold;
}

.tab-content {
  padding: 30px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

/* טבלאות */
.table-container {
  overflow-x: auto;
  margin-top: 20px;
}

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

table th,
table td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid #e0e0e0;
}

table th {
  background: #f8f9fa;
  font-weight: bold;
  color: #333;
}

table tr:hover {
  background: #f8f9fa;
}

/* כרטיסים */
.card {
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin-bottom: 20px;
}

.card h3 {
  color: #667eea;
  margin-bottom: 15px;
}

/* רשת */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.grid-item {
  background: #f8f9fa;
  padding: 20px;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.3s;
}

.grid-item:hover {
  background: #e9ecef;
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* מודל */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  border-radius: 15px;
  padding: 30px;
  max-width: 600px;
  width: 90%;
  max-height: 90vh;
  overflow-y: auto;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 2px solid #e0e0e0;
}

.modal-header h2 {
  color: #667eea;
}

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

.modal-close:hover {
  color: #333;
}

/* טעינה */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* מעברים */
.fade-in {
  animation: fadeIn 0.3s ease-in;
}

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

/* טאבים לדוח תלמיד */
.report-tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  background: #f8f9fa;
  gap: 10px;
  padding: 10px 20px;
  margin-bottom: 20px;
}

.tab-btn {
  padding: 12px 25px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.3s;
  border-radius: 8px 8px 0 0;
}

.tab-btn:hover {
  background: rgba(102, 126, 234, 0.1);
  color: #667eea;
}

.tab-btn.active {
  background: white;
  color: #667eea;
  font-weight: bold;
  border-bottom: 3px solid #667eea;
}

/* טאבים בדוח תלמיד */
.report-tab {
  display: none;
  animation: fadeIn 0.3s ease-in;
}

.report-tab.active {
  display: block;
}

/* שדות בדוח */
.field-group {
  padding: 15px;
  background: #f8f9fa;
  border-radius: 8px;
  margin-bottom: 15px;
}

.field-group h4 {
  color: #667eea;
  margin-bottom: 10px;
  font-size: 1.1em;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 15px;
  margin-bottom: 10px;
}

.form-row .form-group {
  margin-bottom: 0;
}

/* כרטיסי מבחנים */
.test-card {
  background: #f8f9fa;
  border: 2px solid #e0e0e0;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 15px;
  transition: all 0.3s;
}

.test-card:hover {
  border-color: #667eea;
  box-shadow: 0 3px 10px rgba(102, 126, 234, 0.1);
}

.test-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e0e0e0;
}

.test-header h4 {
  color: #667eea;
  margin: 0;
}

.btn-delete {
  background: #dc3545;
  color: white;
  border: none;
  padding: 8px 15px;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.3s;
}

.btn-delete:hover {
  background: #c82333;
  transform: scale(1.05);
}

/* מודל מורחב */
.modal-content {
  max-width: 900px;
  width: 95%;
}

/* תגובתי */
@media (max-width: 768px) {
  .container {
    border-radius: 0;
  }

  .header h1 {
    font-size: 1.8em;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    padding: 10px 15px;
    font-size: 14px;
  }

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

  .report-tabs {
    overflow-x: auto;
    padding: 10px;
  }

  .tab-btn {
    padding: 10px 15px;
    font-size: 14px;
    white-space: nowrap;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .modal-content {
    width: 95%;
    padding: 20px;
  }
}
