/* Elpristabellen - Dark Theme Design */

:root {
  /* Dark Theme Colors */
  --bg-primary: #0a0e27;
  --bg-secondary: #141b2d;
  --bg-tertiary: #1a2332;
  --bg-elevated: #1f2937;

  --text-primary: #e5e7eb;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;

  --accent-primary: #3b82f6;
  --accent-primary-hover: #2563eb;
  --accent-secondary: #8b5cf6;

  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;

  --border-color: #374151;
  --border-light: #2d3748;

  --layout-gap: 24px;
  --ad-placeholder-bg: #1f2937;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.5);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.6);
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  color: var(--text-primary);
  margin: 0;
  min-height: 100vh;
  line-height: 1.6;
}

/* Header and Navigation */
.page-header {
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-color);
  padding: 16px 24px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.primary-nav {
  margin: 0 auto;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
}

.primary-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 8px;
  transition: all 0.3s ease;
  letter-spacing: 0.025em;
}

.primary-nav a:hover {
  background: rgba(59, 130, 246, 0.1);
  color: var(--accent-primary);
  transform: translateY(-1px);
}

.primary-nav a[aria-current="page"] {
  background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
  color: white;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Layout */
.layout {
  padding: 24px;
}

/* Only add margin for sidebar on wide enough screens */
@media (min-width: 1400px) {
  .layout {
    margin-right: 350px; /* Space for fixed sidebar */
  }
}

.content {
  width: 100%;
  animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 16px 0;
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.lead {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  line-height: 1.7;
}

.note {
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--bg-tertiary);
}

.note-success {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
  border-left: 3px solid var(--success);
}

.note-error {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
  border-left: 3px solid var(--danger);
}

/* Contact Form */
.contact-list {
  padding-left: 20px;
  margin-bottom: 24px;
}

.contact-list li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.contact-list li a {
  color: var(--accent-primary);
  text-decoration: none;
  transition: color 0.2s;
}

.contact-list li a:hover {
  color: var(--accent-primary-hover);
  text-decoration: underline;
}

.contact-list span {
  font-weight: 600;
  display: inline-block;
  min-width: 70px;
  color: var(--text-primary);
}

label {
  font-weight: 600;
  color: var(--text-primary);
  display: block;
  margin-bottom: 8px;
}

input,
textarea {
  width: 100%;
  max-width: 640px;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  transition: all 0.3s ease;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--text-muted);
}

textarea {
  min-height: 140px;
  resize: vertical;
}

form {
  margin-top: 20px;
  display: grid;
  gap: 20px;
  max-width: 640px;
}

.form-actions {
  margin-top: 8px;
}

.button-primary {
  background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
  color: white;
  border: none;
  border-radius: 8px;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.button-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.button-primary:active {
  transform: translateY(0);
}

/* Sidebar and Ads */
.sidebar {
  width: 320px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-shrink: 0;
  z-index: 100;
  margin: 24px auto 0;
}

/* Only fix sidebar on screens wide enough (1400px+) */
@media (min-width: 1400px) {
  .sidebar {
    position: fixed;
    top: 80px;
    right: 10px;
    margin: 0;
  }
}

.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: 0;
  background: var(--ad-placeholder-bg);
  color: var(--text-muted);
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.ad-slot.filled {
  background: transparent;
  color: inherit;
  border-color: transparent;
}

.ad-slot::before {
  content: 'Advertisement';
  position: absolute;
  top: 8px;
  left: 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

.ad-slot .ad-close {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  border-radius: 6px;
  font-size: 11px;
  line-height: 1;
  padding: 4px 8px;
  cursor: pointer;
  z-index: 2;
  transition: all 0.2s ease;
  font-weight: 600;
}

.ad-slot .ad-close:hover {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: white;
  transform: scale(1.05);
}

.ad-slot .ad-placeholder {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.ad-slot.closed {
  background: var(--ad-placeholder-bg);
  color: var(--text-muted);
}

.ad-slot.closed::before {
  content: 'Ad closed';
  color: var(--text-muted);
}

.ad-slot.closed .ad-close {
  display: none;
}

.sidebar .ad-slot {
  width: 300px;
  height: 250px;
  max-width: 100%;
}

/* Content Sections (About page) */
.content-section {
  margin-bottom: 32px;
  padding: 24px;
  background: var(--bg-elevated);
  border-radius: 12px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.content-section h2 {
  margin: 0 0 16px 0;
  font-size: 1.75rem;
  color: var(--text-primary);
  font-weight: 700;
}

.content-section h3 {
  margin: 20px 0 12px 0;
  font-size: 1.25rem;
  color: var(--accent-primary);
  font-weight: 600;
}

.content-section p {
  margin-bottom: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.content-section ul {
  padding-left: 24px;
  line-height: 1.8;
}

.content-section ul li {
  margin-bottom: 10px;
  color: var(--text-secondary);
}

.content-section strong {
  color: var(--text-primary);
}

.content-section code {
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
  color: var(--accent-primary);
}

.warning-box {
  background: rgba(245, 158, 11, 0.1);
  border-left: 4px solid var(--warning);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 8px;
  color: var(--warning);
}

.warning-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05em;
}

.info-box {
  background: rgba(59, 130, 246, 0.1);
  border-left: 4px solid var(--accent-primary);
  padding: 16px 20px;
  margin: 20px 0;
  border-radius: 8px;
  color: var(--accent-primary);
}

.info-box strong {
  display: block;
  margin-bottom: 8px;
  font-size: 1.05em;
}

/* Responsive Design */

/* Very wide screens - more breathing room from edge */
@media (min-width: 1505px) {
  .sidebar {
    right: 30px;
  }

  .layout {
    margin-right: 380px;
  }
}

/* Medium-wide screens - slightly more space */
@media (min-width: 1400px) and (max-width: 1504px) {
  .sidebar {
    right: 20px;
  }

  .layout {
    margin-right: 370px;
  }
}

/* Below 1400px - sidebar goes to bottom */
@media (max-width: 1399px) {
  .sidebar {
    position: static !important;
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    margin: 24px auto 0;
  }

  .layout {
    margin-right: 24px;
  }
}

@media (max-width: 960px) {
  .sidebar .ad-slot {
    width: 280px;
    height: 230px;
  }

  #ad-right-2 {
    display: none;
  }

  h1 {
    font-size: 2rem;
  }
}

@media (max-width: 640px) {
  .layout {
    padding: 16px;
  }

  .sidebar {
    gap: 12px;
  }

  .sidebar .ad-slot {
    width: 260px;
    height: 200px;
  }

  h1 {
    font-size: 1.75rem;
  }

  .lead {
    font-size: 1rem;
  }
}
