/* ========================================
   Modern Responsive CSS for Autodoc
   ======================================== */

/* === ROOT & RESET === */
:root {
  --max-width: 1100px;
  --primary-color: #2563eb;
  --text-color: #1f2937;
  --text-light: #6b7280;
  --bg-color: #ffffff;
  --bg-alt: #f9fafb;
  --border-color: #e5e7eb;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
}

* {
  box-sizing: border-box;
}

/* === BASE TYPOGRAPHY === */
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.45;
  color: var(--text-color);
  background-color: var(--bg-alt);
  margin: 0;
  padding: 0;
  font-size: 15px;
}

/* === CONTAINER === */
body {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem;
  background-color: var(--bg-color);
  box-shadow: var(--shadow-lg);
}

@media (max-width: 768px) {
  body {
    padding: 1.5rem 1rem;
    box-shadow: none;
  }
}

/* === HEADER BLOCK === */
header#title-block-header {
  text-align: center;
  padding: 2.5rem 1rem 2rem;
  margin-bottom: 3rem;
  border-bottom: 3px solid var(--primary-color);
  background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
  border-radius: 8px;
}

header#title-block-header h1.title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text-color);
  margin: 0 0 0.75rem 0;
  line-height: 1.2;
}

header#title-block-header .author {
  font-size: 1.1rem;
  color: var(--text-light);
  margin: 0.5rem 0;
  font-style: italic;
}

header#title-block-header .date {
  font-size: 0.95rem;
  color: var(--text-light);
  margin: 0.25rem 0 0 0;
}

@media (max-width: 768px) {
  header#title-block-header {
    padding: 1.5rem 0.75rem 1.25rem;
    margin-bottom: 2rem;
  }
  
  header#title-block-header h1.title {
    font-size: 1.875rem;
  }
}

/* === HEADINGS === */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-color);
  margin-top: 1.2rem;
  margin-bottom: 0.5rem;
}

h1 {
  font-size: 2.25rem;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 0.5rem;
  margin-top: 2.5rem;
}

h2 {
  font-size: 1.875rem;
  margin-top: 2rem;
}

h3 {
  font-size: 1.5rem;
}

h4 {
  font-size: 1.25rem;
}

h5, h6 {
  font-size: 1.125rem;
}

@media (max-width: 768px) {
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }
  h4, h5, h6 { font-size: 1.125rem; }
}

/* === PARAGRAPHS === */
p {
  margin: 0.4rem 0;
  line-height: 1.45;
}

/* === LINKS === */
a {
  color: var(--primary-color);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

a:hover {
  border-bottom-color: var(--primary-color);
  color: #1d4ed8;
}

/* === LISTS === */
ul, ol {
  margin: 0.3rem 0;
  padding-left: 1.5rem;
}

li {
  margin: 0.15rem 0;
}

/* === CODE BLOCKS === */
code {
  background-color: #f3f4f6;
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-family: "Consolas", "Monaco", "Courier New", monospace;
  font-size: 0.9em;
  color: #dc2626;
}

pre {
  background-color: #ebebeb;
  color: #1f2937;
  padding: 0.6rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  margin: 0.5rem 0;
  box-shadow: var(--shadow);
}

pre code {
  background-color: transparent;
  color: inherit;
  padding: 0;
  border-radius: 0;
  font-size: 0.875rem;
}

/* === BLOCKQUOTE === */
blockquote {
  margin: 0.5rem 0;
  padding: 0.4rem 1rem;
  border-left: 4px solid var(--primary-color);
  background-color: var(--bg-alt);
  font-style: italic;
  color: var(--text-light);
}

/* === TABLES === */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  overflow-x: auto;
  display: block;
}

@media (min-width: 768px) {
  table {
    display: table;
  }
}

th, td {
  padding: 0.75rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-alt);
  font-weight: 600;
  color: var(--text-color);
}

tr:hover {
  background-color: var(--bg-alt);
}

/* === HORIZONTAL RULE === */
hr {
  border: none;
  border-top: 2px solid var(--border-color);
  margin: 2rem 0;
}

/* === IMAGES === */
img {
  max-width: 100%;
  height: auto;
  border-radius: 6px;
  margin: 1.5rem 0;
  box-shadow: var(--shadow);
}

/* ========================================
   GITHUB ALERTS STYLES
   ======================================== */

.alert,
.note,
.tip,
.important,
.warning,
.caution {
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
  border-left: 5px solid;
  border-radius: 6px;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.alert:hover,
.note:hover,
.tip:hover,
.important:hover,
.warning:hover,
.caution:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.alert::before {
  content: attr(data-title);
  font-weight: 700;
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Note - Blue */
.alert-note,
.note {
  background-color: #dbeafe;
  border-color: #3b82f6;
  color: #1e40af;
}

.note .title {
  font-weight: 700;
  color: #1e40af;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.note .title p {
  margin: 0;
  display: inline;
}

.note .title::before {
  content: "ℹ️";
  margin-right: 0.5rem;
  display: inline-block;
}

/* Tip - Green */
.alert-tip,
.tip {
  background-color: #d1fae5;
  border-color: #10b981;
  color: #065f46;
}

.tip .title {
  font-weight: 700;
  color: #065f46;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.tip .title p {
  margin: 0;
  display: inline;
}

.tip .title::before {
  content: "💡";
  margin-right: 0.5rem;
  display: inline-block;
}

/* Important - Purple */
.alert-important,
.important {
  background-color: #e9d5ff;
  border-color: #a855f7;
  color: #6b21a8;
}

.important .title {
  font-weight: 700;
  color: #6b21a8;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.important .title p {
  margin: 0;
  display: inline;
}

.important .title::before {
  content: "❗";
  margin-right: 0.5rem;
  display: inline-block;
}

/* Warning - Orange */
.alert-warning,
.warning {
  background-color: #fed7aa;
  border-color: #f97316;
  color: #9a3412;
}

.warning .title {
  font-weight: 700;
  color: #9a3412;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.warning .title p {
  margin: 0;
  display: inline;
}

.warning .title::before {
  content: "⚠️";
  margin-right: 0.5rem;
  display: inline-block;
}

/* Caution - Red */
.alert-caution,
.caution {
  background-color: #fecaca;
  border-color: #ef4444;
  color: #991b1b;
}

.caution .title {
  font-weight: 700;
  color: #991b1b;
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
}

.caution .title p {
  margin: 0;
  display: inline;
}

.caution .title::before {
  content: "✋";
  margin-right: 0.5rem;
  display: inline-block;
}

/* === MOBILE RESPONSIVE ADJUSTMENTS === */
@media (max-width: 768px) {
  .alert,
  .note,
  .tip,
  .important,
  .warning,
  .caution {
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
  }
}

/* === PRINT STYLES === */
@media print {
  body {
    max-width: 100%;
    padding: 0;
    box-shadow: none;
    background-color: white;
  }
  
  header#title-block-header {
    background: none;
    border-radius: 0;
  }
  
  .alert, .note, .tip, .important, .warning, .caution {
    box-shadow: none;
    page-break-inside: avoid;
  }
}
