/* SAEBRS Assessment System - Gladesville Primary School
   Victoria, Australia 
   Modern Corporate Styling - 2024
*/

/* Modern Corporate Design Variables */
:root {
  /* Primary Brand Colors */
  --primary-blue: #1a365d; /* Corporate navy blue */
  --secondary-blue: #3182ce; /* Modern bright blue */
  --accent-blue: #63b3ed; /* Light accent blue */
  --primary-yellow: #f6e05e; /* Warm yellow accent */
  --accent-yellow: #fef5e7; /* Very light yellow background */
  
  /* Neutral Colors */
  --white: #ffffff;
  --light-grey: #f7fafc; /* Modern light background */
  --medium-grey: #e2e8f0; /* Clean borders */
  --dark-grey: #4a5568; /* Professional text */
  --text-primary: #2d3748; /* Main text color */
  --text-secondary: #718096; /* Secondary text */
  
  /* Status Colors */
  --success: #38a169; /* Professional green */
  --warning: #ed8936; /* Modern orange */
  --danger: #e53e3e; /* Clear red */
  --info: #3182ce; /* Information blue */
  
  /* Risk Level Colors */
  --risk-low: #c6f6d5; /* Soft green background */
  --risk-low-text: #22543d; /* Dark green text */
  --risk-moderate: #fed7aa; /* Soft orange background */
  --risk-moderate-text: #9c4221; /* Dark orange text */
  --risk-high: #fed7d7; /* Soft red background */
  --risk-high-text: #742a2a; /* Dark red text */
  
  /* Layout Variables */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Legacy compatibility */
  --radius: var(--radius-md);
  --shadow: var(--shadow-md);
}

/* Reset and Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--light-grey);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary-blue);
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.875rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

p {
  margin-bottom: 1rem;
  color: var(--text-primary);
}

a {
  color: var(--secondary-blue);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--primary-blue);
  text-decoration: underline;
}

/* Modern Header */
header {
  background-color: var(--white);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--medium-grey);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  min-height: 80px;
}

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

.logo img {
  height: 48px;
  width: auto;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-blue);
  line-height: 1.2;
}

.logo-text span {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--text-secondary);
  display: block;
}

/* Modern Navigation */
nav ul {
  display: flex;
  list-style: none;
  gap: 8px;
  margin: 0;
  padding: 0;
}

nav ul li {
  position: relative;
}

nav ul li a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-weight: 500;
  color: var(--text-primary);
  transition: var(--transition);
  white-space: nowrap;
}

nav ul li a:hover {
  background-color: var(--light-grey);
  color: var(--primary-blue);
  text-decoration: none;
}

nav ul li a.active {
  background-color: var(--primary-blue);
  color: var(--white);
}

/* Dropdown Menus */
nav ul li ul.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background-color: var(--white);
  min-width: 220px;
  box-shadow: var(--shadow-lg);
  border-radius: var(--radius-md);
  border: 1px solid var(--medium-grey);
  padding: 8px 0;
  z-index: 1000;
}

nav ul li:hover > ul.submenu {
  display: block;
}

nav ul li ul.submenu li {
  width: 100%;
  margin: 0;
}

nav ul li ul.submenu li a {
  padding: 12px 20px;
  border-radius: 0;
  display: block;
  color: var(--text-primary);
}

nav ul li ul.submenu li a:hover {
  background-color: var(--light-grey);
  color: var(--primary-blue);
}

/* Buttons */
.btn, 
button[type="submit"],
input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 500;
  font-size: 0.875rem;
  text-decoration: none;
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--secondary-blue);
  color: var(--white);
  min-height: 44px;
}

.btn:hover,
button[type="submit"]:hover,
input[type="submit"]:hover {
  background-color: var(--primary-blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

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

.btn-primary:hover {
  background-color: #2c5282;
}

.btn-secondary {
  background-color: var(--dark-grey);
  color: var(--white);
}

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

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

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

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

.btn-sm {
  padding: 8px 16px;
  font-size: 0.75rem;
  min-height: 36px;
}

/* Cards and Sections */
.dashboard-section, 
.assessment-section, 
.report-section {
  background-color: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--medium-grey);
}

/* Dashboard Stats */
.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.stat-card {
  background-color: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--medium-grey);
  text-align: center;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-blue), var(--secondary-blue));
}

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

.stat-number {
  font-size: 3rem;
  font-weight: 700;
  color: var(--primary-blue);
  margin: 16px 0;
  line-height: 1;
}

.stat-label {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Tables */
.table-responsive {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--medium-grey);
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background-color: var(--white);
}

th {
  background-color: var(--light-grey);
  color: var(--primary-blue);
  font-weight: 600;
  padding: 16px 20px;
  text-align: left;
  border-bottom: 2px solid var(--medium-grey);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--medium-grey);
  vertical-align: middle;
}

tr:last-child td {
  border-bottom: none;
}

tbody tr:hover {
  background-color: rgba(63, 179, 237, 0.05);
}

/* Risk Indicators */
.risk-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-weight: 500;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.risk-low,
.risk-indicator.risk-low {
  background-color: var(--risk-low);
  color: var(--risk-low-text);
}

.risk-moderate,
.risk-indicator.risk-moderate {
  background-color: var(--risk-moderate);
  color: var(--risk-moderate-text);
}

.risk-high,
.risk-indicator.risk-high {
  background-color: var(--risk-high);
  color: var(--risk-high-text);
}

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

label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--primary-blue);
  font-size: 0.875rem;
}

input[type="text"],
input[type="password"],
input[type="date"],
input[type="email"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--medium-grey);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
  background-color: var(--white);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--secondary-blue);
  box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

/* Filter Forms */
.filter-form {
  background-color: var(--white);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin-bottom: 32px;
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-end;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--medium-grey);
}

.filter-form .form-group {
  flex: 1;
  min-width: 200px;
  margin-bottom: 0;
}

/* Alerts */
.alert {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 24px;
  border-left: 4px solid;
  font-weight: 500;
}

.alert-success {
  background-color: #f0fff4;
  border-left-color: var(--success);
  color: #22543d;
}

.alert-warning {
  background-color: #fffbf0;
  border-left-color: var(--warning);
  color: #9c4221;
}

.alert-danger {
  background-color: #fff5f5;
  border-left-color: var(--danger);
  color: #742a2a;
}

.alert-info {
  background-color: #f0f9ff;
  border-left-color: var(--info);
  color: #1e40af;
}

/* Login Page Specific Styles */
.login-page {
  background: linear-gradient(135deg, var(--light-grey) 0%, #e6fffa 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-container {
  background-color: var(--white);
  padding: 48px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
  border: 1px solid var(--medium-grey);
}

.login-header {
  text-align: center;
  margin-bottom: 32px;
}

.login-header img {
  height: 64px;
  margin-bottom: 16px;
}

.login-header h2 {
  color: var(--primary-blue);
  margin-bottom: 8px;
}

.login-header h3 {
  color: var(--text-secondary);
  font-weight: 400;
  font-size: 1rem;
}

/* Footer */
footer {
  background-color: var(--white);
  border-top: 1px solid var(--medium-grey);
  padding: 24px 0;
  margin-top: 64px;
  text-align: center;
}

footer p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }
  
  .header-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  
  nav ul {
    flex-direction: column;
    width: 100%;
    gap: 4px;
  }
  
  nav ul li a {
    padding: 12px;
    justify-content: flex-start;
  }
  
  .dashboard-stats {
    grid-template-columns: 1fr;
  }
  
  .filter-form {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-form .form-group {
    width: 100%;
  }
  
  .dashboard-section,
  .assessment-section,
  .report-section {
    padding: 20px;
  }
  
  .login-container {
    padding: 32px 24px;
    margin: 16px;
  }
  
  .table-responsive {
    border-radius: var(--radius-md);
  }
  
  table {
    font-size: 0.875rem;
  }
  
  th, td {
    padding: 12px 16px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 12px;
  }
  
  .stat-card {
    padding: 24px;
  }
  
  .stat-number {
    font-size: 2.5rem;
  }
  
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
}

/* Print Styles */
@media print {
  header, footer, nav, .filter-form, .form-actions, .btn {
    display: none !important;
  }
  
  body {
    background-color: white !important;
    color: black !important;
  }
  
  .container {
    max-width: none !important;
    padding: 0 !important;
  }
  
  .dashboard-section,
  .assessment-section,
  .report-section,
  .stat-card {
    box-shadow: none !important;
    border: 1px solid #ddd !important;
    break-inside: avoid;
  }
}

/* Animation and Transitions */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn 0.3s ease-out;
}

/* Focus states for accessibility */
button:focus,
.btn:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
  outline: 2px solid var(--secondary-blue);
  outline-offset: 2px;
}

/* Loading states */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Progress indicators and charts remain the same but with updated colors */
.progress-container {
  background-color: var(--white);
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--medium-grey);
}

.progress-track {
  height: 8px;
  background-color: var(--medium-grey);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-bar {
  height: 100%;
  background-color: var(--primary-blue);
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Chart styling */
.chart-bar {
  display: flex;
  height: 32px;
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 20px 0;
  box-shadow: var(--shadow-sm);
}

.bar-segment {
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
  min-width: 40px;
  font-size: 0.75rem;
}

.bar-segment.high {
  background-color: var(--danger);
}

.bar-segment.moderate {
  background-color: var(--warning);
  color: #333;
}

.bar-segment.low {
  background-color: var(--success);
}