:root {
  --color-primary: #1d3557;
  --color-secondary: #e63946;
  --color-background: #f7f7f7;
  --color-surface: #ffffff;
  --color-text-primary: #333333;
  --color-text-secondary: #f1f1f1;
  --color-anchor-primary: #2563eb;
  --color-shadow: rgba(0, 0, 0, 0.1);
  --color-shadow-card: rgba(0, 0, 0, 0.08);
  --color-navbar-bg: rgba(255, 255, 255, 0.98);
  --color-footer-bg: #1d3557;
}

[data-theme='dark'] {
  --color-primary: #a8dadc;
  --color-secondary: #e63946;
  --color-background: #121212;
  --color-surface: #1e1e1e;
  --color-text-primary: #e0e0e0;
  --color-text-secondary: #a8dadc;
  --color-anchor-primary: #a8dadc;
  --color-shadow: rgba(255, 255, 255, 0.1);
  --color-shadow-card: rgba(0, 0, 0, 0.3);
  --color-navbar-bg: rgba(30, 30, 30, 0.98);
  --color-footer-bg: #1e3a47; 
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.icon {
  filter: invert(0);
  transition: filter 0.3s ease;
}

[data-theme='dark'] .icon {
  filter: invert(1);
}

body {
  font-family: "Montserrat", sans-serif;
  background: var(--color-background);
  color: var(--color-text-primary);
  transition: background 0.3s ease, color 0.3s ease;
}

body:not(#index) {
  margin: 0;
  padding-top: 70px;
}

h1:not(:is(.h1-heading, .navbar-brand)), h2:not(.h1-heading), h3 {
  font-family: "Playfair Display", serif;
  color: var(--color-primary);

  margin-top: 0.5em; 
  margin-bottom: 0.5em;
  font-weight: 700;
}

a {
  color: var(--color-anchor-primary);
  text-decoration: none;
  transition: color 0.3s ease;
}
a:hover {
  color: var(--color-secondary);
}

.navbar {
  background: var(--color-navbar-bg);
  box-shadow: 0 2px 8px var(--color-shadow);
  padding: 0.5rem 1rem;
  backdrop-filter: blur(5px);
}

.navbar-brand {
  display: flex;
  align-items: center;
  font-weight: 700;
  color: var(--color-primary);
}
.navbar-brand:hover {
  color: var(--color-primary);
}
.navbar-brand img {
  height: 40px;
  margin-right: 0.5rem;
}


.navbar-nav .nav-link {
  color: var(--color-text-primary) !important;
  font-weight: 600;
  padding: 0.5rem 1rem !important;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
  color: #3b82f6 !important;
  background: rgba(59, 130, 246, 0.1);
}

.navbar-toggler {
  border: none;
  color: var(--color-primary);
}
.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}
.navbar-toggler .material-icons {
  font-size: 1.75rem;
}

.dropdown-menu {
  background-color: var(--color-surface);
  border: 1px solid var(--color-shadow-card);
  box-shadow: 0 4px 12px var(--color-shadow);
  animation: fadeIn 0.2s ease;
}
.dropdown-item {
  color: var(--color-text-primary);
  border-radius: 0.5rem;
  padding: 0.5rem 1rem;
  font-weight: 500;
}
.dropdown-item:hover:not(:active) {
  background: rgba(59, 130, 246, 0.1);
  color: #3b82f6;
}
.dropdown-item:focus {
	background: var(--color-shadow);
	color: var(--color-text-primary);
}

.dropdown-submenu.dropstart .dropdown-menu {
  left: auto;
  right: 100%;
  top: 0;
  margin-top: 0;
}

.section {
  background: var(--color-surface);
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 6px 15px var(--color-shadow-card);
  transition: background 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 50px;
}

.section:not(#index .section) {
  margin: 30px auto;
}

.section h2:not(#index h2) {
  text-align: center;
  margin-bottom: 25px;
  font-size: 2rem;
}

.section h1 {
  text-align: center;
  margin-bottom: 25px;
  font-size: 2rem;
}

.section p {
  font-size: 1rem;
  line-height: 1.7;
  text-align: justify;
  margin-bottom: 1.5em;
}
.section p:not(#index h2) {
  text-align: justify;
}

footer {
  background: var(--color-footer-bg);
  color: var(--color-text-secondary);
  text-align: center;
  padding: 40px 10px;
  transition: background 0.3s ease, color 0.3s ease;
}

footer a {
  color: var(--color-text-secondary);
  font-weight: 500;
}
footer a:hover {
  color: var(--color-secondary);
}

footer p {
  margin: 0;
  line-height: 1.5;
}


#theme-toggle {
  background: transparent;
  border: 1px solid #e2e8f0;
  color: var(--color-text-primary);
  padding: 0.5rem;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  margin-left: 1rem;
}
#theme-toggle:hover {
  background: #e2e8f0;
  color: #3b82f6;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

@media screen and (orientation:portrait) {
    .navbar-brand {
        font-size: 0.85rem;
    }
    .section p:not(#index h2) {
        text-align: inherit;
        font-size: 0.82rem;
    }
}