/* =========================================
   Regex Tester - Glassmorphism Styles
========================================= */

.page-wrapper {
  width: 90%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 6fr 1fr;
  gap: 2rem;
  padding: 60px 0 4rem 0;
  flex: 1;
}
.ad-space-left,
.ad-space-right {
  width: 100%;
  min-height: 600px;
  background: rgba(255, 255, 255, 0.4);
  border: 1px dashed var(--glass-border, rgba(255, 255, 255, 0.7));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted, #475569);
  font-size: 0.8rem;
}
.main-content {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}
.glass-panel {
  background: var(--glass-bg, rgba(255, 255, 255, 0.55));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.7));
  border-radius: 12px;
  padding: 2rem;
  box-shadow: var(--glass-shadow, 0 8px 32px 0 rgba(0, 85, 255, 0.15));
}
.glass-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--glass-border, rgba(255, 255, 255, 0.7));
  border-radius: 8px;
  padding: 1.5rem;
  transition:
    transform 0.2s,
    box-shadow 0.2s;
}

.background-shapes {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  overflow: hidden;
}
.shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.6;
}
.shape-1 {
  width: 400px;
  height: 400px;
  background: #00a2ff;
  top: -100px;
  left: -100px;
}
.shape-2 {
  width: 500px;
  height: 500px;
  background: #0033cc;
  bottom: -150px;
  right: -100px;
}
.shape-3 {
  width: 300px;
  height: 300px;
  background: #7dd3fc;
  top: 40%;
  left: 30%;
}

h1 {
  margin-bottom: 0.5rem;
  color: var(--text-dark, #1e293b);
  font-size: 1.8rem;
}
h2 {
  font-size: 1.4rem;
  color: var(--text-dark, #1e293b);
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--glass-border);
  padding-bottom: 0.5rem;
}

/* Generator Layout */
.generator-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

/* Settings */
.settings-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.input-group label {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-dark, #1e293b);
}

/* Regex Builder specific styles */
.regex-builder {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 0.25rem;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
  transition: border-color 0.2s;
}
.regex-builder:focus-within {
  border-color: var(--accent);
}
.regex-slash {
  font-family: monospace;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-muted);
  padding: 0 0.5rem;
}
.regex-builder input {
  border: none;
  background: transparent;
  font-family: "Fira Code", monospace;
  font-size: 1rem;
  color: var(--accent);
  outline: none;
}
#regex-pattern {
  flex: 1;
  min-width: 0;
}
#regex-flags {
  width: 60px;
  color: #10b981;
}

#test-string {
  width: 100%;
  padding: 1rem;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--text-dark);
  font-family: "Fira Code", monospace;
  font-size: 0.95rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.2s;
  line-height: 1.5;
}
#test-string:focus {
  border-color: var(--accent);
}

.flag-cheatsheet {
  background: rgba(255, 255, 255, 0.6);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  font-size: 0.85rem;
}
.flag-list {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.flag-list span {
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.flag-list code {
  background: #e2e8f0;
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
  color: var(--text-dark);
  font-weight: bold;
}

/* Preview Card */
.preview-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.result-header {
  font-weight: 700;
  color: var(--text-muted);
  font-size: 0.85rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
  letter-spacing: 0.05em;
  width: 100%;
}

.highlight-box {
  width: 100%;
  min-height: 150px;
  background: #f8fafc;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  padding: 1rem;
  font-family: "Fira Code", monospace;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--text-dark);
  white-space: pre-wrap;
  word-break: break-all;
  overflow-y: auto;
  max-height: 300px;
}
.highlight-box mark {
  background: rgba(0, 85, 255, 0.2);
  border-bottom: 2px solid var(--accent);
  color: var(--text-dark);
  padding: 0.1rem 0;
  border-radius: 2px;
}
/* Alternating highlight colors for consecutive matches */
.highlight-box mark:nth-child(even) {
  background: rgba(16, 185, 129, 0.2);
  border-bottom: 2px solid #10b981;
}

.match-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 300px;
  overflow-y: auto;
}
.match-item {
  background: #ffffff;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 0.75rem;
  font-family: "Fira Code", monospace;
  font-size: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}
.match-item strong {
  color: var(--accent);
  font-size: 0.95rem;
}
.match-group {
  color: var(--text-muted);
  padding-left: 1rem;
  border-left: 2px solid #e2e8f0;
  margin-top: 0.25rem;
  display: flex;
  flex-direction: column;
}
.match-group span {
  margin-bottom: 0.1rem;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.info-block h4 {
  font-size: 1.15rem;
  color: var(--accent, #0055ff);
  border-bottom: 2px solid var(--glass-border, rgba(255, 255, 255, 0.7));
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}
.info-block p {
  color: var(--text-muted, #475569);
  font-size: 0.95rem;
  line-height: 1.6;
}

@media (max-width: 1024px) {
  .page-wrapper {
    width: 95%;
    grid-template-columns: 1fr;
  }
  .ad-space-left,
  .ad-space-right {
    display: none;
  }
}
@media (max-width: 768px) {
  .generator-layout,
  .settings-grid {
    grid-template-columns: 1fr;
  }
}
