* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  color: #eee;
  padding: 40px 20px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
}

h1 {
  text-align: center;
  margin-bottom: 10px;
}

.subtitle {
  text-align: center;
  color: #aaa;
  margin-bottom: 40px;
}

.section {
  background-color: #0f3460;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 30px;
}

.section-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 15px;
  color: #4a90e2;
  border-left: 4px solid #4a90e2;
  padding-left: 15px;
}

.section-description {
  color: #aaa;
  margin-bottom: 25px;
  font-size: 14px;
  padding-left: 19px;
}

.demo-box {
  background-color: #2a3a5a;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.code {
  background-color: #0a0a1a;
  padding: 15px;
  border-radius: 8px;
  font-family: "Courier New", monospace;
  font-size: 13px;
  color: #82b1ff;
  overflow-x: auto;
  margin-top: 15px;
}

hr {
  border-color: #2a3a5a;
  margin: 30px 0;
}

/* ===================================
           DEMO 1: ::before
           =================================== */
.before-demo p {
  background-color: #2a3a5a;
  padding: 15px;
  border-radius: 8px;
}

.before-demo p::before {
  content: "⭐ ";
  font-size: 18px;
}

/* ===================================
           DEMO 2: ::after
           =================================== */
.after-demo p {
  background-color: #2a3a5a;
  padding: 15px;
  border-radius: 8px;
}

.after-demo p::after {
  content: " ⭐";
  font-size: 18px;
}

/* ===================================
           DEMO 3: ::before + ::after together
           =================================== */
.both-demo p {
  background-color: #2a3a5a;
  padding: 15px;
  border-radius: 8px;
}

.both-demo p::before {
  content: "🔹 ";
}

.both-demo p::after {
  content: " 🔹";
}

/* ===================================
           DEMO 4: ::before for icons (no text)
           =================================== */
.icon-demo li {
  list-style: none;
  padding: 8px 0;
}

.icon-demo li::before {
  content: "✅";
  margin-right: 10px;
  color: #2ecc71;
}

/* ===================================
           DEMO 5: ::before with positioning (badge effect)
           =================================== */
.badge-demo {
  position: relative;
  display: inline-block;
  background-color: #e94560;
  padding: 15px 30px;
  border-radius: 8px;
  font-weight: bold;
}

.badge-demo::before {
  content: "NEW";
  position: absolute;
  top: -10px;
  right: -10px;
  background-color: #2ecc71;
  color: white;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 20px;
  font-weight: bold;
}

/* ===================================
           DEMO 6: ::first-letter
           =================================== */
.first-letter-demo p {
  background-color: #2a3a5a;
  padding: 15px;
  border-radius: 8px;
}

.first-letter-demo p::first-letter {
  font-size: 48px;
  font-weight: bold;
  color: #e94560;
  margin-right: 5px;
}

/* ===================================
           DEMO 7: ::first-line
           =================================== */
.first-line-demo p {
  background-color: #2a3a5a;
  padding: 15px;
  border-radius: 8px;
  width: 300px;
}

.first-line-demo p::first-line {
  font-weight: bold;
  color: #4a90e2;
}

/* ===================================
           DEMO 8: ::selection
           =================================== */
.selection-demo p {
  background-color: #2a3a5a;
  padding: 15px;
  border-radius: 8px;
}

.selection-demo p::selection {
  background-color: #e94560;
  color: white;
}

/* ===================================
           DEMO 9: ::placeholder
           =================================== */
.placeholder-demo input {
  width: 100%;
  padding: 12px;
  border: 2px solid #2a3a5a;
  border-radius: 8px;
  background-color: #1a1a2e;
  color: white;
}

.placeholder-demo input::placeholder {
  color: #888;
  font-style: italic;
}

/* ===================================
           DEMO 10: ::marker
           =================================== */
.marker-demo li::marker {
  color: #e94560;
  font-size: 18px;
}

/* ===================================
           DEMO 11: ::backdrop (for dialogs)
           =================================== */
dialog {
  background-color: #1a1a2e;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 20px;
}

dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.8);
}

/* ===================================
           DEMO 12: Practical example - quote with before/after
           =================================== */
.quote-demo {
  background-color: #2a3a5a;
  padding: 25px;
  border-radius: 12px;
  font-style: italic;
  position: relative;
}

.quote-demo::before {
  content: "“";
  font-size: 60px;
  position: absolute;
  top: -10px;
  left: 10px;
  color: #4a90e2;
  opacity: 0.5;
}

.quote-demo::after {
  content: "”";
  font-size: 60px;
  position: absolute;
  bottom: -30px;
  right: 10px;
  color: #4a90e2;
  opacity: 0.5;
}

footer {
  text-align: center;
  padding: 40px;
  color: #666;
}

button {
  background-color: #4a90e2;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  cursor: pointer;
  margin-top: 10px;
}

.dialog-demo {
  margin-top: 20px;
}
