* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: var(--bg-light);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.3s ease, color 0.3s ease;
}

body.dark-mode {
  color: var(--light);
  background-color: var(--bg-dark);
}

a {
  text-decoration: none;
  color: var(--primary);
  transition: var(--transition);
}

a:not(.social-icon):hover {
  color: var(--primary-dark);
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 1rem;
  color: var(--gray-900);
  transition: color 0.3s ease;
}

.dark-mode h1,
.dark-mode h2,
.dark-mode h3,
.dark-mode h4,
.dark-mode h5,
.dark-mode h6 {
  color: var(--white);
}

.btn {
  display: inline-flex;
  padding: 0.75rem 1.5rem;
  border-radius: var(--border-radius);
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  font-size: 1rem;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary {
  background-color: var(--primary);
  color: var(--black);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: var(--black);
}

.dark-mode .btn-primary:hover {
  background-color: var(--primary-light);
  color: var(--black);
}

.btn-secondary {
  background-color: var(--secondary);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--gray-500);
  color: var(--white);
}

.btn-danger {
  background-color: var(--danger);
  color: var(--white);
}

.btn-danger:hover {
  background-color: var(--danger-hover);
}

.btn-success {
  background-color: var(--success);
  color: var(--white);
}

.btn-success:hover {
  background-color: var(--success-hover);
}

.btn-block {
  display: block;
  width: 100%;
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: 1.1rem;
}

.btn-sm {
  padding: 0.35rem 0.75rem;
  font-size: 0.875rem;
}

section {
  padding: 4rem 0;
}

.container {
  padding: 0 1rem;
}

section:nth-child(even) {
  background-color: var(--gray-200);
}

body.dark-mode section:nth-child(even) {
  background-color: var(--dark-surface-1);
}

.section-title {
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  position: relative;
  padding-bottom: 1rem;
  color: var(--gray-900);
}

body.dark-mode .section-title {
    color: var(--white);
}

.section-title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 10vw;
  min-width: 80px;
  height: 4px;
  background-color: var(--primary);
}

.theme-toggle-fixed {
  position: fixed;
  bottom: 20px;
  left: 20px;
  z-index: 1010;
  background-color: var(--dark-surface-1);
  padding: 10px 15px;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition);
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

/* Universal Themed Scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--primary) transparent;
}

/* WebKit-based browsers */
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

*::-webkit-scrollbar-track {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 6px;
  border: 2px solid transparent;
  background-clip: content-box;
}

body.dark-mode *::-webkit-scrollbar-thumb {
  background-color: var(--primary-light);
}


body.nav-open .overlay-cta, 
body.nav-closed .overlay-cta {
  display: none;
}

body.nav-header .overlay-cta {
  position: fixed;
  display: flex;
  align-items: start;
  justify-content: start;
  bottom: 10px;
  right: 10px;
  z-index: 999;
  padding: 0 0.5rem;
  pointer-events: auto;
}

.theme-toggle-fixed:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

body:not(.dark-mode) .theme-toggle-fixed {
  background-color: var(--white);
  border: 1px solid var(--gray-300);
}

body.nav-open .theme-toggle-fixed {
  display: none;
}

.theme-toggle-fixed #theme-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--gray-300);
  user-select: none;
}

body:not(.dark-mode) .theme-toggle-fixed #theme-label {
  color: var(--gray-700);
}

.theme-toggle-fixed .theme-icon {
  font-size: 1.1rem;
  color: var(--primary-light);
}

body:not(.dark-mode) .theme-toggle-fixed .theme-icon {
  color: var(--primary);
}

/* Keep the dashed border around the .file-preview if you like */
.file-preview {
  border: 2px dashed var(--gray-300);
  position: relative;
  width: 100%;
  max-width: 600px; /* or whatever width suits your design */
  margin-top: 1rem;
  overflow: hidden;
}

/* The container that holds the image for cropping */
#cropperContainer {
  width: 100%;
  height: 400px; /* Increase to 500, 600, etc. as needed */
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The injected <img> will fill the #cropperContainer space. */
#cropperContainer img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}


@media (max-width: 576px) {
  body:not(.nav-open) .theme-toggle-fixed {
    bottom: 15px;
    left: 15px;
    padding: 8px 12px;
  }

  .theme-toggle-fixed #theme-label {
    font-size: 0.75rem;
  }
}
