:root {
  --primary-color: #4361ee;
  --secondary-color: #3a0ca3;
  --accent-color: #4cc9f0;
  --success-color: #2ecc71;
  --warning-color: #f39c12;
  --danger-color: #e74c3c;
  --background-color: #f8fafc;
  --card-bg: #ffffff;
  --text-color: #2d3748;
  --text-light: #718096;
  --border-color: #e2e8f0;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, #4361ee 0%, #3a0ca3 100%);
}

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

body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  color: var(--text-color);
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Buttons */
.btn-primary {
  background: var(--gradient);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(67, 97, 238, 0.3);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: white;
  color: var(--primary-color);
  padding: 12px 24px;
  border: 2px solid var(--primary-color);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

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

.btn-clear {
  background: var(--danger-color);
  color: white;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-clear:hover {
  background: #c0392b;
  transform: translateY(-2px);
}

.btn-download {
  background: var(--success-color);
  color: white;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-download:hover {
  background: #27ae60;
  transform: translateY(-2px);
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 4px 20px var(--shadow-color);
  margin-bottom: 24px;
  transition: transform 0.3s ease;
}

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

/* Header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--card-bg);
  box-shadow: 0 2px 10px var(--shadow-color);
}

.main-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 700;
  color: var(--primary-color);
  text-decoration: none;
}

.logo i {
  font-size: 28px;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 6px;
  transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
  background: var(--primary-color);
  color: white;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--primary-color);
}

/* Hero Section */
.hero-section {
  padding: 40px 0;
}

.hero-content {
  text-align: center;
  max-width: 800px;
  margin: 0 auto;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.description {
  font-size: 1.2rem;
  color: var(--text-light);
  line-height: 1.8;
}

.breadcrumb {
  margin-bottom: 20px;
  font-size: 14px;
  color: var(--text-light);
}

.breadcrumb a {
  color: var(--primary-color);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Main Content Grid */
.main-content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 40px;
}

/* Calculator Section */
.calculator-section .section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.gpa-display {
  background: var(--gradient);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.gpa-label {
  font-weight: 600;
}

.gpa-value {
  font-size: 24px;
  font-weight: 700;
}

.calculator-controls {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

.input-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr auto;
  gap: 15px;
  align-items: center;
  padding: 12px;
}

.header-row {
  background: var(--primary-color);
  color: white;
  border-radius: 6px;
  font-weight: 600;
}

.course-row {
  background: white;
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid var(--border-color);
  transition: all 0.3s ease;
}

.course-row:hover {
  border-color: var(--primary-color);
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.input-cell {
  padding: 10px;
}

.course-row input,
.course-row select {
  width: 100%;
  padding: 10px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  transition: all 0.3s ease;
}

.course-row input:focus,
.course-row select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
}

.remove-course {
  background: var(--danger-color);
  color: white;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.remove-course:hover {
  background: #c0392b;
  transform: scale(1.1);
}

.calculator-actions {
  display: flex;
  gap: 15px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.scale-selector {
  display: flex;
  align-items: center;
  gap: 10px;
}

.scale-selector select {
  padding: 8px 16px;
  border: 2px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  background: white;
}

/* Results Section */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.result-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: 0 2px 10px var(--shadow-color);
}

.result-icon {
  width: 50px;
  height: 50px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 20px;
}

.result-content h3 {
  font-size: 16px;
  color: var(--text-light);
  margin-bottom: 5px;
}

.result-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 5px;
}

.result-label {
  font-size: 14px;
  color: var(--text-light);
}

.gpa-breakdown {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 30px;
  margin-bottom: 40px;
}

.formula-card {
  background: var(--gradient);
  color: white;
  padding: 20px;
  border-radius: 10px;
  margin: 20px 0;
}

.formula-header {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  margin-bottom: 10px;
}

.formula {
  font-size: 24px;
  font-weight: 700;
  text-align: center;
  font-family: 'Courier New', monospace;
}

.steps {
  margin-top: 30px;
}

.step {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
}

.step-number {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.step-content h4 {
  margin-bottom: 5px;
}

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

.grading-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.grading-table th,
.grading-table td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.grading-table th {
  background: var(--primary-color);
  color: white;
  font-weight: 600;
}

.grading-table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.grading-table tbody tr:hover {
  background: #e9ecef;
}

/* Example Card */
.example-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  margin-top: 15px;
}

.example-course {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--border-color);
}

.example-course:last-child {
  border-bottom: none;
}

.example-calculation {
  background: #f8f9fa;
  border-radius: 6px;
  padding: 15px;
  margin-top: 15px;
}

.highlight {
  color: var(--primary-color);
  font-weight: 700;
  font-size: 20px;
}

/* Tips List */
.tips-list {
  margin-top: 20px;
}

.tip {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  background: white;
  border-radius: 8px;
  margin-bottom: 10px;
  border-left: 4px solid var(--accent-color);
}

.tip i {
  font-size: 20px;
  color: var(--primary-color);
}

.tip h4 {
  margin-bottom: 5px;
}

/* Related Tools */
.related-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.tool-card {
  background: white;
  border-radius: 10px;
  padding: 25px;
  text-align: center;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.tool-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px);
}

.tool-icon {
  width: 60px;
  height: 60px;
  background: var(--gradient);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24px;
  margin: 0 auto 15px;
}

.tool-card h3 {
  margin-bottom: 10px;
}

.tool-card p {
  color: var(--text-light);
  margin-bottom: 15px;
}

.tool-link {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Footer */
.site-footer {
  background: var(--secondary-color);
  color: white;
  padding: 60px 0 30px;
  margin-top: 60px;
}

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

.footer-brand h3 {
  color: white;
  margin-bottom: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-links h4,
.footer-social h4 {
  color: white;
  margin-bottom: 20px;
}

.footer-links ul {
  list-style: none;
}

.footer-links li {
  margin-bottom: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: white;
}

.social-icons {
  display: flex;
  gap: 15px;
}

.social-icon {
  width: 40px;
  height: 40px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  transition: all 0.3s ease;
}

.social-icon:hover {
  background: white;
  color: var(--primary-color);
  transform: translateY(-3px);
}

.footer-legal {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero-content h1 {
    font-size: 2.5rem;
  }
}

@media (max-width: 768px) {
  .info-grid {
    grid-template-columns: 1fr;
  }
  
  .main-nav {
    position: relative;
  }
  
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--card-bg);
    flex-direction: column;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    box-shadow: 0 4px 10px var(--shadow-color);
  }
  
  .nav-links.active {
    max-height: 300px;
    padding: 20px;
  }
  
  .menu-toggle {
    display: block;
  }
  
  .calculator-actions {
    flex-direction: column;
  }
  
  .input-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  
  .results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-content h1 {
    font-size: 2rem;
  }
  
  .description {
    font-size: 1rem;
  }
  
  .card {
    padding: 20px;
  }
  
  .results-header {
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
  }
}
