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

:root {
  --primary: #3996d7;
  --primary-dark: #2980b9;
  --primary-light: #74b9ff;
  --secondary: #6c5ce7;
  --accent: #00cec9;
  --success: #00b894;
  --warning: #fdcb6e;
  --error: #e84393;
  --dark: #2d3436;
  --gray-900: #1e1e1e;
  --gray-800: #2d3748;
  --gray-700: #4a5568;
  --gray-600: #718096;
  --gray-500: #a0aec0;
  --gray-400: #cbd5e0;
  --gray-300: #e2e8f0;
  --gray-200: #edf2f7;
  --gray-100: #f7fafc;
  --white: #ffffff;
  --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--primary-light) 100%);
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 25px rgba(0, 0, 0, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 0, 0, 0.2);
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  line-height: 1.6;
  color: var(--gray-800);
  background: var(--gray-100);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--gray-900);
  margin-bottom: 1rem;
}

h1 { font-size: clamp(2rem, 4vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.5rem); }
h3 { font-size: clamp(1.25rem, 2.5vw, 2rem); }
h4 { font-size: clamp(1.125rem, 2vw, 1.5rem); }

p {
  margin-bottom: 1rem;
  font-size: clamp(0.875rem, 2vw, 1.125rem);
}

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

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

/* Header & Navigation */
header {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-200);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  transition: var(--transition);
}

.navbar {
  padding: 0.75rem 0;
}

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

.nav-logo a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 700;
  font-size: 1.25rem;
  color: var(--gray-900);
  text-decoration: none;
}

.nav-logo svg {
  transition: var(--transition);
}

.nav-logo:hover svg {
  transform: scale(1.1);
}

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  font-weight: 500;
  color: var(--gray-700);
  padding: 0.5rem 0;
  position: relative;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--primary);
  text-decoration: none;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--gradient-primary);
  transition: var(--transition);
}

.nav-link:hover::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  width: 24px;
  height: 3px;
  background: var(--gray-700);
  border-radius: 2px;
  transition: var(--transition);
}

/* Hero Section */
.hero {
  background: var(--gradient-primary);
  color: var(--white);
  padding: 8rem 0 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
  animation: float 20s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

.hero h1 {
  color: var(--white);
  margin-bottom: 1rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: 3rem;
  opacity: 0.9;
}

/* Calculator Widget */
.calculator-widget {
  background: var(--white);
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-xl);
  padding: 2rem;
  margin: 2rem auto 0;
  max-width: 600px;
  color: var(--gray-800);
  position: relative;
  z-index: 1;
}

.calculator-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 2rem;
  background: var(--gray-100);
  border-radius: var(--border-radius);
  padding: 0.25rem;
}

.tab-btn {
  flex: 1;
  padding: 0.75rem 1rem;
  border: none;
  background: transparent;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  color: var(--gray-600);
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.tab-btn.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-btn:hover:not(.active) {
  background: var(--gray-200);
  color: var(--gray-800);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

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

.result-display {
  text-align: center;
  padding: 2rem 0;
}

.result-label {
  font-size: 1rem;
  color: var(--gray-600);
  margin-bottom: 1rem;
}

.result-date {
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

.result-details {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.input-group {
  margin-bottom: 1.5rem;
}

.input-group label {
  display: block;
  font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
}

.date-input,
.number-input {
  width: 100%;
  padding: 0.75rem;
  border: 2px solid var(--gray-300);
  border-radius: var(--border-radius-sm);
  font-size: 1rem;
  transition: var(--transition);
  background: var(--white);
}

.date-input:focus,
.number-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(57, 150, 215, 0.1);
}

.button-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
}

.calc-btn {
  flex: 1;
  padding: 0.75rem 1.5rem;
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
}

.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.calc-btn:active {
  transform: translateY(0);
}

/* Content Section */
.content-section {
  padding: 4rem 0;
  background: var(--white);
}

.content-section .container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 3rem;
  align-items: start;
}

.main-article {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
}

.main-article h2 {
  color: var(--gray-900);
  border-bottom: 3px solid var(--primary);
  padding-bottom: 0.5rem;
  margin-bottom: 2rem;
}

.main-article h3 {
  color: var(--gray-800);
  margin-top: 2rem;
  margin-bottom: 1rem;
}

blockquote {
  background: var(--gray-100);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  margin: 2rem 0;
  border-radius: var(--border-radius-sm);
  font-style: italic;
  color: var(--gray-700);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  background: var(--white);
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

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

.data-table th {
  background: var(--gray-100);
  font-weight: 600;
  color: var(--gray-800);
}

.data-table tr:hover {
  background: var(--gray-50);
}

.highlight-box {
  background: var(--gradient-accent);
  color: var(--white);
  padding: 2rem;
  border-radius: var(--border-radius);
  margin: 2rem 0;
}

.highlight-box h4 {
  color: var(--white);
  margin-bottom: 1rem;
}

.highlight-box ul {
  list-style: none;
  padding: 0;
}

.highlight-box li {
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.highlight-box li:last-child {
  border-bottom: none;
}

.article-footer {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 2px solid var(--gray-200);
}

.article-footer ol {
  padding-left: 1.5rem;
}

.article-footer li {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--gray-600);
}

/* Sidebar */
.sidebar {
  position: sticky;
  top: 6rem;
}

.related-articles {
  background: var(--white);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}

.related-articles h3 {
  color: var(--gray-900);
  margin-bottom: 1rem;
  font-size: 1.25rem;
}

.related-articles ul {
  list-style: none;
  padding: 0;
}

.related-articles li {
  margin-bottom: 0.75rem;
}

.related-articles a {
  display: block;
  padding: 0.5rem;
  border-radius: var(--border-radius-sm);
  transition: var(--transition);
  font-size: 0.875rem;
}

.related-articles a:hover {
  background: var(--gray-100);
  text-decoration: none;
}

/* Footer */
footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 3rem 0 1rem;
}

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

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

.footer-section ul {
  list-style: none;
  padding: 0;
}

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

.footer-section a {
  color: var(--gray-400);
  font-size: 0.875rem;
  transition: var(--transition);
}

.footer-section a:hover {
  color: var(--white);
  text-decoration: none;
}

.footer-bottom {
  text-align: center;
  padding-top: 2rem;
  border-top: 1px solid var(--gray-700);
  color: var(--gray-500);
  font-size: 0.875rem;
}

/* GDPR Banner */
.gdpr-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--gray-900);
  color: var(--white);
  padding: 1rem;
  z-index: 1001;
  transform: translateY(100%);
  transition: var(--transition);
}

.gdpr-banner.show {
  transform: translateY(0);
}

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

.gdpr-content p {
  margin: 0;
  font-size: 0.875rem;
}

.gdpr-btn {
  background: var(--primary);
  color: var(--white);
  border: none;
  padding: 0.5rem 1rem;
  border-radius: var(--border-radius-sm);
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.gdpr-btn:hover {
  background: var(--primary-dark);
}

/* Back to Top */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.25rem;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
}

.back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.back-to-top:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* Responsive Design */
@media (max-width: 1024px) {
  .content-section .container {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .sidebar {
    position: static;
  }
}

@media (max-width: 768px) {
  .nav-menu {
    position: fixed;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    flex-direction: column;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
  }
  
  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .nav-toggle {
    display: flex;
  }
  
  .nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  
  .nav-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  
  .nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
  }
  
  .hero {
    padding: 6rem 0 3rem;
  }
  
  .calculator-widget {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .calculator-tabs {
    flex-direction: column;
    gap: 0.25rem;
  }
  
  .tab-btn {
    padding: 0.75rem;
  }
  
  .button-group {
    flex-direction: column;
  }
  
  .main-article {
    padding: 1.5rem;
  }
  
  .data-table {
    font-size: 0.875rem;
  }
  
  .data-table th,
  .data-table td {
    padding: 0.75rem 0.5rem;
  }
  
  .gdpr-content {
    flex-direction: column;
    text-align: center;
  }
  
  .back-to-top {
    bottom: 1rem;
    right: 1rem;
    width: 45px;
    height: 45px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0.75rem;
  }
  
  .calculator-widget {
    margin: 0.5rem;
    padding: 1rem;
  }
  
  .main-article {
    padding: 1rem;
  }
  
  .highlight-box {
    padding: 1.5rem;
  }
  
  .footer-content {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --gray-900: #f7fafc;
    --gray-800: #e2e8f0;
    --gray-700: #cbd5e0;
    --gray-600: #a0aec0;
    --gray-500: #718096;
    --gray-400: #4a5568;
    --gray-300: #2d3748;
    --gray-200: #1a202c;
    --gray-100: #171923;
    --white: #1a202c;
  }
  
  body {
    background: var(--gray-100);
    color: var(--gray-800);
  }
  
  header {
    background: rgba(26, 32, 44, 0.95);
    border-bottom-color: var(--gray-300);
  }
  
  .calculator-widget,
  .main-article,
  .related-articles {
    background: var(--gray-200);
  }
  
  .content-section {
    background: var(--gray-100);
  }
}
