/* ============================================================
   .htaccess Generator Tool - Standalone Styles
   Fully isolated from main website
   ============================================================ */

:root {
  /* Brand Colors */
  --primary: #00e556;
  --primary-dim: rgba(0, 229, 86, 0.1);
  --primary-glow: #00e556;
  
  /* Light Theme (Default) */
  --bg-main: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-surface: #ffffff;
  --surface-light: #ffffff;
  --text-main: #0b0b0b;
  --text-muted: #4b5563;
  --text-light: #6b7280;
  --border-color: #e2e8f0;
  --border-light: #e2e8f0;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-glow: 0 0 20px rgba(0, 229, 86, 0.3);
}

html.dark {
  --bg-main: #030303;
  --bg-secondary: #0a0a0a;
  --bg-surface: #0f0f0f;
  --surface-light: #0f0f0f;
  --text-main: #ffffff;
  --text-muted: #a0a0a0;
  --text-light: #6b7280;
  --border-color: #262626;
  --border-light: #262626;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(0, 229, 86, 0.4);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.app-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Header */
.tool-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 0;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.88);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

html.dark .tool-header {
  background: rgba(3, 3, 3, 0.8);
}

.header-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text-main);
  font-weight: 800;
  font-size: 1.25rem;
  transition: color 0.3s ease;
}

.logo-link:hover {
  color: var(--primary);
}

.logo-badge {
  background: var(--primary-dim);
  color: var(--primary);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Header Navigation - Pill Style (from typography.php design system) */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  margin-right: 16px;
  background: var(--surface-light);
  padding: 4px;
  border: 1px solid var(--border-light);
  border-radius: 9999px;
  transition: all 0.2s ease;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: 9999px;
  text-decoration: none;
  color: var(--text-muted);
  background: transparent;
  transition: all 0.2s ease;
}

.nav-link:hover {
  color: var(--text-main);
  background: var(--bg-secondary);
}

.nav-link.active {
  background: var(--primary);
  color: #000;
}

.nav-link .material-icons-outlined {
  font-size: 18px;
}

.nav-link span:not(.material-icons-outlined) {
  display: inline-block;
}

@media (max-width: 768px) {
  .nav-link span:not(.material-icons-outlined) {
    display: none;
  }
  
  .nav-link {
    padding: 8px 12px;
    min-width: 40px;
    justify-content: center;
  }
  
  .header-nav {
    margin-right: 8px;
  }
}

.theme-toggle {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-main);
}

.theme-toggle:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  transform: scale(1.05);
}

.theme-icon-light,
.theme-icon-dark {
  font-size: 20px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

html.dark .theme-icon-light {
  display: none;
}

html:not(.dark) .theme-icon-dark {
  display: none;
}

/* Main Content */
.tool-main {
  flex: 1;
  padding: 40px 0;
}

/* Warning Banner */
.warning-banner {
  background: rgba(239, 68, 68, 0.1);
  border-left: 4px solid #ef4444;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 32px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

.warning-icon {
  color: #ef4444;
  font-size: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

.warning-content {
  flex: 1;
  color: var(--text-main);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.warning-content strong {
  color: #ef4444;
  font-weight: 700;
}

/* Hero Section */
.hero-section {
  text-align: center;
  margin-bottom: 48px;
}

.hero-title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.2;
}

.text-glow {
  background: linear-gradient(135deg, var(--primary) 0%, #00c44a 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-shadow: 0 0 30px rgba(0, 229, 86, 0.5);
}

.hero-description {
  font-size: 1.125rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
}

/* Tool Layout */
.tool-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

/* Config Panel */
.config-panel,
.output-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.config-panel:hover,
.output-panel:hover {
  box-shadow: var(--shadow-lg);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.panel-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-main);
}

.btn-reset {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-main);
  font-size: 0.875rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-reset:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
}

.btn-reset .material-icons-outlined {
  font-size: 18px;
}

/* Config Content */
.config-content {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-height: calc(100vh - 300px);
  overflow-y: auto;
  padding-right: 8px;
}

.config-group {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 20px;
}

.config-group-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.group-icon {
  color: var(--primary);
  font-size: 24px;
}

.config-group-header h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-main);
}

.config-options {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Checkbox Labels */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  padding: 8px;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.checkbox-label:hover {
  background: var(--primary-dim);
}

.checkbox-label input[type="checkbox"] {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.checkbox-label span {
  flex: 1;
  color: var(--text-main);
  font-size: 0.9375rem;
  line-height: 1.5;
}

/* Input Groups */
.input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.input-group label {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
}

.input-group input[type="text"],
.input-group textarea {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-family: 'Inter', monospace;
  font-size: 0.875rem;
  background: var(--bg-main);
  color: var(--text-main);
  transition: all 0.3s ease;
  outline: none;
}

.input-group input[type="text"]:focus,
.input-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.input-group textarea {
  resize: vertical;
  font-family: 'Courier New', monospace;
}

.input-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.input-row input {
  flex: 1;
}

.input-arrow {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
}

.btn-add {
  background: var(--primary);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #000;
  font-weight: 600;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
}

.btn-add:hover {
  background: #00c44a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-add .material-icons-outlined {
  font-size: 18px;
}

/* Redirects List */
.redirects-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.redirect-item {
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.redirect-item-content {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  color: var(--text-main);
}

.redirect-item-content .redirect-from {
  color: var(--text-muted);
}

.redirect-item-content .redirect-arrow {
  color: var(--primary);
  font-weight: 700;
}

.redirect-item-content .redirect-to {
  color: var(--primary);
  font-weight: 600;
}

.btn-remove {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-remove:hover {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

/* Output Panel */
.output-panel {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
}

.output-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--text-main);
}

.btn-icon:hover {
  background: var(--primary-dim);
  border-color: var(--primary);
  color: var(--primary);
  transform: scale(1.05);
}

.btn-icon:active {
  transform: scale(0.95);
}

.btn-icon .material-icons-outlined {
  font-size: 18px;
}

.output-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.htaccess-output {
  flex: 1;
  width: 100%;
  padding: 16px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  font-family: 'Courier New', monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--bg-secondary);
  color: var(--text-main);
  resize: none;
  outline: none;
  white-space: pre;
  overflow-wrap: normal;
  overflow-x: auto;
}

.htaccess-output:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}

.output-info {
  display: flex;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.info-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Info Section */
.info-section {
  margin-bottom: 48px;
}

.info-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.info-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-main);
}

.info-content {
  color: var(--text-muted);
  line-height: 1.8;
}

.info-content p {
  margin-bottom: 16px;
}

.info-warning {
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid #ef4444;
  padding: 12px 16px;
  border-radius: 8px;
  margin: 16px 0;
  font-size: 0.875rem;
  color: var(--text-main);
}

.info-list {
  list-style: none;
  padding-left: 0;
  margin: 16px 0;
}

.info-list li {
  padding: 8px 0;
  padding-left: 24px;
  position: relative;
}

.info-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--primary);
  font-weight: 700;
}

/* Footer */
.tool-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-color);
  padding: 24px 0;
  margin-top: auto;
}

.footer-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-link:hover {
  color: var(--primary);
}

/* Toast Notification */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 16px 24px;
  box-shadow: var(--shadow-lg);
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 1000;
  max-width: 300px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast-message {
  color: var(--text-main);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success .toast-message::before {
  content: '✓';
  color: var(--primary);
  font-weight: 700;
  font-size: 1.25rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .tool-layout {
    grid-template-columns: 1fr;
  }
  
  .output-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 16px;
  }

  .config-panel,
  .output-panel {
    padding: 20px;
  }

  .config-content {
    max-height: none;
  }

  .hero-title {
    font-size: 2rem;
  }

  .hero-description {
    font-size: 1rem;
  }

  .info-card {
    padding: 24px;
  }

  .toast {
    right: 16px;
    bottom: 16px;
    left: 16px;
    max-width: none;
  }
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Focus visible for accessibility */
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* Scrollbar styling */
.config-content::-webkit-scrollbar,
.htaccess-output::-webkit-scrollbar {
  width: 8px;
}

.config-content::-webkit-scrollbar-track,
.htaccess-output::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 4px;
}

.config-content::-webkit-scrollbar-thumb,
.htaccess-output::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 4px;
}

.config-content::-webkit-scrollbar-thumb:hover,
.htaccess-output::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}
