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

:root {
  --primary-green: #2d8f47;
  --light-green: #4caf50;
  --primary-orange: #ff8c00;
  --light-orange: #ffa726;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --dark-gray: #333333;
  --border-color: #e0e0e0;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-hover: 0 4px 20px rgba(0, 0, 0, 0.15);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: var(--dark-gray);
  background-color: var(--light-gray);
}

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

/* Header */
.header {
  background: linear-gradient(135deg, var(--primary-green), var(--light-green));
  color: var(--white);
  padding: 1rem 0;
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  box-shadow: var(--shadow);
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  font-size: 1.5rem;
  font-weight: bold;
}

.logo i {
  margin-right: 0.5rem;
  color: var(--primary-orange);
}

.nav-menu {
  position: relative;
}

.nav-list {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-list a {
  color: var(--white);
  text-decoration: none;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-list a:hover {
  color: var(--primary-orange);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.nav-toggle span {
  width: 25px;
  height: 3px;
  background: var(--white);
  margin: 3px 0;
  transition: 0.3s;
}

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-green), var(--light-green));
  color: var(--white);
  padding: 120px 0 80px;
  text-align: center;
}

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

.hero-logo {
  font-size: 4rem;
  color: var(--primary-orange);
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 700;
}

.hero h2 {
  font-size: 2rem;
  color: var(--primary-orange);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* Calculator Section */
.calculator-section {
  padding: 80px 0;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.tab-btn {
  flex: 1;
  padding: 1rem;
  background: var(--white);
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--dark-gray);
  transition: all 0.3s ease;
  border-bottom: 3px solid transparent;
  min-width: 150px;
}

.tab-btn:hover {
  background: var(--light-gray);
  color: var(--primary-green);
}

.tab-btn.active {
  background: var(--primary-green);
  color: var(--white);
  border-bottom-color: var(--primary-orange);
}

/* Tab Content */
.tab-content {
  position: relative;
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

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

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

/* Card */
.card {
  background: var(--white);
  border-radius: 15px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
}

.card-header {
  background: linear-gradient(135deg, var(--primary-orange), var(--light-orange));
  color: var(--white);
  padding: 1.5rem;
  text-align: center;
}

.card-header h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

.card-body {
  padding: 2rem;
}

/* Table */
.table-responsive {
  overflow-x: auto;
  margin: -1rem;
  padding: 1rem;
}

.calculation-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.calculation-table th,
.calculation-table td {
  padding: 1rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.calculation-table th {
  background: var(--light-gray);
  font-weight: 600;
  color: var(--dark-gray);
  font-size: 0.9rem;
}

.calculation-table td:first-child {
  text-align: left;
  font-weight: 500;
  background: var(--light-gray);
}

.formula {
  color: var(--primary-orange);
  font-weight: 600;
}

/* Form Input */
.form-input {
  width: 80px;
  padding: 0.5rem;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  text-align: center;
  font-size: 1rem;
  transition: border-color 0.3s ease;
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-green);
  box-shadow: 0 0 0 3px rgba(45, 143, 71, 0.1);
}

/* Results */
.coefficient {
  background: var(--light-orange) !important;
  color: var(--white);
  font-weight: 600;
}

.partial-result {
  background: rgba(76, 175, 80, 0.1) !important;
  color: var(--primary-green);
  font-weight: 600;
}

.result {
  background: var(--primary-green) !important;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

.total-row {
  background: var(--primary-orange) !important;
}

.total-row td {
  background: var(--primary-orange) !important;
  color: var(--white);
  font-weight: 700;
  font-size: 1.1rem;
}

.total-result {
  background: var(--primary-green) !important;
  color: var(--white);
  font-weight: 700;
  font-size: 1.2rem;
}

/* Instructions */
.instructions {
  margin-top: 2rem;
}

.alert {
  padding: 1rem;
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.alert-info {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid var(--primary-green);
  color: var(--primary-green);
}

.alert i {
  font-size: 1.2rem;
}




/* Responsive Design */
@media (max-width: 768px) {
  .nav-list {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: var(--primary-green);
    flex-direction: column;
    padding: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
  }

  .nav-list.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-toggle {
    display: flex;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero h2 {
    font-size: 1.5rem;
  }

  .hero-logo {
    font-size: 3rem;
  }

  .tab-navigation {
    flex-direction: column;
  }

  .tab-btn {
    min-width: auto;
  }

  .calculation-table {
    font-size: 0.8rem;
  }

  .calculation-table th,
  .calculation-table td {
    padding: 0.5rem;
  }

  .form-input {
    width: 60px;
    padding: 0.3rem;
    font-size: 0.9rem;
  }

  .card-body {
    padding: 1rem;
  }

  .container {
    padding: 0 15px;
  }
}

@media (max-width: 480px) {
  .hero {
    padding: 100px 0 60px;
  }

  .calculator-section {
    padding: 60px 0;
  }

  .calculation-table {
    font-size: 0.7rem;
  }

  .form-input {
    width: 50px;
    padding: 0.2rem;
    font-size: 0.8rem;
  }

  .tab-btn {
    padding: 0.8rem;
    font-size: 0.8rem;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

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

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

/* Hover effects */
.calculation-table tr:hover {
  background: rgba(76, 175, 80, 0.05);
}

.form-input:hover {
  border-color: var(--light-green);
}

/* Focus styles for accessibility */
.tab-btn:focus,
.form-input:focus {
  outline: 2px solid var(--primary-orange);
  outline-offset: 2px;
}

/* Print styles */
@media print {
  .header,
  .footer,
  .tab-navigation {
    display: none;
  }

  .tab-pane {
    display: block !important;
  }

  .card {
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
