:root {
  --brand: #1b2b50;
  --brand-light: #2c4a8c;
  --bg: #ffffff;
  --muted: #fafafa;
  --accent: #4299e1;
  --accent-hover: #3182ce;
  --success: #4CAF50;
  --success-hover: #45a049;
  --warning: #ff9800;
  --shadow-sm: 0 2px 8px rgba(27, 43, 80, 0.04);
  --shadow-md: 0 4px 16px rgba(27, 43, 80, 0.08);
  --shadow-lg: 0 8px 24px rgba(27, 43, 80, 0.12);
}

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

html {
  width: 100%;
  overflow-x: hidden;
  overflow-y: auto;
}

body {
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--bg);
  color: var(--brand);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  width: 100%;
  min-width: 0;
  overflow-x: hidden;
  position: relative;
}

body.menu-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  overscroll-behavior: none;
}

/* Prevent horizontal overflow on main containers only */
.main-content,
.page-header,
.header,
.footer {
  max-width: 100%;
  overflow-x: hidden;
}

/* AdSense specific fix */
ins.adsbygoogle {
  max-width: 100% !important;
  overflow: hidden !important;
}

.adsbygoogle {
  max-width: 100% !important;
  overflow-x: hidden !important;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
  box-sizing: border-box;
}

/* Header */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background-color: var(--muted);
  border-bottom: 1px solid rgba(27, 43, 80, 0.08);
  z-index: 1000;
  padding: 16px 0;
  transition: padding 0.2s ease-out, background-color 0.2s ease-out, box-shadow 0.2s ease-out;
  will-change: padding, background-color, box-shadow;
}

/* Shrink state when scrolling */
.header.shrink {
  padding: 12px 0;
  background-color: rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 24px rgba(11, 22, 30, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Progressive enhancement with backdrop-filter */
@supports (backdrop-filter: blur(8px)) or (-webkit-backdrop-filter: blur(8px)) {
  .header.shrink {
    background-color: rgba(255, 255, 255, 0.08);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
  }
}

/* Even more compact when scrolled further */
.header.shrink.compact {
  padding: 8px 0;
  background-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 16px rgba(11, 22, 30, 0.06);
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .header.shrink.compact {
    background-color: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .header, .header.shrink, .header.shrink.compact {
    transition: none;
  }
  .header.shrink, .header.shrink.compact {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    background-color: rgba(255, 255, 255, 0.12);
  }
}

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

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--brand);
  font-size: 20px;
  font-weight: 700;
}

.logo a {
  text-decoration: none !important;
  color: inherit;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-text {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--brand);
  transition: all 0.3s ease;
}

.header.shrink .logo-text {
  font-size: 22px;
}

.header.shrink.compact .logo-text {
  font-size: 20px;
  opacity: 0.9;
}

.nav {
  display: flex;
  gap: 0.5rem;
}

.nav a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: var(--brand);
  border-radius: 4px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  font-weight: 500;
}

.nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background-color: var(--brand);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.nav a:hover::after {
  width: calc(100% - 2rem);
}

.nav a:hover {
  transform: translateY(-1px);
}

.nav a:active {
  transform: translateY(0);
}

/* Dropdown Menu */
.nav .dropdown {
  position: relative;
  display: inline-block;
}

.nav .dropdown-toggle {
  cursor: pointer;
  display: inline-block;
  position: relative;
  color: var(--brand);
  font-weight: 500;
  padding: 0.5rem 1rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  border-radius: 4px;
}

.nav .dropdown-toggle.active {
  color: white;
  background-color: var(--brand);
  font-weight: 600;
}

.nav .dropdown-toggle.active::after {
  display: none;
}

.nav .dropdown-toggle::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--brand) 0%, var(--brand) 60%, transparent 60%, transparent 70%, var(--brand) 70%, var(--brand) 80%, transparent 80%, transparent 90%, var(--brand) 90%, var(--brand) 100%);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

@media (min-width: 769px) {
  .nav .dropdown-toggle:hover {
    color: var(--accent);
    transform: translateY(-1px);
  }

  .nav .dropdown-toggle:hover::after {
    width: calc(100% - 2rem);
  }

  .nav .dropdown:hover .dropdown-toggle::after {
    background: linear-gradient(90deg, var(--accent) 0%, var(--accent) 60%, transparent 60%, transparent 70%, var(--accent) 70%, var(--accent) 80%, transparent 80%, transparent 90%, var(--accent) 90%, var(--accent) 100%);
  }
}

.nav .dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  box-shadow: var(--shadow-md);
  border-radius: 8px;
  padding: 8px 0;
  padding-top: 12px;
  min-width: 200px;
  margin-top: 0;
  z-index: 1000;
}

.nav .dropdown-menu::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background: transparent;
}

/* Desktop hover - only on larger screens */
@media (min-width: 769px) {
  .nav .dropdown:hover .dropdown-menu {
    display: block;
  }
}

.dropdown-menu a {
  display: block;
  padding: 10px 20px;
  color: var(--brand);
  text-decoration: none;
  transition: background 0.2s;
  font-weight: 500;
}

.dropdown-menu a:hover {
  background: var(--muted);
  color: var(--accent);
}

.dropdown-menu a::after {
  display: none;
}

/* Hamburger Menu Toggle */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  transition: all 0.3s ease;
  z-index: 1001;
}

.menu-toggle span {
  height: 3px;
  width: 25px;
  background: var(--brand);
  margin: 4px 0;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Main Content */
.main-content {
  margin-top: 90px;
  padding: 40px 0 60px;
  min-height: calc(100vh - 200px);
}

/* Page Header */
.page-header {
  text-align: center;
  margin-bottom: 60px;
  padding-top: 20px;
}

.page-header h1 {
  font-size: 48px;
  font-weight: 800;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.subtitle {
  font-size: 20px;
  color: rgba(27, 43, 80, 0.7);
  margin-bottom: 32px;
}

.warning-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-radius: 12px;
  padding: 20px;
  max-width: 800px;
  margin: 32px auto 0 auto;
}

.warning-box svg {
  flex-shrink: 0;
  color: var(--warning);
  margin-top: 2px;
}

.warning-box p {
  text-align: left;
  font-size: 14px;
  color: #856404;
}

/* Sections */
.section {
  margin-bottom: 80px;
}

.section h2 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 32px;
  color: var(--brand);
}

/* Button Grid */
.button-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.helper-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 16px;
  background: white;
  border: 2px solid rgba(27, 43, 80, 0.1);
  border-radius: 16px;
  text-decoration: none;
  color: var(--brand);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  min-height: 140px;
}

.helper-btn:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
  background: linear-gradient(135deg, #fafafa 0%, #ffffff 100%);
}

.helper-btn:active {
  transform: translateY(-2px);
}

.btn-icon {
  font-size: 40px;
  line-height: 1;
}

.btn-text {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
}

.code-btn {
  background: linear-gradient(135deg, #e3f2fd 0%, #ffffff 100%);
}

/* Link List */
.link-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px 24px;
  background: white;
  border: 2px solid rgba(27, 43, 80, 0.1);
  border-radius: 12px;
  text-decoration: none;
  color: var(--brand);
  transition: all 0.3s;
  box-shadow: var(--shadow-sm);
}

.link-item:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-md);
  transform: translateX(4px);
}

.link-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.link-text {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.link-arrow {
  font-size: 24px;
  color: rgba(27, 43, 80, 0.4);
  transition: transform 0.3s;
}

.link-item:hover .link-arrow {
  transform: translateX(4px);
  color: var(--brand);
}

/* Download Grid */
.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.download-card {
  background: white;
  border: 2px solid rgba(27, 43, 80, 0.1);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s;
}

.download-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(27, 43, 80, 0.2);
}

.download-card h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brand);
}

.download-card p {
  font-size: 14px;
  color: rgba(27, 43, 80, 0.6);
  margin-bottom: 20px;
  line-height: 1.5;
}

.download-links {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 32px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
  border: 2px solid transparent;
  min-width: 140px;
  background: #4CAF50;
  color: white;
}

.download-btn.primary {
  background: #4CAF50;
  color: white;
  border-color: #4CAF50;
}

.download-btn.primary:hover {
  background: #45a049;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 175, 80, 0.4);
}

.download-btn.secondary {
  background: transparent;
  color: var(--brand);
  border-color: rgba(27, 43, 80, 0.2);
}

.download-btn.secondary:hover {
  background: var(--muted);
  border-color: var(--brand);
}

/* Instructions */
.instructions {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.instruction-step {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  padding: 24px;
  background: white;
  border: 2px solid rgba(27, 43, 80, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.step-number {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  font-size: 24px;
  font-weight: 700;
  border-radius: 12px;
}

.step-content h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--brand);
}

.step-content p {
  font-size: 15px;
  color: rgba(27, 43, 80, 0.7);
  line-height: 1.6;
}

.step-content a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid var(--brand);
  transition: opacity 0.2s;
}

.step-content a:hover {
  opacity: 0.7;
}

/* Footer */
.footer {
  background: var(--brand);
  color: #fff;
  padding: 40px 0 20px;
  margin-top: 60px;
}

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

.footer-section h4 {
  margin-bottom: 15px;
  font-size: 18px;
  color: #fff;
}

.footer-section a, .footer-section a:visited {
  display: block;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  margin-bottom: 8px;
  transition: color 0.2s ease;
}

.footer-section a:hover {
  color: #fff;
  text-decoration: underline;
}

.footer-bottom {
  text-align: center;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
}

.footer .footer-section {
  text-align: left;
}


/* Responsive Design */
@media (max-width: 992px) {
  .page-header h1 {
    font-size: 40px;
  }

  .button-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }

  .download-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-direction: row;
    justify-content: space-between;
  }

  .menu-toggle {
    display: flex;
  }

  .nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    padding: 80px 32px 32px;
    gap: 24px;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.1);
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .nav.active {
    right: 0;
  }

  .nav a {
    font-size: 18px;
    padding: 12px 16px;
    border-radius: 8px;
    text-align: left;
  }

  .nav a:hover {
    background: var(--muted);
  }

  .nav a::after {
    display: none;
  }

  /* Mobile dropdown styles */
  .nav .dropdown {
    display: block;
    width: 100%;
  }

  .nav .dropdown-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border-radius: 8px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s ease;
  }

  .nav .dropdown-toggle:hover {
    background: var(--muted);
  }

  .nav .dropdown-toggle::after {
    content: '▼';
    position: static;
    width: auto;
    height: auto;
    background: none;
    transform: translateY(0) rotate(0deg);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 10px;
    opacity: 0.6;
    margin-left: 8px;
  }

  .nav .dropdown.mobile-expanded .dropdown-toggle::after {
    transform: rotate(180deg);
    opacity: 1;
  }

  .nav .dropdown-toggle:hover::after {
    width: auto;
  }

  /* Disable desktop hover on mobile - IMPORTANT */
  .nav .dropdown:hover .dropdown-menu {
    display: none !important;
  }

  .nav .dropdown {
    position: relative;
  }

  .nav .dropdown-toggle {
    background: none;
    border: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 8px 16px;
    display: inline-block;
  }

  .nav .dropdown-menu {
    position: static;
    box-shadow: none;
    background: transparent;
    padding: 0;
    margin: 0;
    min-width: auto;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
    list-style: none;
  }

  .nav .dropdown.mobile-expanded .dropdown-menu {
    max-height: 300px;
    margin-top: 8px;
  }

  .nav .dropdown-menu a {
    padding: 10px 16px 10px 32px;
    font-size: 16px;
    border-radius: 8px;
    display: block;
    opacity: 1;
    transform: translateY(0);
    transition: background-color 0.2s ease, transform 0.2s ease;
  }

  .nav .dropdown-menu a:hover {
    transform: translateX(4px);
    background: var(--muted);
  }

  .main-content {
    margin-top: 90px;
    padding: 24px 0 40px;
  }

  .page-header h1 {
    font-size: 32px;
  }

  .subtitle {
    font-size: 16px;
  }

  .section h2 {
    font-size: 26px;
  }

  .button-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }

  .helper-btn {
    padding: 20px 12px;
    min-height: 120px;
  }

  .btn-icon {
    font-size: 32px;
  }

  .btn-text {
    font-size: 13px;
  }

  .download-grid {
    grid-template-columns: 1fr;
  }

  .download-links {
    flex-direction: column;
  }

  .instruction-step {
    flex-direction: column;
    gap: 16px;
  }

  .step-number {
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .page-header h1 {
    font-size: 28px;
  }

  .warning-box {
    flex-direction: column;
    gap: 12px;
  }

  .button-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .logo span {
    font-size: 16px;
  }

  .logo svg {
    width: 32px;
    height: 32px;
  }
}

/* Print Styles */
@media print {
  .header,
  .footer {
    display: none;
  }

  .main-content {
    margin-top: 0;
  }

  .helper-btn,
  .download-btn {
    border: 1px solid #ccc;
  }
}

/* Additional Styles for What is FRP and Tools Pages */

/* Ad Container */
.ad-container {
  margin: 32px 0;
  min-height: 100px;
  width: 100%;
  max-width: 100%;
  display: block;
  background-color: var(--muted);
  border-radius: 12px;
  padding: 16px;
  overflow: hidden;
}

.ad-container .adsbygoogle {
  display: block;
  width: 100%;
  min-height: 90px;
}

/* Active nav link */
.nav a.active {
  background-color: var(--brand);
  color: white;
}

.nav a.active::after {
  display: none;
}

/* Info Grid */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.info-item {
  padding: 24px;
  background-color: var(--muted);
  border-radius: 12px;
  text-align: center;
}

.info-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.info-item h3 {
  color: var(--brand);
  margin-bottom: 12px;
  font-size: 18px;
}

.info-item p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Feature List */
.feature-list {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 24px;
}

.feature-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background-color: var(--muted);
  border-radius: 12px;
  align-items: flex-start;
}

.feature-item svg {
  flex-shrink: 0;
  color: var(--accent);
  margin-top: 4px;
}

.feature-item h3 {
  margin-bottom: 8px;
  color: var(--brand);
  font-size: 16px;
}

.feature-item p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Scenario Grid */
.scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.scenario-card {
  padding: 24px;
  background-color: var(--muted);
  border-radius: 12px;
  border-left: 4px solid var(--brand);
}

.scenario-card h3 {
  color: var(--brand);
  margin-bottom: 12px;
  font-size: 16px;
}

.scenario-card p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Step List */
.step-list {
  list-style: none;
  counter-reset: step-counter;
  margin-top: 24px;
}

.step-list li {
  counter-increment: step-counter;
  position: relative;
  padding-left: 60px;
  margin-bottom: 24px;
}

.step-list li::before {
  content: counter(step-counter);
  position: absolute;
  left: 0;
  top: 0;
  width: 40px;
  height: 40px;
  background-color: var(--brand);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
}

.step-list li strong {
  display: block;
  color: var(--brand);
  margin-bottom: 8px;
  font-size: 16px;
}

.step-list li p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

/* Scenario Detailed */
.scenario-list {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.scenario-detailed {
  padding: 24px;
  background-color: var(--muted);
  border-radius: 12px;
  border-left: 4px solid var(--warning);
}

.scenario-detailed h3 {
  color: var(--brand);
  margin-bottom: 12px;
  font-size: 18px;
}

.scenario-detailed p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.scenario-detailed p:last-child {
  margin-bottom: 0;
}

.scenario-detailed strong {
  color: var(--brand);
}

.scenario-detailed a {
  color: var(--brand);
  text-decoration: underline;
}

/* CTA Card */
.cta-card {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  text-align: center;
  padding: 40px 32px;
}

.cta-card h2,
.cta-card p {
  color: white;
}

.cta-card h2 {
  margin-bottom: 16px;
}

.cta-card p {
  margin-bottom: 0;
}

.cta-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  white-space: nowrap;
}

.btn-primary {
  background-color: white;
  color: var(--brand);
}

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

.btn-secondary {
  background-color: transparent;
  color: white;
  border-color: white;
}

.btn-secondary:hover {
  background-color: white;
  color: var(--brand);
}

.btn svg {
  flex-shrink: 0;
}

/* Tool Cards */
.tool-card {
  background-color: white;
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  transition: all 0.3s ease;
}

.tool-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.tool-card.featured {
  border: 3px solid var(--accent);
}

.tool-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  padding: 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
}

.tool-title-section h2 {
  color: white;
  margin-bottom: 12px;
  font-size: 24px;
}

.tool-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  display: inline-block;
}

.badge-popular {
  background-color: var(--accent);
  color: white;
}

.badge-professional {
  background-color: var(--brand-light);
  color: white;
}

.badge-samsung {
  background-color: #1428a0;
  color: white;
}

.badge-versatile {
  background-color: var(--warning);
  color: white;
}

.badge-rating {
  background-color: white;
  color: var(--brand);
}

.tool-price {
  background-color: rgba(255, 255, 255, 0.2);
  padding: 12px 20px;
  border-radius: 8px;
}

.price-tag {
  font-size: 20px;
  font-weight: 700;
  color: white;
}

.tool-content {
  padding: 32px;
}

.tool-description {
  font-size: 16px;
  line-height: 1.8;
  color: #333;
  margin-bottom: 24px;
}

.tool-features {
  margin: 32px 0;
}

.tool-features h3 {
  color: var(--brand);
  margin-bottom: 16px;
  font-size: 18px;
}

.tool-features ul {
  list-style: none;
  padding: 0;
}

.tool-features li {
  padding: 12px 0;
  padding-left: 28px;
  position: relative;
  border-bottom: 1px solid #eee;
  color: #666;
  line-height: 1.6;
}

.tool-features li:last-child {
  border-bottom: none;
}

.tool-features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
  font-size: 18px;
}

.tool-features li strong {
  color: var(--brand);
}

.tool-pros-cons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.pros,
.cons {
  padding: 24px;
  border-radius: 12px;
}

.pros {
  background-color: #e8f5e9;
  border-left: 4px solid var(--accent);
}

.cons {
  background-color: #fff3e0;
  border-left: 4px solid var(--warning);
}

.pros h3,
.cons h3 {
  margin-bottom: 16px;
  font-size: 18px;
}

.pros h3 {
  color: var(--accent);
}

.cons h3 {
  color: var(--warning);
}

.pros ul,
.cons ul {
  list-style: none;
  padding: 0;
}

.pros li,
.cons li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
  color: #666;
  line-height: 1.6;
}

.pros li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-weight: 700;
}

.cons li::before {
  content: "✗";
  position: absolute;
  left: 0;
  color: var(--warning);
  font-weight: 700;
}

.tool-verdict {
  margin-top: 32px;
  padding: 24px;
  background-color: var(--muted);
  border-radius: 12px;
  border-left: 4px solid var(--brand);
}

.tool-verdict h3 {
  color: var(--brand);
  margin-bottom: 16px;
  font-size: 18px;
}

.tool-verdict p {
  color: #666;
  line-height: 1.8;
  margin-bottom: 12px;
}

.tool-verdict p:last-child {
  margin-bottom: 0;
}

.tool-verdict strong {
  color: var(--brand);
}

/* Free Methods Grid */
.free-methods-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.free-method-card {
  padding: 24px;
  background-color: var(--muted);
  border-radius: 12px;
  border-top: 4px solid var(--accent);
}

.free-method-card h3 {
  color: var(--brand);
  margin-bottom: 12px;
  font-size: 16px;
}

.free-method-card p {
  color: #666;
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 12px;
}

.free-method-card p:last-child {
  margin-bottom: 0;
}

.free-method-card strong {
  color: var(--brand);
}

/* Comparison Table */
.comparison-table-wrapper {
  overflow-x: auto;
  margin-top: 24px;
}

.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background-color: white;
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  overflow: hidden;
}

.comparison-table thead {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
}

.comparison-table th {
  padding: 16px;
  text-align: left;
  font-weight: 600;
  font-size: 14px;
}

.comparison-table td {
  padding: 16px;
  border-bottom: 1px solid #eee;
  color: #666;
  font-size: 14px;
}

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

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

.comparison-table strong {
  color: var(--brand);
}

/* Buying Guide */
.buying-guide {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-top: 24px;
}

.guide-section {
  padding: 24px;
  background-color: var(--muted);
  border-radius: 12px;
  border-left: 4px solid var(--brand);
}

.guide-section h3 {
  color: var(--brand);
  margin-bottom: 16px;
  font-size: 18px;
}

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

.guide-section li {
  padding: 8px 0;
  padding-left: 28px;
  position: relative;
  color: #666;
  line-height: 1.6;
}

.guide-section li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--brand);
  font-weight: 700;
}

.guide-section strong {
  color: var(--brand);
}

/* Responsive adjustments for new elements */
@media (max-width: 768px) {
  .tool-header {
    flex-direction: column;
  }
  
  .tool-content {
    padding: 20px;
  }
  
  .tool-pros-cons {
    grid-template-columns: 1fr;
  }
  
  .comparison-table {
    font-size: 12px;
  }
  
  .comparison-table th,
  .comparison-table td {
    padding: 12px 8px;
  }
  
  .cta-card {
    padding: 32px 24px;
  }
  
  .cta-buttons {
    flex-direction: column;
  }
  
  .btn {
    width: 100%;
    justify-content: center;
  }
  
  .step-list li {
    padding-left: 50px;
  }
  
  .step-list li::before {
    width: 35px;
    height: 35px;
    font-size: 16px;
  }
}

/* ==================================
   Blog Page Styles
   ================================== */

.blog-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 0;
}

.blog-article {
  background-color: var(--bg);
  border: 1px solid rgba(27, 43, 80, 0.1);
  border-radius: 16px;
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

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

.article-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.article-date {
  color: #666;
  font-size: 14px;
  font-weight: 500;
}

.article-category {
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.article-title {
  color: var(--brand);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 16px;
}

.article-excerpt {
  color: #555;
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 20px;
}

.article-excerpt p {
  margin: 0;
}

.article-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.read-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.read-more-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: linear-gradient(135deg, var(--brand-light), var(--brand));
}

.read-more-btn.active {
  background: var(--accent);
}

.read-more-btn.active:hover {
  background: var(--accent-hover);
}

/* Article Share Buttons */
.article-share {
  display: flex;
  gap: 8px;
}

.article-share a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  background: rgba(27, 43, 80, 0.1);
  color: var(--brand);
  text-decoration: none;
  font-size: 16px;
  transition: all 0.3s ease;
}

.article-share a:hover {
  background: var(--brand);
  color: white;
  transform: scale(1.08);
}

/* Individual Article Page Styles */
.back-to-blog {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: rgba(27, 43, 80, 0.1);
  color: var(--brand);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.back-to-blog:hover {
  background: var(--brand);
  color: white;
  transform: translateX(-4px);
}

.blog-article-full {
  background: white;
  border-radius: 12px;
  padding: 40px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.blog-article-full .article-title {
  font-size: 2.5em;
  line-height: 1.2;
  margin-bottom: 24px;
  color: var(--brand);
}

.blog-article-full .article-content {
  font-size: 1.1em;
  line-height: 1.8;
  color: #333;
}

.blog-article-full .article-content a:not(.cta-button):not(.share-btn) {
  color: var(--brand);
  text-decoration: none;
}

.blog-article-full .article-content a:not(.cta-button):not(.share-btn):hover {
  text-decoration: underline;
}

.blog-article-full .lead-paragraph {
  font-size: 1.2em;
  font-weight: 500;
  color: #555;
  margin-bottom: 32px;
  padding-left: 20px;
  border-left: 4px solid var(--brand);
}

.blog-article-full h2 {
  font-size: 1.8em;
  margin-top: 40px;
  margin-bottom: 16px;
  color: var(--brand);
}

.blog-article-full h3 {
  font-size: 1.4em;
  margin-top: 32px;
  margin-bottom: 12px;
  color: var(--brand-light);
}

.blog-article-full ul, .blog-article-full ol {
  margin: 20px 0;
  padding-left: 40px;
}

.blog-article-full li {
  margin-bottom: 12px;
  line-height: 1.7;
}

.blog-article-full .conclusion-text {
  font-size: 1.15em;
  font-weight: 600;
  color: var(--brand);
  margin-top: 32px;
  padding: 20px;
  background: rgba(27, 43, 80, 0.05);
  border-left: 4px solid var(--brand);
  border-radius: 4px;
}

/* Affiliate CTA Button */
.affiliate-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-light) 100%);
  color: white;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 15px;
  box-shadow: 0 4px 12px rgba(27, 43, 80, 0.2);
  transition: all 0.3s ease;
}

.affiliate-btn,
.affiliate-btn:visited,
.affiliate-btn:hover,
.affiliate-btn:focus {
  color: white !important;
}

.affiliate-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(27, 43, 80, 0.35);
}

/* Promo Box */
.promo-box {
  margin: 40px 0;
  padding: 32px;
  background: linear-gradient(135deg, #1b2b50 0%, #2c4a8c 100%);
  color: white;
  border-radius: 12px;
  text-align: center;
  box-shadow: 0 8px 16px rgba(27, 43, 80, 0.3);
}

.promo-box h3 {
  font-size: 1.8em;
  margin-bottom: 16px;
  color: white;
}

.promo-box p {
  font-size: 1.1em;
  margin-bottom: 24px;
  color: rgba(255, 255, 255, 0.95);
}

.promo-box .cta-button {
  display: inline-block;
  padding: 14px 32px;
  background: white;
  color: var(--brand);
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1em;
  border-radius: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.promo-box .cta-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* Article Share Buttons (Bottom of Article) */
.article-share-bottom {
  margin-top: 60px;
  padding-top: 40px;
  border-top: 2px solid #e0e0e0;
}

.article-share-bottom h3 {
  font-size: 1.3em;
  margin-bottom: 20px;
  color: var(--brand);
}

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

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.95em;
  transition: all 0.3s ease;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

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

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

.share-btn.twitter {
  background: #000000;
  color: white;
}

.share-btn.linkedin {
  background: #0a66c2;
  color: white;
}

.share-btn.whatsapp {
  background: #25d366;
  color: white;
}

.share-btn.telegram {
  background: #0088cc;
  color: white;
}

/* Responsive Styles for Article Pages */
@media (max-width: 768px) {
  .blog-article-full {
    padding: 24px;
  }
  
  .blog-article-full .article-title {
    font-size: 1.8em;
  }
  
  .blog-article-full .article-content {
    font-size: 1em;
  }
  
  .share-buttons {
    flex-direction: column;
  }
  
  .share-btn {
    width: 100%;
    justify-content: center;
  }
  
  .promo-box {
    padding: 24px;
  }
}


.btn-icon {
  font-size: 12px;
  transition: transform 0.3s ease;
}

.read-more-btn:hover .btn-icon {
  transform: translateY(2px);
}

.read-more-btn.active:hover .btn-icon {
  transform: translateY(-2px);
}

.article-divider {
  border: none;
  border-top: 2px solid rgba(27, 43, 80, 0.1);
  margin: 24px 0;
}

.article-full-content {
  animation: slideDown 0.3s ease-out;
}

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

.full-text {
  color: var(--brand);
  line-height: 1.8;
}

.full-text h3 {
  color: var(--brand);
  font-size: 22px;
  font-weight: 700;
  margin: 24px 0 12px 0;
}

.full-text h3:first-child {
  margin-top: 0;
}

.full-text p {
  margin-bottom: 16px;
  color: #444;
}

.full-text ul,
.full-text ol {
  margin: 16px 0;
  padding-left: 24px;
}

.full-text li {
  margin-bottom: 12px;
  color: #444;
}

.full-text strong {
  color: var(--brand);
  font-weight: 600;
}

.full-text em {
  color: #666;
  font-style: italic;
}

.alert-box {
  background: #fff3cd;
  border-left: 4px solid var(--warning);
  padding: 16px 20px;
  border-radius: 8px;
  margin: 24px 0;
}

.alert-box strong {
  color: var(--warning);
}

.conclusion-text {
  margin-top: 24px;
  padding: 16px;
  background: var(--muted);
  border-radius: 8px;
  font-style: italic;
  color: #555;
}

/* Blog Pagination */
.blog-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin: 40px 0 60px 0;
}

.pagination-btn {
  background: white;
  border: 2px solid rgba(27, 43, 80, 0.2);
  color: var(--brand);
  width: 45px;
  height: 45px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.pagination-btn:hover:not(:disabled) {
  background: var(--brand);
  color: white;
  border-color: var(--brand);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.pagination-btn.active {
  background: linear-gradient(135deg, var(--brand), var(--brand-light));
  color: white;
  border-color: var(--brand);
}

.pagination-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Responsive Blog Styles */
@media (max-width: 768px) {
  .blog-article {
    padding: 24px 20px;
    margin-bottom: 24px;
  }

  .article-title {
    font-size: 22px;
  }

  .article-excerpt {
    font-size: 15px;
  }

  .full-text h3 {
    font-size: 20px;
  }

  .read-more-btn {
    width: 100%;
    justify-content: center;
  }

  .article-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

@media (max-width: 480px) {
  .blog-article {
    padding: 20px 16px;
  }

  .article-title {
    font-size: 20px;
  }

  .full-text h3 {
    font-size: 18px;
  }

  .pagination-btn {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
}

/* ==================================
   Scroll to Top Button
   ================================== */

.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 48px;
  height: 48px;
  background: white;
  color: var(--brand);
  border: 1px solid rgba(27, 43, 80, 0.12);
  border-radius: 12px;
  cursor: pointer;
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 12px rgba(27, 43, 80, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
}

.scroll-to-top svg {
  display: block;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top:hover {
  background: var(--muted);
  border-color: rgba(27, 43, 80, 0.2);
  box-shadow: 0 4px 16px rgba(27, 43, 80, 0.12);
  transform: translateY(-3px);
}

.scroll-to-top:active {
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(27, 43, 80, 0.08);
}

@media (max-width: 768px) {
  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 44px;
    height: 44px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scroll-to-top {
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }
  
  .scroll-to-top:hover {
    transform: none;
  }
}


/* Web Tools Page Styles */
.connection-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  background: white;
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(27, 43, 80, 0.08);
  margin-bottom: 20px;
}

.connection-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: rgba(27, 43, 80, 0.03);
  border-radius: 8px;
  border: 1px solid rgba(27, 43, 80, 0.06);
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  position: relative;
}

.status-indicator.online {
  background: #4CAF50;
  box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
  animation: pulse 2s infinite;
}

.status-indicator.offline {
  background: #9e9e9e;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
  }
  50% {
    box-shadow: 0 0 0 6px rgba(76, 175, 80, 0.1);
  }
}

.status-text {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}

.connect-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  background: linear-gradient(135deg, rgba(27, 43, 80, 0.95) 0%, rgba(44, 74, 140, 0.95) 100%);
  color: white;
  border: 1px solid rgba(27, 43, 80, 0.1);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 6px rgba(27, 43, 80, 0.15);
}

.connect-btn:hover {
  background: linear-gradient(135deg, rgba(66, 153, 225, 0.95) 0%, rgba(49, 130, 206, 0.95) 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(66, 153, 225, 0.3);
  border-color: rgba(66, 153, 225, 0.3);
}

.connect-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 6px rgba(27, 43, 80, 0.15);
}

.connect-btn:disabled {
  background: linear-gradient(135deg, rgba(158, 158, 158, 0.3) 0%, rgba(189, 189, 189, 0.3) 100%);
  color: rgba(27, 43, 80, 0.4);
  transform: none;
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

/* Connect button variants */
.connect-btn.serial {
  background: linear-gradient(135deg, rgba(34, 197, 94, 0.95) 0%, rgba(22, 163, 74, 0.95) 100%);
}

.connect-btn.serial:hover {
  background: linear-gradient(135deg, rgba(34, 197, 94, 1) 0%, rgba(22, 163, 74, 1) 100%);
  box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
  border-color: rgba(34, 197, 94, 0.3);
}

.connect-btn.disconnect {
  background: linear-gradient(135deg, rgba(220, 38, 38, 0.95) 0%, rgba(185, 28, 28, 0.95) 100%);
}

.connect-btn.disconnect:hover {
  background: linear-gradient(135deg, rgba(220, 38, 38, 1) 0%, rgba(185, 28, 28, 1) 100%);
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
  border-color: rgba(220, 38, 38, 0.3);
}

/* Tool Cards & Grid */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.tool-card {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.tool-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.tool-btn-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  background: white;
  transition: all 0.3s ease;
}

.tool-btn-card:hover:not(:disabled) {
  border-color: var(--brand);
  background: var(--muted);
}

.tool-btn-card.danger:hover:not(:disabled) {
  border-color: #f44336;
  background: #ffebee;
}

.tool-btn-card:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.tool-icon {
  font-size: 40px;
}

.tool-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
}

.tool-desc {
  font-size: 13px;
  color: rgba(27, 43, 80, 0.6);
}

/* Device Info Grid */
.device-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.info-label {
  font-size: 12px;
  font-weight: 600;
  color: rgba(27, 43, 80, 0.6);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  font-size: 16px;
  font-weight: 600;
  color: var(--brand);
}

/* Tool Buttons */
.tool-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--brand);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
}

.tool-btn:hover {
  background: var(--brand-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.tool-btn.secondary {
  background: #757575;
}

.tool-btn.secondary:hover {
  background: #616161;
}

/* Console Log */
.console-log {
  background: #1e1e1e;
  border-radius: 8px;
  padding: 16px;
  max-height: 300px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  margin-bottom: 16px;
}

.log-entry {
  padding: 6px 0;
  font-size: 13px;
  line-height: 1.6;
}

.log-entry.info {
  color: #4fc3f7;
}

.log-entry.success {
  color: #66bb6a;
}

.log-entry.warning {
  color: #ffb74d;
}

.log-entry.error {
  color: #ef5350;
}

.log-time {
  color: #757575;
  margin-right: 8px;
}

/* Info Box Enhancement */
.info-box ul, .info-box ol {
  color: rgba(27, 43, 80, 0.8);
}

.info-box li {
  margin-bottom: 8px;
}

/* Web Tools: Software-style Layout */
.tools-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  margin: 30px 0;
}

/* Web Tools: console should scroll with page */
.web-tools-page .console-sticky-wrapper,
.web-tools-page .console-panel {
  position: static !important;
  top: auto !important;
}

.tools-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.tools-panel .section {
  padding: 16px;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}

.tools-panel .section h3 {
  margin: 0 0 12px 0;
  font-size: 16px;
  color: var(--brand);
  font-weight: 600;
}

/* Compact Tools Grid */
.tools-grid-compact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

/* Smaller Tool Buttons */
.tool-btn-small {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 12px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: white;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 12px;
  border: 1px solid #e0e0e0;
}

.tool-btn-small:hover:not(:disabled) {
  border-color: var(--brand);
  background: #f5f7ff;
  transform: translateY(-2px);
}

.tool-btn-small:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
}

.tool-btn-small.danger:hover:not(:disabled) {
  border-color: #f44336;
  background: #ffebee;
}

.tool-btn-small .tool-icon {
  font-size: 24px;
  line-height: 1;
}

.tool-btn-small .tool-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  line-height: 1.2;
}

/* ADB screen preview scaling */
.adb-screen-image {
  width: 40%;
  max-width: 460px;
  height: auto;
  display: block;
  margin: 0 auto;
}

/* ADB File Manager: keep Open/Up/Refresh on one row */
.adb-path-row {
  display: grid;
  grid-template-columns: 1fr auto auto auto;
  gap: 8px;
  align-items: center;
}

.adb-path-row .tool-btn-small {
  min-width: 80px;
  padding: 10px 8px;
}

@media (max-width: 640px) {
  .adb-path-row {
    grid-template-columns: 1fr;
  }

  .adb-path-row .tool-btn-small {
    width: 100%;
  }
}

/* Console Panel */
.console-panel {
  display: flex;
  flex-direction: column;
  background: white;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  height: fit-content;
  max-height: 600px;
  position: static;
  top: auto;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.console-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
}

.console-header button {
  padding: 4px 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.2s ease;
}

.console-header button:hover {
  color: var(--brand);
}

.console-log {
  flex: 1;
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 12px;
  font-family: 'Monaco', 'Menlo', monospace;
  font-size: 12px;
  overflow-y: auto;
  max-height: 500px;
}

.console-log .log-entry {
  line-height: 1.5;
  margin-bottom: 4px;
  word-break: break-word;
}

.console-log .log-entry.info {
  color: #4fc3f7;
}

.console-log .log-entry.success {
  color: #66bb6a;
}

.console-log .log-entry.warning {
  color: #ffb74d;
}

.console-log .log-entry.error {
  color: #ef5350;
}

/* Compact Device Info */
.device-info-compact {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.info-item-compact {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.info-item-compact .info-label {
  font-size: 11px;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
}

.info-item-compact .info-value {
  font-size: 13px;
  color: var(--brand);
  font-weight: 500;
}

.tool-btn-compact {
  width: 100%;
  padding: 8px 12px;
  background: var(--brand-light);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-weight: 600;
}

.tool-btn-compact:hover {
  background: var(--brand);
  transform: translateY(-1px);
}

/* Responsive */
@media (max-width: 1024px) {
  .tools-layout {
    grid-template-columns: 1fr;
  }

  .console-panel {
    max-height: 400px;
  }

  .console-log {
    max-height: 350px;
  }
}

/* Connection buttons wrapper */
.connection-buttons-wrapper {
  display: flex;
  gap: 16px;
  align-items: center;
}

.buttons-group {
  display: flex;
  gap: 10px;
  flex-shrink: 0;
}

.connection-info-box {
  flex: 1;
  padding: 14px 16px;
  background: rgba(27, 43, 80, 0.04);
  border: 1px solid rgba(27, 43, 80, 0.08);
  border-radius: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(27, 43, 80, 0.85);
}

.connection-info-box strong {
  color: var(--brand);
  font-weight: 600;
}

@media (max-width: 768px) {
  .connection-buttons-wrapper {
    flex-direction: column;
    gap: 12px;
  }
  
  .buttons-group {
    flex-direction: column;
    width: 100%;
    gap: 8px;
  }
  
  .connect-btn {
    width: 100%;
  }
  
  .connection-info-box {
    width: 100%;
  }

  .tools-layout {
    grid-template-columns: 1fr;
  }

  .tools-grid-compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .connection-panel {
    flex-direction: column;
    text-align: center;
  }
  
  /* Mobile connection buttons */
  .section > div[style*="display: flex; gap: 16px"] {
    flex-direction: column !important;
    gap: 12px !important;
  }
  
  .section > div[style*="display: flex; gap: 16px"] > div[style*="flex-shrink"] {
    flex-direction: column !important;
    width: 100% !important;
  }
  
  .section > div[style*="display: flex; gap: 16px"] > div[style*="flex: 1"] {
    flex: 1 !important;
  }
  
  .connect-btn {
    width: 100% !important;
  }
  
  .tool-grid {
    grid-template-columns: 1fr;
  }
  
  .device-info-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile viewport fix - prevent any horizontal overflow */
@media (max-width: 768px) {
  html, body {
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }
  
  .container,
  .main-content,
  .section,
  .header,
  .footer,
  .page-header {
    max-width: 100% !important;
    box-sizing: border-box !important;
  }
  
  /* Force AdSense to stay within bounds */
  ins.adsbygoogle,
  .adsbygoogle,
  ins,
  iframe[src*="google"] {
    max-width: calc(100vw - 24px) !important;
    width: 100% !important;
    overflow: hidden !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}
