:root {
  --primary-color: #0d2b56; /* Dark blue institutional */
  --secondary-color: #ffffff; /* White */
  --accent-color: #f7a800; /* Subtle accent if needed */
  --bg-color: #f0f4f8;
  --text-dark: #333333;
  --text-light: #f4f4f4;
  --border-radius: 8px;
  --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
  --transition-speed: 0.3s;
}

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

body {
  font-family: 'Inter', 'Roboto', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Typography */
h1, h2, h3 {
  color: var(--primary-color);
  margin-bottom: 1rem;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color var(--transition-speed);
}

a:hover {
  color: #1a498a;
}

/* Header */
header {
  background-color: var(--primary-color);
  color: var(--secondary-color);
  padding: 1rem 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
}

header h1 {
  color: var(--secondary-color);
  margin: 0;
  font-size: 1.5rem;
  font-weight: 600;
}

header .user-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
  text-align: center;
}

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

.btn-primary:hover {
  background-color: #16407d;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(13, 43, 86, 0.2);
}

.btn-secondary {
  background-color: transparent;
  color: var(--secondary-color);
  border: 1px solid var(--secondary-color);
}

.btn-secondary:hover {
  background-color: rgba(255,255,255,0.1);
}

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

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

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

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

.form-control {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #ccc;
  border-radius: var(--border-radius);
  font-size: 1rem;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

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

/* Layouts */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  flex: 1;
}

.card {
  background: var(--secondary-color);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--box-shadow);
  animation: slideUp 0.5s ease forwards;
  opacity: 0;
  transform: translateY(20px);
}

/* Animations */
@keyframes slideUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease forwards;
}

/* Auth Pages */
.auth-wrapper {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
}

.auth-card {
  width: 100%;
  max-width: 450px;
}

.auth-tabs {
  display: flex;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid #eee;
}

.auth-tab {
  flex: 1;
  text-align: center;
  padding: 1rem;
  cursor: pointer;
  font-weight: 600;
  color: #777;
  transition: color var(--transition-speed);
}

.auth-tab.active {
  color: var(--primary-color);
  border-bottom: 3px solid var(--primary-color);
}

/* Grid Layouts for Forms */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

@media (max-width: 768px) {
  .form-grid {
    grid-template-columns: 1fr;
  }
}

/* Subjects Selection */
.semestre-block {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #eee;
  border-radius: var(--border-radius);
  background: #fafafa;
}

.semestre-title {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--primary-color);
  border-bottom: 1px solid #ddd;
  padding-bottom: 0.5rem;
}

.subject-item {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.subject-item input {
  margin-right: 0.5rem;
  transform: scale(1.2);
}

/* Dashboard KPIs */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.kpi-card {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  text-align: center;
  border-bottom: 4px solid var(--primary-color);
  transition: transform var(--transition-speed);
}

.kpi-card:hover {
  transform: translateY(-5px);
}

.kpi-value {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 0.5rem;
}

.kpi-label {
  color: #666;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid #eee;
}

th {
  background-color: #f8f9fa;
  color: var(--primary-color);
  font-weight: 600;
}

tr:hover {
  background-color: #f1f5f9;
}

.badge {
  padding: 0.25rem 0.75rem;
  border-radius: 50px;
  font-size: 0.85rem;
  font-weight: 500;
}

.badge-blue { background: #e0f2fe; color: #0369a1; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-purple { background: #f3e8ff; color: #7e22ce; }

/* Simple CSS Charts */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-bottom: 2rem;
}

@media (max-width: 900px) {
  .charts-grid {
    grid-template-columns: 1fr;
  }
}

.chart-container {
  background: white;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.bar-chart {
  display: flex;
  align-items: flex-end;
  height: 200px;
  gap: 1rem;
  padding-top: 1rem;
  border-bottom: 2px solid #eee;
}

.bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar {
  width: 100%;
  max-width: 50px;
  background-color: var(--primary-color);
  border-radius: 4px 4px 0 0;
  transition: height 1s ease-out;
  position: relative;
}

.bar:hover::after {
  content: attr(data-val);
  position: absolute;
  top: -25px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.8rem;
}

.bar-label {
  margin-top: 0.5rem;
  font-size: 0.85rem;
  text-align: center;
  color: #666;
}

/* Modal / Toast Messages */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #333;
  color: white;
  padding: 1rem 2rem;
  border-radius: var(--border-radius);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success { background-color: #10b981; }
.toast.error { background-color: #ef4444; }

/* Filter Section */
.filters {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  background: white;
  padding: 1rem;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  align-items: flex-end;
}

.filters .form-group {
  margin-bottom: 0;
  flex: 1;
}

/* Academic Records */
.academic-record {
    background: #fafafa;
    border: 1px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    animation: fadeIn 0.3s ease;
}

.academic-record .remove-btn {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: #fee2e2;
    color: #ef4444;
    border: none;
    border-radius: 4px;
    padding: 0.4rem 0.8rem;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s;
}

.academic-record .remove-btn:hover {
    background: #ef4444;
    color: white;
}
