/* ====================================
   Scientific Calculator Website
   ScientificCalculator.online
   ==================================== */

/* CSS Variables */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --secondary: #10b981;
  --accent: #f59e0b;
  --bg: #f8fafc;
  --bg-dark: #0f172a;
  --card: #ffffff;
  --card-dark: #1e293b;
  --text: #1e293b;
  --text-muted: #64748b;
  --text-dark: #f1f5f9;
  --border: #e2e8f0;
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.1);
  --radius: 12px;
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --border: #334155;
}

/* ====================================
   Global Styles
   ==================================== */

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

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

.section {
  padding: 60px 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 40px;
  color: var(--text);
}

.section-subtitle {
  font-size: 1.125rem;
  text-align: center;
  color: var(--text-muted);
  margin-bottom: 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

/* ====================================
   Header & Navigation
   ==================================== */

.header {
  background-color: var(--card);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: background-color 0.3s ease;
}

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

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

.nav-menu {
  display: flex;
  list-style: none;
  gap: 32px;
  align-items: center;
}

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

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

.dark-mode-toggle {
  background: transparent;
  border: 2px solid var(--border);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  transition: all 0.3s ease;
}

.dark-mode-toggle:hover {
  border-color: var(--primary);
  transform: rotate(180deg);
}

.hamburger {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--text);
  transition: all 0.3s ease;
}

/* ====================================
   Hero Section
   ==================================== */

.hero {
  text-align: center;
  padding: 10px 20px 10px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
}

.hero-title {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: 20px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.hero-subtitle {
  font-size: 1.5rem;
  margin-bottom: 16px;
  opacity: 0.95;
}

.hero-description {
  font-size: 1.125rem;
  max-width: 700px;
  margin: 0 auto 40px;
  opacity: 0.9;
}

/* ====================================
   Calculator - Landscape Mode
   ==================================== */

.calculator-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 40px 20px;
  min-height: auto;
}

.calculator-wrapper {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.calculator {
  background: linear-gradient(145deg, #1e293b 0%, #0f172a 100%);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.05);
  padding: 24px;
  position: relative;
  overflow: hidden;
  width: 100%;
  max-width: 1000px;
}

.calculator::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
}

/* Landscape Layout Container */
.calculator-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 20px;
  align-items: start;
}

/* Left Side: Display and Mode Controls */
.calculator-left {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.calculator-display {
  background: rgba(0,0,0,0.3);
  border-radius: 16px;
  padding: 20px;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border: 1px solid rgba(255,255,255,0.05);
  backdrop-filter: blur(10px);
}

.display-history {
  font-size: 0.875rem;
  color: rgba(255,255,255,0.5);
  text-align: right;
  min-height: 20px;
  margin-bottom: 8px;
  word-break: break-all;
  font-family: 'Courier New', monospace;
}

.display-main {
  font-size: 2rem;
  font-weight: 600;
  text-align: right;
  color: #ffffff;
  word-break: break-all;
  min-height: 40px;
  font-family: 'Courier New', monospace;
  text-shadow: 0 0 20px rgba(102, 126, 234, 0.5);
}

.calculator-mode {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mode-toggle {
  display: flex;
  gap: 8px;
  background: rgba(0,0,0,0.2);
  padding: 4px;
  border-radius: 10px;
}

.mode-btn {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  color: rgba(255,255,255,0.6);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.875rem;
  transition: all 0.3s ease;
}

.mode-btn.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.copy-btn-calc {
  padding: 10px 16px;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.8);
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.938rem;
  font-weight: 600;
  transition: all 0.3s ease;
  text-align: center;
}

.copy-btn-calc:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

/* Right Side: Buttons Grid */
.calculator-right {
  display: flex;
  flex-direction: column;
}

.calculator-buttons {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
}

.calc-btn {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  color: #ffffff;
  background: rgba(255,255,255,0.08);
  font-family: var(--font-family);
  border: 1px solid rgba(255,255,255,0.05);
  min-height: 50px;
}

.calc-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  background: rgba(255,255,255,0.12);
}

.calc-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.calc-btn.number {
  background: rgba(255,255,255,0.08);
  font-size: 1.125rem;
}

.calc-btn.number:hover {
  background: rgba(255,255,255,0.15);
}

.calc-btn.operator {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-size: 1.375rem;
}

.calc-btn.operator:hover {
  background: linear-gradient(135deg, #7c93ee 0%, #8b5db8 100%);
  box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.calc-btn.equals {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: white;
  font-size: 1.5rem;
}

.calc-btn.equals:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}

.calc-btn.function {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: white;
  font-size: 0.813rem;
}

.calc-btn.function:hover {
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.4);
}

.calc-btn.clear {
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  color: white;
}

.calc-btn.clear:hover {
  background: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  box-shadow: 0 6px 16px rgba(239, 68, 68, 0.4);
}

/* History Panel */
.history-toggle {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 12px 16px;
  border-radius: 8px 0 0 8px;
  cursor: pointer;
  font-weight: 600;
  box-shadow: var(--shadow);
  z-index: 100;
  transition: all 0.3s ease;
}

.history-toggle:hover {
  background-color: var(--primary-dark);
  padding-right: 20px;
}

.history-panel {
  position: fixed;
  right: -350px;
  top: 80px;
  width: 320px;
  height: calc(100vh - 100px);
  background-color: var(--card);
  box-shadow: -4px 0 20px rgba(0,0,0,0.15);
  border-radius: var(--radius) 0 0 var(--radius);
  transition: right 0.3s ease;
  z-index: 999;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.history-panel.open {
  right: 0;
}

.history-header {
  padding: 20px;
  border-bottom: 2px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-header h3 {
  font-size: 1.25rem;
  color: var(--text);
}

.clear-history-btn {
  background-color: #ef4444;
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: background-color 0.3s ease;
}

.clear-history-btn:hover {
  background-color: #dc2626;
}

.history-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.history-item {
  padding: 12px;
  margin-bottom: 8px;
  background-color: var(--bg);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.history-item:hover {
  background-color: var(--border);
  transform: translateX(-4px);
}

.history-expression {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 4px;
  word-break: break-all;
}

.history-result {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.empty-history {
  text-align: center;
  color: var(--text-muted);
  padding: 40px 20px;
}

/* ====================================
   Features Section
   ==================================== */

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

.feature-card {
  background-color: var(--card);
  padding: 30px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: 20px;
}

.feature-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.feature-description {
  color: var(--text-muted);
  font-size: 0.938rem;
}

/* ====================================
   Content Section
   ==================================== */

.content-section {
  background-color: var(--card);
  padding: 60px 20px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

.content-block {
  padding: 24px;
  background-color: var(--bg);
  border-radius: var(--radius);
  border-left: 4px solid var(--primary);
}

.content-block h3 {
  font-size: 1.5rem;
  margin-bottom: 16px;
  color: var(--text);
}

.content-block p {
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 12px;
}

/* ====================================
   Math Learning Section
   ==================================== */

.math-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
  margin-top: 40px;
}

.math-card {
  background-color: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.math-card h4 {
  font-size: 1.25rem;
  color: var(--primary);
  margin-bottom: 16px;
}

.math-card table {
  width: 100%;
  border-collapse: collapse;
}

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

.math-card th {
  font-weight: 600;
  color: var(--text);
}

.math-card td {
  color: var(--text-muted);
}

.math-card ul {
  list-style-position: inside;
  color: var(--text-muted);
}

.math-card li {
  margin-bottom: 8px;
}

/* ====================================
   Blog Section
   ==================================== */

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 40px;
}

.blog-card {
  background-color: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.blog-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.blog-card-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 20px;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.blog-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.blog-card-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.blog-card-excerpt {
  color: var(--text-muted);
  font-size: 0.938rem;
  margin-bottom: 16px;
  flex: 1;
}

.blog-card-link {
  display: inline-block;
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease;
}

.blog-card-link:hover {
  color: var(--primary-dark);
}

/* ====================================
   Article Page Styles
   ==================================== */

.breadcrumbs {
  padding: 20px 0;
  font-size: 0.875rem;
}

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

.breadcrumbs a:hover {
  text-decoration: underline;
}

.breadcrumbs span {
  color: var(--text-muted);
  margin: 0 8px;
}

.article-header {
  text-align: center;
  padding: 40px 0;
  border-bottom: 2px solid var(--border);
}

.article-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}

.article-meta {
  color: var(--text-muted);
  font-size: 0.938rem;
}

.article-content {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}



.article-content {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}




.table-of-contents {
  background-color: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  margin-bottom: 40px;
  border-left: 4px solid var(--primary);
}

.table-of-contents h3 {
  font-size: 1.25rem;
  margin-bottom: 16px;
  color: var(--text);
}

.table-of-contents ul {
  list-style: none;
}

.table-of-contents li {
  margin-bottom: 8px;
}

.table-of-contents a {
  color: var(--primary);
  text-decoration: none;
  transition: color 0.3s ease;
}

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

.article-content h2 {
  font-size: 1.875rem;
  margin-top: 40px;
  margin-bottom: 20px;
  color: var(--text);
}

.article-content h3 {
  font-size: 1.5rem;
  margin-top: 32px;
  margin-bottom: 16px;
  color: var(--text);
}

.article-content p {
  margin-bottom: 20px;
  line-height: 1.8;
  color: var(--text-muted);
}

.article-content ul,
.article-content ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--text-muted);
}

.article-content li {
  margin-bottom: 8px;
  line-height: 1.8;
}

.article-content strong {
  color: var(--text);
  font-weight: 600;
}

.article-content code {
  background-color: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
}

.author-section {
  background-color: var(--card);
  padding: 24px;
  border-radius: var(--radius);
  margin: 40px 0;
  display: flex;
  align-items: center;
  gap: 20px;
}

.author-avatar {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: white;
  flex-shrink: 0;
}

.author-info h4 {
  font-size: 1.125rem;
  margin-bottom: 8px;
  color: var(--text);
}

.author-info p {
  color: var(--text-muted);
  font-size: 0.938rem;
  margin: 0;
}

.social-share {
  text-align: center;
  padding: 24px;
  background-color: var(--card);
  border-radius: var(--radius);
  margin: 40px 0;
}

.social-share h4 {
  margin-bottom: 16px;
  color: var(--text);
}

.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.share-btn {
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  color: white;
  font-weight: 600;
  transition: all 0.3s ease;
}

.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

.share-btn.facebook {
  background-color: #1877f2;
}

.share-btn.twitter {
  background-color: #1da1f2;
}

.share-btn.linkedin {
  background-color: #0077b5;
}

.share-btn.email {
  background-color: #64748b;
}

.related-articles {
  margin-top: 60px;
}

.related-articles h3 {
  font-size: 1.875rem;
  margin-bottom: 30px;
  text-align: center;
  color: var(--text);
}

/* ====================================
   Ad Containers
   ==================================== */

.ad-container {
  margin: 40px auto;
  padding: 20px;
  background-color: var(--bg);
  border-radius: var(--radius);
  text-align: center;
  min-height: 250px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px dashed var(--border);
}

.ad-container::before {
  content: 'Advertisement';
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ====================================
   Footer
   ==================================== */

.footer {
  background-color: var(--card);
  padding: 60px 20px 20px;
  border-top: 2px solid var(--border);
}

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

.footer-section h4 {
  font-size: 1.125rem;
  margin-bottom: 20px;
  color: var(--text);
}

.footer-section p,
.footer-section a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.938rem;
  display: block;
  margin-bottom: 8px;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: var(--primary);
}

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

/* ====================================
   Contact Form
   ==================================== */

.contact-form {
  max-width: 600px;
  margin: 0 auto;
  background-color: var(--card);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 24px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--text);
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-family);
  font-size: 1rem;
  background-color: var(--bg);
  color: var(--text);
  transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.form-group textarea {
  resize: vertical;
  min-height: 150px;
}

.submit-btn {
  width: 100%;
  padding: 14px;
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 1.125rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

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

/* ====================================
   Formula Cards
   ==================================== */

.formula-category {
  margin-bottom: 40px;
}

.formula-category h3 {
  font-size: 1.5rem;
  margin-bottom: 24px;
  color: var(--primary);
}

.formulas-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.formula-card {
  background-color: var(--card);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
}

.formula-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text);
}

.formula-expression {
  background-color: var(--bg);
  padding: 12px;
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 1.125rem;
  margin-bottom: 12px;
  text-align: center;
  color: var(--text);
}

.formula-description {
  font-size: 0.938rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* ====================================
   Comparison Table
   ==================================== */

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: 30px 0;
  background-color: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

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

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

.comparison-table tr:last-child td {
  border-bottom: none;
}

.comparison-table tr:hover {
  background-color: var(--bg);
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--card);
    flex-direction: column;
    padding: 20px;
    box-shadow: var(--shadow);
    gap: 16px;
  }

  .nav-menu.active {
    display: flex;
  }

  .hamburger {
    display: flex;
  }

  .hero-title {
    font-size: 1.6rem;
  }

  .hero-subtitle {
    font-size: 1.25rem;
  }

  .section-title {
    font-size: 2rem;
  }

  /* Calculator Landscape Mode on Tablet */
  .calculator-wrapper {
    max-width: 100%;
  }

  .calculator {
    max-width: 100%;
    padding: 20px;
  }

  .calculator-layout {
    grid-template-columns: 1fr 2fr;
    gap: 16px;
  }

  .calculator-display {
    padding: 16px;
    min-height: 120px;
  }

  .display-main {
    font-size: 1.75rem;
  }

  .calculator-buttons {
    grid-template-columns: repeat(8, 1fr);
    gap: 6px;
  }

  .calc-btn {
    min-height: 44px;
    font-size: 0.875rem;
  }

  .calc-btn.function {
    font-size: 0.75rem;
  }

  .calc-btn.number {
    font-size: 1rem;
  }

  .calc-btn.operator {
    font-size: 1.125rem;
  }

  .history-panel {
    width: 100%;
    right: -100%;
    top: 70px;
    height: calc(100vh - 70px);
    border-radius: 0;
  }

  .history-toggle {
    bottom: 20px;
    top: auto;
    transform: none;
    border-radius: 8px;
    right: 20px;
  }

  .article-title {
    font-size: 2rem;
  }

  .footer-content {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Mobile: Stack Layout Vertically */
  .calculator-section {
    padding: 30px 12px;
  }

  .calculator {
    padding: 16px;
    border-radius: 20px;
  }

  .calculator-layout {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .calculator-left {
    order: 1;
  }

  .calculator-right {
    order: 2;
  }

  .calculator-display {
    min-height: 100px;
    padding: 16px;
  }

  .display-main {
    font-size: 1.5rem;
  }

  .display-history {
    font-size: 0.813rem;
  }

  .calculator-buttons {
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
  }

  .calc-btn {
    min-height: 54px;
    font-size: 0.875rem;
    border-radius: 8px;
  }

  .calc-btn.function {
    font-size: 0.688rem;
  }

  .calc-btn.number {
    font-size: 1.063rem;
  }

  .calc-btn.operator {
    font-size: 1.125rem;
  }

  .calc-btn.equals {
    font-size: 1.25rem;
  }

  .calculator-mode {
    flex-direction: row;
    gap: 8px;
  }

  .mode-toggle {
    flex: 1;
  }

  .copy-btn-calc {
    flex: 1;
    padding: 10px 12px;
    font-size: 0.875rem;
  }

  .hero-title {
    font-size: 1.75rem;
  }

  .share-buttons {
    flex-direction: column;
  }

  .share-btn {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .calculator-section {
    padding: 24px 8px;
  }

  .calculator {
    padding: 14px;
  }

  .calculator-buttons {
    gap: 5px;
  }

  .calc-btn {
    min-height: 50px;
    font-size: 0.813rem;
  }

  .calc-btn.function {
    font-size: 0.625rem;
  }
}

/* Landscape Mode on Mobile Devices */
@media (max-height: 500px) and (orientation: landscape) {
  .calculator-section {
    padding: 20px 12px;
  }

  .calculator {
    padding: 12px;
  }

  .calculator-layout {
    grid-template-columns: 1fr 2.5fr;
    gap: 12px;
  }

  .calculator-display {
    min-height: 80px;
    padding: 12px;
  }

  .display-main {
    font-size: 1.25rem;
  }

  .display-history {
    font-size: 0.75rem;
  }

  .calculator-buttons {
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
  }

  .calc-btn {
    min-height: 38px;
    font-size: 0.75rem;
  }

  .calc-btn.function {
    font-size: 0.625rem;
  }

  .mode-btn {
    padding: 6px 12px;
    font-size: 0.75rem;
  }

  .copy-btn-calc {
    padding: 6px 12px;
    font-size: 0.813rem;
  }
}





/* ===== MOBILE HEADER FIX ===== */
@media (max-width: 768px) {

  .nav {
    padding: 10px 12px;
  }

  .logo {
    font-size: 0.6rem !important;
    gap: 5px;
  }

  .logo img {
    width: 22px !important;
    height: 22px !important;
  }

  .nav-menu {
    gap: 12px;
  }

  .dark-mode-toggle {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .hamburger span {
    width: 20px;
    height: 2px;
  }

}

@media (max-width: 768px) {

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

  .logo {
    max-width: 70%;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

}





/* ====================================
   Utility Classes
   ==================================== */

.text-center {
  text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 40px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 40px; }

.hidden {
  display: none;
}
