:root {
  /* PyCharm Darcula Palette */
  --bg-main: #1e1e1e;
  --bg-panel: #252526;
  --bg-code: #2d2d2d;
  --border-color: #3c3f41;

  --text-main: #a9b7c6;
  --text-muted: #808080;

  --keyword: #cc7832;       /* Orange */
  --string: #6a8759;        /* Olive Green */
  --function: #ffc66d;      /* Light Gold */
  --comment: #808080;       /* Muted Grey */
  --accent: #4e8078;        /* Teal Accent */
  --link: #589df6;          /* PyCharm Blue */
}

body {
  background-color: var(--bg-main);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
  max-width: 800px;
  margin: 40px auto;
  padding: 0 20px;
}

h1, h2, h3 {
  color: #e0e0e0;
  font-weight: 600;
  letter-spacing: -0.5px;
}

h1 {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
  font-size: 1.85rem;
}

h2 {
  margin-top: 36px;
  font-size: 1.35rem;
  color: var(--function);
  border-bottom: 1px solid #2d2d2d;
  padding-bottom: 6px;
}

a {
  color: var(--link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.meta {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 24px;
}

/* Code & Pre Blocks */
code {
  background: var(--bg-code);
  color: #e0e0e0;
  padding: 3px 6px;
  border-radius: 4px;
  font-family: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.9em;
  border: 1px solid var(--border-color);
}

pre {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 16px;
  overflow-x: auto;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

pre code {
  background: transparent;
  border: none;
  padding: 0;
  font-family: "JetBrains Mono", "Fira Code", Consolas, "Courier New", monospace;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--text-main);
}

/* Structural Components */
ul {
  padding-left: 20px;
}

li {
  margin-bottom: 8px;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 32px 0;
}
/* Hide broken img tags and establish pseudo-element frame */
img.aws-icon {
  display: inline-block;
  position: relative;
  width: 20px;
  height: 20px;
  vertical-align: middle;
  margin-right: 8px;
}

img.aws-icon::before {
  content: "";
  display: block;
  width: 20px;
  height: 20px;
  position: absolute;
  top: 0;
  left: 0;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}

/* Official AWS Amazon S3 Architecture Icon (Green Bucket Vector) */
img.aws-icon[alt*="S3" i]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Cpath fill='%237AA116' d='M52 14v36c0 4.4-9 8-20 8S12 54.4 12 50V14'/%3E%3Cpath fill='%2397D61E' d='M32 6c11 0 20 3.6 20 8s-9 8-20 8-20-3.6-20-8 9-8 20-8'/%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='3' stroke-miterlimit='10' d='M52 14v36c0 4.4-9 8-20 8S12 54.4 12 50V14M32 6c11 0 20 3.6 20 8s-9 8-20 8-20-3.6-20-8 9-8 20-8'/%3E%3C/svg%3E");
}

/* Official AWS Amazon CloudFront Architecture Icon (Purple Globe/Edge Vector) */
img.aws-icon[alt*="CloudFront" i]::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 64 64'%3E%3Crect width='64' height='64' rx='8' fill='%238C4FFF'/%3E%3Cpath fill='none' stroke='%23ffffff' stroke-width='3' stroke-miterlimit='10' d='M32 12a20 20 0 1 0 0 40 20 20 0 0 0 0-40zm-20 20h40M32 12c5 5.5 8 12.5 8 20s-3 14.5-8 20c-5-5.5-8-12.5-8-20s3-14.5 8-20z'/%3E%3C/svg%3E");
}

/* Search Header & Bar */
.search-header {
  margin-bottom: 24px;
}

.search-bar {
  display: flex;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  padding: 8px 16px;
  margin-bottom: 8px;
}

.search-icon {
  margin-right: 12px;
  font-size: 0.9rem;
}

.search-bar input {
  background: transparent;
  border: none;
  color: var(--text-main);
  font-size: 0.95rem;
  width: 100%;
  outline: none;
}

.search-stats {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding-left: 8px;
}

/* Google Search Result Cards */
.result-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  transition: border-color 0.2s ease;
}

.result-card:hover {
  border-color: var(--link);
}

.card-content {
  flex: 1;
}

.result-meta {
  display: flex;
  flex-direction: column;
  margin-bottom: 4px;
}

.site-name {
  font-size: 0.85rem;
  color: var(--text-heading);
  font-weight: 600;
}

.site-url {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.result-title {
  margin: 4px 0 8px 0;
  border: none;
  padding: 0;
  font-size: 1.15rem;
}

.result-title a {
  color: var(--link);
  text-decoration: none;
}

.result-title a:hover {
  text-decoration: underline;
}

.result-snippet {
  font-size: 0.88rem;
  color: var(--text-main);
  margin: 0 0 12px 0;
  line-height: 1.4;
}

.result-tags {
  display: flex;
  gap: 6px;
}

.tag {
  background: var(--bg-code);
  border: 1px solid var(--border-color);
  color: var(--function);
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Right-side Card Thumbnail */
.card-thumbnail {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px;
  min-width: 70px;
  height: 60px;
  align-self: flex-start;
}

.clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 4px;
}

.clear-btn:hover {
  color: var(--text-main);
}