/* Dynamic & Modern Responsive CSS System for Cape Cod Accountant */

/* Box Sizing & Baseline Resets */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  margin: 0;
  padding: 0;
  background-color: #95A4B8;
  background-image: url('../images/pgbckgrd.gif');
  background-repeat: repeat-x;
  font-family: Calibri, 'Segoe UI', Arial, sans-serif;
  color: #1a202c;
  line-height: 1.6;
}

/* Fluid Container Wrapper - Capped at 810px to align perfectly with header banner */
.site-wrapper,
table[width="810"],
table[width="806"],
table[width="100%"] {
  max-width: 810px !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

img {
  max-width: 100% !important;
  height: auto !important;
}

iframe, embed, object {
  max-width: 100% !important;
}

/* Header Banner Fluid Styling - Removes mobile vertical gaps */
.header-banner-cell {
  padding: 0 !important;
  margin: 0 !important;
  background: transparent !important;
  line-height: 0 !important;
  overflow: hidden !important;
}

.header-banner-img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  border-radius: 8px 8px 0 0;
  margin: 0 auto;
}

.header-banner-container,
.container {
  background-color: #003366;
  width: 100%;
  padding: 0;
  margin: 0;
  overflow: hidden;
}

/* Responsive Navigation Bar */
.main-nav-bar {
  background: #004080 linear-gradient(180deg, #1f5088 0%, #0e305d 100%);
  border-bottom: 2px solid #006ABC;
  position: relative;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  overflow: hidden !important;
  margin: 0 auto;
  z-index: 1000;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  max-width: 810px;
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 0 auto;
  padding: 0 !important;
}

.nav-links {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.nav-links li {
  position: relative;
}

.nav-links a {
  display: block;
  padding: 10px 16px;
  color: #ffffff !important;
  text-decoration: none !important;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: background 0.3s ease, color 0.3s ease;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links li.active > a {
  background: rgba(255, 255, 255, 0.15);
  color: #ffd700 !important;
}

/* Dropdown Menu */
.nav-links li .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: #0e305d;
  box-shadow: 0 8px 20px rgba(0,0,0,0.25);
  border-radius: 0 0 6px 6px;
  border-top: 2px solid #ffd700;
  padding: 6px 0;
  z-index: 1001;
}

.nav-links li:hover .dropdown-menu {
  display: block;
}

.dropdown-menu a {
  padding: 8px 16px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.dropdown-menu a:hover {
  background: #1a4985;
}

/* Mobile Hamburger Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 22px;
  padding: 10px 16px !important;
  cursor: pointer;
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.mobile-menu-toggle span {
  font-family: Calibri, sans-serif;
  font-size: 16px;
  font-weight: bold;
  vertical-align: middle;
  margin-right: 8px;
}

/* Address & Contact Info Table Cells */
.address {
  width: auto !important;
  font-size: 13pt;
  padding: 10px;
  text-align: right;
}

/* Content Area Table Styling */
table {
  border-collapse: collapse;
}

td {
  vertical-align: top;
}

.insidebody {
  border: 2px solid #006ABC;
  background-color: #ffffff;
  border-radius: 0 0 8px 8px;
  padding: 15px;
}

/* Remove legacy bottom white slice image artifacts */
img[src*="bbbgrd.gif"],
img[src*="bbgrd.gif"] {
  display: none !important;
}

/* Modern Client Login Button without white box artifacts */
.client-login-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  background: linear-gradient(180deg, #0088cc 0%, #005580 100%);
  color: #ffffff !important;
  font-family: Calibri, 'Segoe UI', Arial, sans-serif;
  font-size: 18px;
  font-weight: bold;
  text-decoration: none !important;
  border-radius: 26px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.3);
  margin: 10px auto;
}

.client-login-btn:hover {
  background: linear-gradient(180deg, #00a3f5 0%, #006699 100%);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  color: #ffffff !important;
}

/* Responsive Media Queries */

/* Tablet & Mobile (<= 768px) */
@media screen and (max-width: 768px) {
  body {
    padding: 0;
  }

  .site-wrapper,
  table[width="810"],
  table[width="806"],
  table[width="100%"] {
    width: 100% !important;
  }

  .container,
  .header-banner-cell {
    min-height: 0 !important;
    padding: 0 !important;
  }

  .address {
    text-align: center !important;
    float: none !important;
    width: 100% !important;
    font-size: 11pt !important;
  }

  /* Show Mobile Hamburger Button */
  .mobile-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    padding: 10px 16px !important;
    margin: 0 !important;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    width: 100%;
    background: #092347;
  }

  .nav-links.mobile-open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }

  .nav-links a {
    padding: 12px 20px;
    font-size: 16px;
  }

  .nav-links li .dropdown-menu {
    position: static;
    display: none;
    width: 100%;
    box-shadow: none;
    background: #05162e;
    border-top: none;
    padding-left: 15px;
  }

  .nav-links li.dropdown-open .dropdown-menu {
    display: block;
  }

  /* Multi-column layout stack */
  td[width="50%"],
  td[width="806"],
  td[colspan="2"] {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }

  /* Form inputs & buttons */
  input[type="text"],
  input[type="email"],
  textarea,
  select {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
    font-size: 16px !important; /* Prevents iOS auto-zoom */
    padding: 8px !important;
  }
}

/* Mobile Screens (<= 480px) */
@media screen and (max-width: 480px) {
  p, td, li {
    font-size: 10.5pt !important;
  }

  h1 { font-size: 16px !important; }
  h2 { font-size: 15px !important; }
  h3 { font-size: 14px !important; }

  .header-banner-container,
  .container {
    min-height: 80px;
  }
}
