/* Global Styles for grade-calculator.tech */
:root {
  --primary-color: #1a365d;
  --secondary-color: #2b6cb0;
  --accent-color: #ed8936;
  --bg-color: #f7fafc;
  --text-color: #2d3748;
  --light-gray: #e2e8f0;
  --white: #ffffff;
  --success: #48bb78;
  --danger: #e53e3e;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
}

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

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

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

h1 { font-size: 2.5rem; font-weight: 800; }
h2 { font-size: 2rem; font-weight: 700; margin-top: 2rem; }
h3 { font-size: 1.5rem; font-weight: 600; margin-top: 1.5rem; }
p { margin-bottom: 1.5rem; }
ul, ol { margin-bottom: 1.5rem; padding-left: 1.5rem; }
a { color: var(--secondary-color); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--primary-color); text-decoration: underline; }

/* Layout & Containers */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.main-content {
  flex: 1;
  padding: 3rem 0;
}

/* Header & Navigation */
header {
  background-color: var(--white);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  position: sticky;
  top: 0;
  z-index: 100;
}

.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--primary-color);
  text-decoration: none;
}
.brand img.logo {
  height: 2.25rem;
  width: auto;
  object-fit: contain;
}
.brand span { color: var(--accent-color); }
.brand:hover { text-decoration: none; }

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}
.nav-links a {
  color: var(--text-color);
  font-weight: 500;
}
.nav-links a:hover {
  color: var(--secondary-color);
  text-decoration: none;
}

/* Footer */
footer {
  background-color: var(--primary-color);
  color: var(--white);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

.footer-section h3 {
  color: var(--white);
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.footer-links {
  list-style: none;
  padding: 0;
}
.footer-links li { margin-bottom: 0.5rem; }
.footer-links a {
  color: var(--light-gray);
  text-decoration: none;
}
.footer-links a:hover { color: var(--white); }

.subscription-form {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}
.subscription-form input {
  flex: 1;
  padding: 0.75rem;
  border: none;
  border-radius: 4px;
}
.subscription-form button {
  background-color: var(--accent-color);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background-color 0.2s;
}
.subscription-form button:hover { background-color: #dd6b20; }

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  margin-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: var(--light-gray);
  font-size: 0.875rem;
}

/* Buttons */
.btn {
  display: inline-block;
  background-color: var(--secondary-color);
  color: var(--white);
  padding: 0.75rem 1.5rem;
  border-radius: 6px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s, transform 0.1s;
}
.btn:hover {
  background-color: var(--primary-color);
  color: var(--white);
  text-decoration: none;
}
.btn:active { transform: translateY(1px); }
.btn-accent { background-color: var(--accent-color); }
.btn-accent:hover { background-color: #dd6b20; }
.btn-danger { background-color: var(--danger); }
.btn-danger:hover { background-color: #c53030; }

/* Tables & Forms */
.calculator-card {
  background: var(--white);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
  border: 1px solid var(--light-gray);
}

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

input[type="text"], input[type="number"], input[type="email"], select, textarea {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid #cbd5e0;
  border-radius: 6px;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--secondary-color);
  box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.2);
}

.calc-actions {
  display: flex;
  gap: 1rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.result-box {
  margin-top: 2rem;
  padding: 1.5rem;
  background-color: #ebf8ff;
  border-left: 4px solid var(--secondary-color);
  border-radius: 6px;
}
.result-box.error {
  background-color: #fff5f5;
  border-left-color: var(--danger);
  color: var(--danger);
}

/* Card Grid for Index */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}
.card {
  background: var(--white);
  padding: 2rem;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.05);
  border: 1px solid var(--light-gray);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px rgba(0,0,0,0.1);
}
.card h3 { margin-top: 0; }
.card p { flex: 1; color: #4a5568; }
.card .btn { margin-top: 1.5rem; width: 100%; }

/* Form Styles */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}
.form-group {
  margin-bottom: 1.5rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none; /* In a full app, add a hamburger menu */
  }
  .calc-row {
    flex-direction: column;
    gap: 0.5rem;
  }
  .calc-actions {
    flex-direction: column;
  }
  .btn { width: 100%; }
}

.notice-block {
  background-color: #fffff0;
  border-left: 4px solid #ecc94b;
  padding: 1rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}
