:root {
  --primary: #EE3A3A;
  --accent: #050606;
  --bg-light: #f9fafb;
  --text-dark: #1f2937;
  --text-gray: #6b7280;
  --border: #e5e7eb;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-dark);
  background: var(--bg-light);
}

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

/* Header */
header {
  background: white;
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--accent);
}

.logo img {
  width: 40px;
  height: 40px;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--accent);
}

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

.main-nav a {
  text-decoration: none;
  color: var(--text-dark);
  font-weight: 500;
  transition: color 0.3s;
}

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

/* Layout */
.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
  margin: 2rem 0;
  min-height: calc(100vh - 200px);
}

/* Sidebar */
.sidebar {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  height: fit-content;
  position: sticky;
  top: 80px;
}

.sidebar h3 {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-gray);
  margin-bottom: 1rem;
  font-weight: 600;
}

.sidebar-section {
  margin-bottom: 2rem;
}

.sidebar-section:last-child {
  margin-bottom: 0;
}

.sidebar-links {
  list-style: none;
}

.sidebar-links li {
  margin-bottom: 0.5rem;
}

.sidebar-links a {
  text-decoration: none;
  color: var(--text-dark);
  font-size: 0.925rem;
  display: block;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  transition: all 0.2s;
}

.sidebar-links a:hover {
  background: var(--bg-light);
  color: var(--primary);
}

.sidebar-links a.active {
  background: var(--primary);
  color: white;
  font-weight: 600;
}

/* Main Content */
main {
  background: white;
  padding: 2.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
}

h1 {
  font-size: 2.5rem;
  margin-bottom: 1.5rem;
  color: var(--accent);
  line-height: 1.2;
}

h2 {
  font-size: 1.875rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--accent);
}

h3 {
  font-size: 1.5rem;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  color: var(--text-dark);
}

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

a {
  color: var(--primary);
  transition: opacity 0.2s;
}

a:hover {
  opacity: 0.8;
}

.external-link::after {
  content: " ↗";
  font-size: 0.875em;
}

/* Calculator */
.calculator {
  background: var(--bg-light);
  padding: 2rem;
  border-radius: 8px;
  margin: 2rem 0;
  border: 2px solid var(--border);
}

.calculator-form {
  display: grid;
  gap: 1.5rem;
}

.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-dark);
  font-size: 0.925rem;
}

.form-group input,
.form-group select {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 1rem;
  background: white;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(238, 58, 58, 0.1);
}

.btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 1rem 2rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn:hover {
  background: #d63333;
}

.results {
  margin-top: 2rem;
  padding: 2rem;
  background: white;
  border-radius: 8px;
  border: 2px solid var(--primary);
}

.results.hidden {
  display: none;
}

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

.result-card {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-light);
  border-radius: 8px;
}

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

.result-label {
  font-size: 0.875rem;
  color: var(--text-gray);
  font-weight: 600;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.card {
  background: white;
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  transition: all 0.2s;
}

.card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card h3 {
  margin-top: 0;
  color: var(--primary);
}

.card-link {
  display: inline-block;
  margin-top: 1rem;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
}

.card-link::after {
  content: " →";
}

/* Info Box */
.info-box {
  background: #fef3c7;
  border-left: 4px solid #f59e0b;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.warning-box {
  background: #fee2e2;
  border-left: 4px solid #ef4444;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.success-box {
  background: #d1fae5;
  border-left: 4px solid #10b981;
  padding: 1rem 1.5rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

/* Lists */
ul, ol {
  margin: 1rem 0 1rem 2rem;
  color: var(--text-gray);
}

li {
  margin-bottom: 0.5rem;
}

/* Table */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
}

th, td {
  padding: 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  background: var(--bg-light);
  font-weight: 600;
  color: var(--text-dark);
}

/* Footer */
footer {
  background: var(--accent);
  color: white;
  padding: 3rem 0 1rem;
  margin-top: 4rem;
}

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

.footer-section h4 {
  margin-bottom: 1rem;
  font-size: 1.125rem;
}

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

.footer-links li {
  margin-bottom: 0.5rem;
}

.footer-links a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-size: 0.925rem;
}

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

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

/* Hero */
.hero {
  background: linear-gradient(135deg, var(--primary), #c62828);
  color: white;
  padding: 4rem 2rem;
  border-radius: 12px;
  text-align: center;
  margin-bottom: 3rem;
}

.hero h1 {
  color: white;
  font-size: 3rem;
  margin-bottom: 1rem;
}

.hero p {
  color: rgba(255,255,255,0.95);
  font-size: 1.25rem;
  margin-bottom: 2rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.hero .btn {
  background: white;
  color: var(--primary);
  font-size: 1.125rem;
  padding: 1rem 2.5rem;
}

.hero .btn:hover {
  background: var(--bg-light);
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: static;
  }
  
  .main-nav {
    display: none;
  }
  
  .nav-toggle {
    display: block;
  }
  
  main {
    padding: 1.5rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h2 {
    font-size: 1.5rem;
  }
  
  .hero h1 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
}
