/* Base Styles */
:root {
  --primary: #8B5CF6;
  --primary-dark: #7C3AED;
  --secondary: #10B981;
  --secondary-dark: #059669;
  --danger: #EF4444;
  --danger-dark: #DC2626;
  --gray-dark: #333333;
  --gray: #6B7280;
  --gray-light: #E5E7EB;
  --white: #FFFFFF;
  --black: #000000;
  --card-bg: #F9FAFB;
  --card-shadow: rgba(0, 0, 0, 0.1);
  --success: #10B981;
  --success-dark: #059669;
  --warning: #F59E0B;
  --warning-dark: #D97706;
  --error: #EF4444;
  --info: #3B82F6;
  --background: #f0f4f8;
  --text: #333333;
  --border-radius: 8px;
  --transition-speed: 0.3s;
}

/* Dark Mode Colors */
html[data-theme="dark"] {
  --primary: #9D70FD;
  --primary-dark: #8555FF;
  --secondary: #34D399;
  --secondary-dark: #10B981;
  --gray-dark: #E5E7EB;
  --gray: #9DA3AF;
  --gray-light: #374151;
  --card-bg: #1F2937;
  --card-shadow: rgba(0, 0, 0, 0.3);
  --background: #111827;
  --text: #F9FAFB;
  --white: #111827;
  --black: #F9FAFB;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Poppins', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background-color: var(--background);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  transition: background-color var(--transition-speed), color var(--transition-speed);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* Theme Toggle */
.theme-toggle {
  position: fixed;
  top: 15px;
  right: 15px;
  z-index: 100;
  transition: all var(--transition-speed);
}

.btn:focus-visible,
.brand-name:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--info);
  outline-offset: 3px;
}

.seo-intro {
  margin-bottom: 24px;
}

.seo-intro .card-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.25;
}

.seo-cta-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.btn.seo-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  font-size: 14px;
  text-decoration: none;
}

.card .seo-cta {
  color: #FFFFFF;
}

.seo-learning {
  margin-top: 24px;
}

.seo-learning h2,
.seo-learning h3 {
  margin: 18px 0 10px;
}

.tab-content,
.tool-card [id] {
  scroll-margin-top: 90px;
}

.fixed-toggle {
  position: fixed;
}

.toggle-visible {
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px var(--card-shadow);
  border-radius: 50%;
}

.theme-toggle button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background-color: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(4px);
  transition: all var(--transition-speed);
}

.theme-toggle button:hover {
  transform: scale(1.1);
  background-color: rgba(255, 255, 255, 0.3);
}

html[data-theme="light"] .dark-icon,
html[data-theme="dark"] .light-icon {
  display: none;
}

/* Login Page Styles */
.login-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
  position: relative;
  overflow: hidden;
}

/* Engine background for login page */
.engine-background {
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.gear {
  position: absolute;
  border-radius: 50%;
  border: 15px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.gear:before,
.gear:after {
  content: '';
  position: absolute;
  background: rgba(255, 255, 255, 0.1);
}

.gear:before {
  width: 15px;
  height: 80px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.gear:after {
  width: 80px;
  height: 15px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.gear-1 {
  width: 120px;
  height: 120px;
  top: 20%;
  left: 10%;
  animation: rotate 20s linear infinite;
}

.gear-2 {
  width: 160px;
  height: 160px;
  bottom: 10%;
  right: 20%;
  animation: rotate 25s linear infinite reverse;
}

.gear-3 {
  width: 200px;
  height: 200px;
  top: 60%;
  left: 30%;
  animation: rotate 30s linear infinite;
}

.gear-4 {
  width: 140px;
  height: 140px;
  top: 30%;
  right: 35%;
  animation: rotate 22s linear infinite reverse;
}

.piston {
  position: absolute;
  width: 40px;
  height: 120px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.15));
  border-radius: 20px;
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.piston-1 {
  top: 40%;
  right: 15%;
  animation: piston 6s ease-in-out infinite;
}

.piston-2 {
  top: 50%;
  left: 15%;
  animation: piston 6s ease-in-out infinite reverse;
}

.piston-3 {
  bottom: 25%;
  left: 50%;
  animation: piston 5s ease-in-out infinite;
  transform: rotate(45deg);
}

.pipe {
  position: absolute;
  height: 30px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  box-shadow: inset 0 0 10px rgba(255, 255, 255, 0.1);
}

.pipe-1 {
  width: 300px;
  top: 40%;
  left: 20%;
  transform: rotate(30deg);
}

.pipe-2 {
  width: 250px;
  bottom: 30%;
  right: 10%;
  transform: rotate(-20deg);
}

.pipe-3 {
  width: 200px;
  top: 25%;
  left: 40%;
  transform: rotate(-45deg);
  height: 20px;
}

.gauge {
  position: absolute;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  border: 8px solid rgba(255, 255, 255, 0.1);
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 70%);
  box-shadow: 0 0 15px rgba(255, 255, 255, 0.2);
}

.gauge::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 20px;
  background: rgba(255, 255, 255, 0.5);
  top: 50%;
  left: 50%;
  transform-origin: bottom center;
  animation: gauge 10s linear infinite;
}

.gauge-1 {
  top: 15%;
  right: 30%;
}

.gauge-2 {
  bottom: 20%;
  left: 20%;
  animation-delay: -5s;
}

.circuit {
  position: absolute;
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 5px;
}

.circuit-1 {
  width: 200px;
  height: 300px;
  top: 10%;
  left: 15%;
  border-right: none;
  border-bottom: none;
  animation: circuit 4s ease-in-out infinite;
}

.circuit-2 {
  width: 150px;
  height: 150px;
  bottom: 10%;
  right: 10%;
  border-left: none;
  border-top: none;
  animation: circuit 6s ease-in-out infinite reverse;
}

.security-symbol {
  position: absolute;
  font-size: 2rem;
  opacity: 0.5;
  animation: pulse 3s ease-in-out infinite;
}

.symbol-1 {
  top: 25%;
  right: 25%;
  animation-delay: 1s;
}

.symbol-2 {
  bottom: 30%;
  left: 35%;
  animation-delay: 2s;
}

.binary {
  position: absolute;
  color: rgba(255, 255, 255, 0.3);
  font-family: monospace;
  font-size: 1.2rem;
  animation: fade 8s linear infinite;
}

.binary-1 {
  top: 40%;
  left: 10%;
  animation-delay: 1s;
}

.binary-2 {
  bottom: 25%;
  right: 15%;
  animation-delay: 4s;
}

.hacking-effect {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: repeating-linear-gradient(
    0deg,
    rgba(0, 0, 0, 0.1) 0px,
    rgba(0, 0, 0, 0.1) 1px,
    transparent 1px,
    transparent 2px
  );
  opacity: 0.4;
  pointer-events: none;
  animation: scan 10s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes piston {
  0%, 100% { transform: translateY(-15px); }
  50% { transform: translateY(15px); }
}

@keyframes gauge {
  0%, 100% { transform: translate(-50%, -100%) rotate(-45deg); }
  50% { transform: translate(-50%, -100%) rotate(45deg); }
}

@keyframes circuit {
  0%, 100% { box-shadow: 0 0 5px rgba(255, 255, 255, 0.1); }
  50% { box-shadow: 0 0 15px rgba(255, 255, 255, 0.3); }
}

@keyframes pulse {
  0%, 100% { opacity: 0.2; transform: scale(1); }
  50% { opacity: 0.8; transform: scale(1.1); }
}

@keyframes fade {
  0%, 100% { opacity: 0.1; }
  50% { opacity: 0.5; }
}

@keyframes scan {
  0% { background-position: 0 0; }
  100% { background-position: 0 100%; }
}

.login-card {
  background: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 480px;
  padding: 40px;
  margin: 20px;
  position: relative;
  z-index: 2;
  transition: transform 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275), background-color var(--transition-speed), box-shadow var(--transition-speed);
}

.login-header {
  text-align: center;
  margin-bottom: 30px;
}

.login-header h1 {
  color: var(--primary);
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.login-header p {
  color: var(--gray);
  font-size: 1rem;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text);
}

.form-control {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  font-size: 16px;
  transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
  background-color: var(--card-bg);
  color: var(--text);
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.15);
  outline: none;
}

.error-message {
  color: var(--error);
  font-size: 14px;
  margin-top: 5px;
  display: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 9px 16px;
  border: none;
  border-radius: var(--border-radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-align: center;
  line-height: 1.25;
  transition: all var(--transition-speed);
}

.btn-sm {
  min-height: 36px;
  padding: 7px 12px;
  font-size: 13px;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
  background-color: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-danger {
  background-color: var(--danger);
  color: white;
}

.btn-danger:hover {
  background-color: var(--danger-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-block {
  display: block;
  width: 100%;
}

.form-links {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 15px;
}

.forgot-password-container {
  text-align: right;
}

.form-links a {
  color: var(--primary);
  text-decoration: none;
  display: inline-block;
  font-size: 0.9rem;
}

.form-links a:hover {
  text-decoration: underline;
}

.form-switcher {
  text-align: center;
}

.form-switcher a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.form-switcher a:hover {
  text-decoration: underline;
}

.active-form {
  display: block;
}

.hidden-form {
  display: none;
}

.login-footer {
  text-align: center;
  margin-top: 30px;
  color: var(--gray);
  font-size: 0.9rem;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.custom-checkbox {
  width: 20px;
  height: 20px;
  accent-color: var(--primary);
}

/* Password strength styles */
.password-strength {
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
}

.password-strength.hidden {
  display: none;
}

.strength-bar {
  height: 8px;
  background-color: var(--gray-light);
  border-radius: 4px;
  margin-bottom: 8px;
  overflow: hidden;
}

.strength-meter, .strength-fill {
  height: 100%;
  border-radius: 4px;
  width: 0;
  transition: width var(--transition-speed), background-color var(--transition-speed);
}

.strength-feedback {
  list-style-type: none;
  padding-left: 15px;
  font-size: 0.85rem;
  color: var(--gray);
}

.strength-feedback li:before {
  content: "•";
  margin-right: 5px;
}

/* Success Message Animation */
.success-message {
  text-align: center;
  padding: 20px 0;
  animation: fadeIn 0.5s ease-out;
}

.success-icon {
  color: var(--success);
  margin-bottom: 20px;
  animation: scaleIn 0.5s ease-out;
}

@keyframes scaleIn {
  0% { transform: scale(0); }
  70% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

@keyframes fadeIn {
  0% { opacity: 0; }
  100% { opacity: 1; }
}

.shake {
  animation: shake 0.5s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-10px); }
  50% { transform: translateX(10px); }
  75% { transform: translateX(-10px); }
}

/* Dashboard Styles */
.dashboard {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.dashboard-header {
  background-color: var(--white);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  padding: 15px 0;
  position: sticky;
  top: 0;
  z-index: 10;
}

.dashboard-header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand h1,
.brand-name {
  color: var(--primary);
  font-size: 1.8rem;
  margin: 0;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-menu span {
  font-weight: 500;
  color: var(--text);
}

.spacer {
  width: 40px; /* Space for theme toggle */
}

.logout-btn {
  background: none;
  border: 1px solid var(--gray-light);
  color: var(--gray);
  padding: 8px 15px;
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: all var(--transition-speed);
}

.logout-btn:hover {
  background-color: var(--gray-light);
  color: var(--text);
}

.main-content {
  flex: 1;
  padding: 30px 0;
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-light);
  flex-wrap: wrap;
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 14px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.25;
  white-space: nowrap;
  transition: all var(--transition-speed);
  border-bottom: 3px solid transparent;
  color: var(--gray);
}

.tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab:hover:not(.active) {
  color: var(--primary-dark);
  background-color: rgba(139, 92, 246, 0.05);
}

.tab-content {
  display: none;
  animation: fadeIn 0.5s;
}

.tab-content.active {
  display: block;
}

.card {
  background-color: var(--white);
  border-radius: var(--border-radius);
  box-shadow: 0 2px 10px var(--card-shadow);
  padding: 25px;
  margin-bottom: 30px;
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px var(--card-shadow);
}

.card-title {
  color: var(--text);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 10px;
}

.cipher-input-group {
  margin-bottom: 20px;
}

.cipher-option-group {
  margin-bottom: 20px;
  background-color: var(--card-bg);
  padding: 10px 15px;
  border-radius: var(--border-radius);
  border: 1px dashed var(--gray-light);
}

.option-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  position: relative;
}

.toggle-checkbox {
  width: 40px;
  height: 20px;
  appearance: none;
  background-color: var(--gray-light);
  border-radius: 20px;
  position: relative;
  cursor: pointer;
  transition: all var(--transition-speed);
}

.toggle-checkbox:checked {
  background-color: var(--primary);
}

.toggle-checkbox:before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  background-color: white;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: all var(--transition-speed);
}

.toggle-checkbox:checked:before {
  left: 22px;
}

.info-tooltip {
  position: relative;
  display: inline-block;
}

.info-icon {
  cursor: help;
  opacity: 0.7;
}

.tooltip-text {
  visibility: hidden;
  width: 220px;
  background-color: var(--gray-dark);
  color: white;
  text-align: center;
  border-radius: 6px;
  padding: 8px;
  position: absolute;
  z-index: 1;
  bottom: 125%;
  left: 50%;
  margin-left: -110px;
  opacity: 0;
  transition: opacity var(--transition-speed);
  font-size: 0.85rem;
}

.info-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

.cipher-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}

.result-area {
  margin-top: 20px;
}

.result-container {
  min-height: 50px;
  padding: 15px;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  word-break: break-all;
  color: var(--text);
  margin-bottom: 10px;
  font-family: monospace;
}

.copy-btn {
  margin-top: 10px;
}

/* Security info section */
.security-info {
  margin-top: 20px;
  padding: 15px;
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  border-left: 4px solid var(--info);
}

.card .security-info h3 {
  color: var(--info);
  margin-top: 18px;
  margin-bottom: 8px;
}

.security-low {
  color: var(--error);
  font-weight: 600;
}

.security-medium {
  color: var(--warning);
  font-weight: 600;
}

.security-high {
  color: var(--success);
  font-weight: 600;
}

/* Key display for RSA */
.key-generation {
  margin-bottom: 20px;
  padding: 15px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  border: 1px dashed var(--gray-light);
}

.key-display {
  display: grid;
  grid-template-columns: 1fr;
  gap: 15px;
  margin-top: 15px;
}

@media (min-width: 768px) {
  .key-display {
    grid-template-columns: 1fr 1fr;
  }
}

.key-group textarea {
  font-family: monospace;
  font-size: 0.9rem;
}

/* Advanced settings for RSA */
.advanced-settings {
  margin-top: 15px;
  padding: 15px;
  border-top: 1px solid var(--gray-light);
}

.card .advanced-settings h3 {
  margin-top: 18px;
  margin-bottom: 10px;
  font-size: 1rem;
  color: var(--primary);
}

/* Brute Force Section */
.bf-options {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  margin: 15px 0;
}

.bf-option-group label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
}

.bf-chart {
  height: 250px;
  margin-bottom: 20px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 15px;
}

.bf-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 15px;
  max-height: 400px;
  overflow-y: auto;
  padding: 10px;
}

.brute-force-item {
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  padding: 15px;
  background-color: var(--card-bg);
  position: relative;
}

.brute-force-item h4 {
  margin-bottom: 10px;
  color: var(--primary);
}

.score-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background-color: var(--primary);
  color: white;
  padding: 3px 8px;
  border-radius: 12px;
  font-size: 0.75rem;
}

.emoji-result {
  border-left: 4px solid var(--primary);
}

/* Highlight the most likely result */
.brute-force-item.most-likely {
  border: 2px solid var(--success);
  background-color: rgba(16, 185, 129, 0.1);
}

.emoji-text {
  background-color: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: var(--border-radius);
  margin: 10px 0;
  font-size: 1.2rem;
  line-height: 1.8;
}

.analysis-title {
  margin-bottom: 15px;
  color: var(--primary);
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 8px;
}

.analysis-section {
  margin-bottom: 20px;
  background-color: var(--card-bg);
  padding: 15px;
  border-radius: var(--border-radius);
}

.analysis-section h4 {
  margin-bottom: 10px;
  color: var(--primary);
}

.patterns-list {
  margin-left: 20px;
}

.common-english-pattern {
  color: var(--success);
}

.badge {
  background-color: var(--success);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 0.7rem;
  margin-left: 5px;
}

/* Security analysis */
.security-analysis-container {
  margin: 20px 0;
  padding: 15px;
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
}

.security-level {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 15px;
}

.security-level-icon {
  font-size: 24px;
}

.security-level-text {
  font-weight: 600;
}

.security-level-high {
  color: var(--success);
}

.security-level-medium {
  color: var(--warning);
}

.security-level-low {
  color: var(--error);
}

.security-comparison {
  margin-top: 15px;
  border-top: 1px solid var(--gray-light);
  padding-top: 15px;
}

.security-comparison h4 {
  margin-bottom: 10px;
}

.comparison-chart {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-top: 15px;
}

.comparison-bar {
  height: 20px;
  margin-right: 5px;
  position: relative;
  border-radius: 3px;
}

.comparison-bar-label {
  position: absolute;
  left: 10px;
  color: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

.caesar-bar {
  width: 15%;
  background-color: var(--error);
}

.playfair-bar {
  width: 30%;
  background-color: var(--warning);
}

.rsa-bar {
  width: 90%;
  background-color: var(--success);
}

/* Playfair Grid */
.playfair-grid {
  margin: 0 auto;
  margin-top: 20px;
}

.playfair-grid table {
  border-collapse: collapse;
  margin: 0 auto;
}

.playfair-grid td {
  border: 1px solid var(--gray-light);
  width: 40px;
  height: 40px;
  text-align: center;
  font-size: 18px;
  font-weight: bold;
  color: var(--primary);
  background-color: var(--card-bg);
}

.info-text {
  margin-top: 15px;
  color: var(--gray);
  font-size: 0.9em;
}

.dashboard-footer {
  background-color: var(--card-bg);
  padding: 36px 0 18px;
  color: var(--gray);
  margin-top: auto;
  border-top: 1px solid var(--gray-light);
}

.footer-main {
  display: grid;
  grid-template-columns: minmax(200px, 1.4fr) repeat(3, minmax(140px, 1fr));
  gap: 32px;
  padding-bottom: 28px;
}

.footer-brand .brand-name {
  display: inline-block;
  margin-bottom: 12px;
}

.footer-brand p {
  max-width: 290px;
  margin: 0 0 8px;
  font-size: 0.9rem;
}

.footer-link-group {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.footer-link-group h2 {
  margin-bottom: 4px;
  color: var(--text);
  font-size: 1rem;
}

.footer-link-group a {
  color: var(--gray);
  font-size: 0.9rem;
  text-decoration: none;
}

.footer-link-group a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--gray-light);
  font-size: 0.875rem;
}

.footer-bottom p {
  margin: 0;
}

/* Toast notification for copy functionality */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 20px;
  background-color: var(--success);
  color: white;
  border-radius: var(--border-radius);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity var(--transition-speed), transform var(--transition-speed);
  z-index: 1000;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}


/* Responsive styles */
@media (max-width: 768px) {
  .login-card {
    padding: 25px;
  }
  
  .login-header h1 {
    font-size: 2rem;
  }
  
  .cipher-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cipher-actions .btn {
    flex: 0 1 auto;
    max-width: 100%;
    min-height: 44px;
  }
  
  .dashboard-header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .bf-results-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 20px;
  }
  
  .login-header h1 {
    font-size: 1.8rem;
  }
  
  .tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }
  
  .tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: 6px;
    text-align: center;
  }
  
  .tab.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
  }

  .info-tooltip .tooltip-text {
    right: -8px;
    left: auto;
    width: min(220px, calc(100vw - 32px));
    margin-left: 0;
  }
}

/* Advanced frequency analysis */
.frequency-mapping {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.frequency-mapping th,
.frequency-mapping td {
  padding: 8px;
  text-align: center;
  border: 1px solid var(--gray-light);
}

.frequency-mapping th {
  background-color: var(--primary);
  color: white;
}

.frequency-mapping tr:nth-child(even) {
  background-color: rgba(0, 0, 0, 0.03);
}

.decryption-section {
  margin-top: 20px;
  padding: 15px;
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
}

.table-container {
  overflow-x: auto;
  margin-top: 15px;
}

/* Frequency chart */
.frequency-chart {
  display: flex;
  align-items: flex-end;
  height: 160px;
  margin: 20px 0;
  padding: 0 5px;
  gap: 2px;
}

.chart-bar-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  min-width: 15px;
}

.chart-bar {
  width: 100%;
  background-color: var(--primary);
  border-radius: 2px 2px 0 0;
  transition: height var(--transition-speed) ease;
}

.chart-bar-highlight {
  background-color: var(--success);
  position: relative;
}

.chart-bar-highlight::after {
  content: '✓';
  position: absolute;
  top: -15px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--success);
}

.chart-label {
  margin-top: 5px;
  font-size: 12px;
  font-weight: bold;
  color: var(--text);
}

.chart-value {
  font-size: 10px;
  color: var(--gray);
}

/* Additional Tools Section */
.tools-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

@media (min-width: 768px) {
  .tools-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 992px) {
  .tools-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.tool-card {
  background-color: var(--card-bg);
  border-radius: var(--border-radius);
  padding: 15px;
  border: 1px solid var(--gray-light);
  transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.tool-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 5px 15px var(--card-shadow);
}

.tool-card h3 {
  margin-bottom: 15px;
  color: var(--primary);
  font-size: 1.1rem;
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 8px;
}

.tool-card > p {
  margin-bottom: 12px;
  font-size: 0.92rem;
}

.tool-input-group {
  margin-bottom: 15px;
}

.tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 15px;
}

.tool-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 0 0 15px;
  padding: 10px;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
}

.tool-options legend {
  padding: 0 5px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
}

.tool-options label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.85rem;
}

.tool-options input {
  accent-color: var(--primary);
}

.tool-result {
  margin-top: 15px;
}

.tool-card .result-container {
  overflow-wrap: anywhere;
}

/* Password strength meter in tools */
.password-strength-meter {
  margin: 15px 0;
}

.password-strength-meter .strength-bar {
  height: 6px;
  background-color: var(--gray-light);
  border-radius: 3px;
  margin-bottom: 5px;
}

.password-strength-meter .strength-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  transition: width var(--transition-speed), background-color var(--transition-speed);
}

.password-strength-meter p {
  font-size: 0.9rem;
  color: var(--gray);
}

.feedback-list {
  list-style-type: none;
  padding: 0;
  margin: 10px 0;
  font-size: 0.85rem;
}

.feedback-list li {
  margin-bottom: 3px;
  color: var(--gray);
  padding-left: 12px;
  position: relative;
}

.feedback-list li:before {
  content: "•";
  position: absolute;
  left: 0;
}

/* Responsive styles */
@media (max-width: 768px) {
  .login-card {
    padding: 25px;
  }
  
  .login-header h1 {
    font-size: 2rem;
  }
  
  .cipher-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cipher-actions .btn {
    flex: 0 1 auto;
    max-width: 100%;
    min-height: 44px;
  }

  .cipher-actions .btn,
  .tool-actions .btn {
    white-space: nowrap;
  }
  
  .dashboard-header-content {
    flex-direction: column;
    gap: 15px;
  }
  
  .bf-results-grid {
    grid-template-columns: 1fr;
  }
  
  .comparison-chart {
    gap: 10px;
  }
}

@media (max-width: 480px) {
  .login-card {
    padding: 20px;
  }
  
  .login-header h1 {
    font-size: 1.8rem;
  }
  
  .tabs {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }
  
  .tab {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    text-align: center;
  }
  
  .tab.active {
    background-color: var(--primary);
    color: white;
    border-color: var(--primary);
  }
  
  .cipher-option-group {
    padding: 10px;
  }
  
  .cipher-actions,
  .tool-actions {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
  }

  .cipher-actions .btn,
  .tool-actions .btn {
    flex: 0 1 auto;
    max-width: 100%;
    min-height: 44px;
  }

  .btn-sm {
    min-height: 40px;
  }

  .seo-cta-list .seo-cta {
    flex: 0 1 auto;
    min-width: 0;
    min-height: 40px;
    padding: 8px 12px;
    font-size: 13px;
  }
}

    /* Password toggle icon styling */
    .password-toggle {
      position: absolute;
      right: 10px;
      top: 70%;
      transform: translateY(-50%);
      cursor: pointer;
      z-index: 10;
      opacity: 0.8;
      transition: opacity 0.1s;
    }
    .password-toggle:hover {
      opacity: 1;
    }
    .form-group {
      position: relative;
    }

.engine-background {
  background-color: rgb(46, 48, 81);
  color: black;
  transition: background-color 0.3s;
}

/* ==================== AEO/GEO Quick Answer Box ==================== */
.quick-answer-box {
  background: var(--card-bg);
  padding: 20px;
  border-radius: var(--border-radius);
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
}

.quick-answer-box h2 {
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 1.3rem;
}

.quick-answer-box p {
  color: var(--text);
  line-height: 1.7;
  margin-bottom: 8px;
}

/* ==================== FAQ Section ==================== */
.faq-section {
  margin-top: 40px;
  padding: 30px;
  background: var(--card-bg);
  border-radius: var(--border-radius);
  margin-bottom: 30px;
}

.faq-section h2 {
  color: var(--primary);
  margin-bottom: 20px;
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 10px;
}

.faq-item {
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--gray-light);
}

.faq-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.faq-item h3 {
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text);
}

.faq-item p {
  color: var(--gray);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Top navigation */
.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
}
.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Footer navigation */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
}
.footer-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
}
.footer-nav a:hover {
  color: var(--primary);
  opacity: 1;
}
/* Top navigation */
.site-nav {
  display: flex;
  gap: 18px;
  align-items: center;
  margin-left: 24px;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gray-light);
  border-radius: var(--border-radius);
  background-color: var(--card-bg);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background-color: currentColor;
  transition: transform 0.2s, background-color 0.2s;
}

.nav-toggle-icon {
  position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
  position: absolute;
  left: 0;
  content: "";
}

.nav-toggle-icon::before {
  transform: translateY(-6px);
}

.nav-toggle-icon::after {
  transform: translateY(6px);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
  background-color: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
  transform: rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
  transform: rotate(-45deg);
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: color 0.2s, border-color 0.2s;
}
.site-nav a:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* Footer navigation */
.footer-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  margin-bottom: 12px;
}
.footer-nav a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  opacity: 0.85;
}
.footer-nav a:hover {
  color: var(--primary);
  opacity: 1;
}

/* Contact form */
.contact-form {
  margin-top: 20px;
  max-width: 600px;
}
.contact-form .form-group {
  margin-bottom: 16px;
}
.contact-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 500;
}
.contact-form textarea {
  resize: vertical;
  min-height: 120px;
  font-family: inherit;
}

/* Article typography */
.card h3 {
  margin-top: 24px;
  margin-bottom: 10px;
  color: var(--primary);
}
.card h4 {
  margin-top: 18px;
  margin-bottom: 8px;
}
.card p {
  margin-bottom: 12px;
  line-height: 1.7;
}
.card ul, .card ol {
  margin: 12px 0 16px 22px;
}
.card li {
  margin-bottom: 6px;
  line-height: 1.6;
}
.card a {
  color: var(--primary);
}

@media (max-width: 480px) {
  .seo-cta-list {
    gap: 8px;
  }

  .seo-cta {
    flex: 1 1 180px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 720px) {
  .dashboard-header-content.has-site-nav {
    position: relative;
    flex-direction: row;
    align-items: center;
    gap: 0;
  }

  .has-site-nav .spacer {
    display: none;
  }

  .has-site-nav .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .has-site-nav .site-nav {
    position: absolute;
    top: calc(100% + 15px);
    right: 0;
    z-index: 20;
    display: none;
    width: min(240px, calc(100vw - 30px));
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 0;
}

.footer-brand .brand-name {
    color: var(--primary);
    padding: 10px;
    border: 1px solid var(--gray-light);
    border-radius: var(--border-radius);
    background-color: var(--white);
    box-shadow: 0 8px 20px var(--card-shadow);
  }

  .has-site-nav .site-nav.is-open {
    display: flex;
  }

  .has-site-nav .site-nav a {
    padding: 10px 12px;
    border: 0;
    border-radius: 6px;
  }

  .has-site-nav .site-nav a:hover,
  .has-site-nav .site-nav a:focus-visible {
    background-color: var(--gray-light);
  }

  .theme-toggle {
    right: 66px;
  }

  .footer-main {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 18px;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 6px;
  }
}