* {
    box-sizing: border-box;
}

:root {
    --max-width: 1350px;

    /* Light mode colors (default) */
    --bg-primary: #f5f5f5;
    --bg-secondary: #fff;
    --bg-tertiary: #f9f9f9;
    --text-primary: #333;
    --text-secondary: #555;
    --text-muted: #666;
    --text-light: #999;
    --border-color: #ddd;
    --border-light: #ccc;
    --card-shadow: rgba(0, 0, 0, 0.08);
    --link-color: #007bff;
    --link-hover: #0056b3;
    --button-hover-shadow: rgba(0, 0, 0, 0.15);
    --header-overlay: rgba(44, 62, 80, 0.85);
    --header-overlay-2: rgba(52, 73, 94, 0.85);
    --header-border: #888;

    /* Button colors */
    --btn-secondary-bg: #6c757d;
    --btn-secondary-hover: #545b62;
    --btn-success-bg: #28a745;
    --btn-success-hover: #218838;
    --btn-warning-bg: #ff9800;

    /* Accent colors */
    --accent-color: #4a90e2;

    /* Gradient colors */
    --gradient-top-color: rgba(74, 144, 226, 0.22);
    --gradient-mid-color: rgba(52, 152, 219, 0.15);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-primary: #1a1a1a;
        --bg-secondary: #2d2d2d;
        --bg-tertiary: #242424;
        --text-primary: #e0e0e0;
        --text-secondary: #b0b0b0;
        --text-muted: #888;
        --text-light: #666;
        --border-color: #444;
        --border-light: #555;
        --card-shadow: rgba(0, 0, 0, 0.3);
        --link-color: #5ba3ff;
        --link-hover: #7bb8ff;
        --button-hover-shadow: rgba(0, 0, 0, 0.4);
        --header-overlay: rgba(20, 30, 40, 0.9);
        --header-overlay-2: rgba(30, 45, 60, 0.9);
        --header-border: #444;

        /* Gradient colors for dark mode */
        --gradient-top-color: rgba(91, 163, 255, 0.225);
        --gradient-mid-color: rgba(123, 184, 255, 0.12);
    }
}

body {
    font-family: Arial, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    margin: 0;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
}

/* Gradient backgrounds */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 75vh;
    background: radial-gradient(ellipse at center top, var(--gradient-top-color) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

body::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 0;
    right: 0;
    height: 60vh;
    background: radial-gradient(ellipse at center, var(--gradient-mid-color) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

a {
    color: var(--link-color);
}

header {
    background: linear-gradient(135deg, var(--header-overlay) 0%, var(--header-overlay-2) 100%);
    color: white;
    padding: 2rem;
    box-shadow: 0 4px 12px var(--button-hover-shadow);
    border-bottom: 1px solid var(--header-border);
    position: relative;
    box-sizing: border-box;
}

.header-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('/static/img/website1-1280.png') center/cover no-repeat;
    z-index: 0;
}


header h1 {
    margin: 0;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-shadow: 2px 2px 8px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease;
    position: relative;
    z-index: 1;
}

header h1 a {
    color: inherit;
    text-decoration: none;
    transition: transform 0.2s ease;
    display: inline-block;
}

header h1 a:hover {
    transform: scale(1.02);
}

header h1:hover {
    transform: scale(1.02);
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 1;
    gap: 20px;
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    width: 100%;
    box-sizing: border-box;
}

.header-container h1 {
    margin: 0;
}

/* Header actions - search bar and buttons */
.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

/* Search bar styling */
.search-bar {
    display: flex;
    gap: 8px;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    padding: 8px 12px;
    border-radius: 6px;
    box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
    .search-bar {
        background: rgba(60, 60, 60, 0.9);
    }
}

.search-input {
    border: none;
    padding: 8px 12px;
    font-size: 0.95em;
    background: transparent;
    color: #333;
    min-width: 200px;
    outline: none;
    box-sizing: border-box;
}

@media (prefers-color-scheme: dark) {
    .search-input {
        color: #e0e0e0;
    }

    .search-input::placeholder {
        color: #888;
    }
}

.search-input::placeholder {
    color: #999;
}

.search-bar .btn {
    padding: 8px 14px;
    font-size: 0.9em;
    white-space: nowrap;
}

/* Unified button styles */
.btn {
    display: inline-block;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    border: none;
    cursor: pointer;
    text-align: center;
    line-height: 1.4;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Primary button - blue (default) */
.btn,
.btn-primary {
    background-color: var(--link-color);
    color: white;
}

.btn:hover,
.btn-primary:hover {
    background-color: var(--link-hover);
}

/* Secondary button - gray */
.btn-secondary {
    background-color: var(--btn-secondary-bg);
    color: white;
}

.btn-secondary:hover {
    background-color: var(--btn-secondary-hover);
}

/* Success button - green (for add/create actions) */
.btn-success {
    background-color: var(--btn-success-bg);
    color: white;
}

.btn-success:hover {
    background-color: var(--btn-success-hover);
}

footer {
    background: var(--bg-primary);
    border-top: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 2rem;
    text-align: center;
    box-sizing: border-box;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    font-size: 0.9em;
    color: var(--text-muted);
}

.footer-content a {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.footer-content a:hover {
    color: var(--link-color);
}

.footer-content .separator {
    margin: 0 0.5em;
    color: var(--border-light);
}

main {
    padding: 2rem;
    box-sizing: border-box;
}

/* Search results header */
.search-results-header {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.08) 0%, rgba(52, 152, 219, 0.08) 100%);
    border-left: 4px solid var(--link-color);
    border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    .search-results-header {
        background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(52, 152, 219, 0.15) 100%);
    }
}

.search-results-header h2 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.8rem;
}

.search-results-header p {
    margin: 0.75rem 0 1.5rem 0;
    color: var(--text-muted);
    font-size: 1.1em;
}

/* Introduction section */
.introduction {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.08) 0%, rgba(52, 152, 219, 0.08) 100%);
    border-left: 4px solid var(--link-color);
    border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    .introduction {
        background: linear-gradient(135deg, rgba(74, 144, 226, 0.15) 0%, rgba(52, 152, 219, 0.15) 100%);
    }
}

.introduction h2 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.8rem;
}

.introduction p {
    margin: 0.75rem 0;
    color: var(--text-secondary);
    line-height: 1.6;
}

.introduction p:last-child {
    margin-bottom: 0;
}

.introduction a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.introduction a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.search-results-header a:not(.btn) {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.search-results-header a:not(.btn):hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* Warning bar - no events available */
.warning-bar {
    max-width: 900px;
    margin: 0 auto 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.08) 0%, rgba(255, 152, 0, 0.08) 100%);
    border-left: 4px solid var(--btn-warning-bg);
    border-radius: 8px;
}

@media (prefers-color-scheme: dark) {
    .warning-bar {
        background: linear-gradient(135deg, rgba(255, 193, 7, 0.15) 0%, rgba(255, 152, 0, 0.15) 100%);
    }
}

.warning-bar h3 {
    margin-top: 0;
    color: var(--text-primary);
    font-size: 1.3rem;
}

.warning-bar p {
    margin: 0.75rem 0 1.5rem 0;
    color: var(--text-muted);
    font-size: 1.05em;
}

.warning-bar .btn-bookmark {
    display: inline-block;
    padding: 10px 16px;
    background-color: var(--btn-warning-bg);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95em;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

/* Organisation type filter */
.org-types-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  justify-content: center;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.org-type-link {
  padding: 8px 14px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: background-color 0.2s ease, color 0.2s ease;
}

.website-page .address {
  margin-top: 32px;
}

.website-page .address div {
  display: block;
}

.website-page .type-city .city {
  padding: 8px 14px;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 20px;
  font-size: 0.9em;
  font-weight: 500;
  border: 1px solid var(--border-color);
  display: inline-block;
}

.org-type-link:hover {
  background-color: var(--link-color);
  color: white;
  border-color: var(--link-color);
}

/* Grid container stays the same */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  padding: 20px;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

/* Pagination */
.pagination {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  max-width: var(--max-width);
  padding: 20px;
  margin: 1rem auto 0;
  width: 100%;
  box-sizing: border-box;
}

.pagination .btn {
  padding: 10px 16px;
  background-color: var(--link-color);
  color: white;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 500;
  font-size: 0.95em;
  transition: background-color 0.2s ease, transform 0.2s ease;
  border: none;
  cursor: pointer;
  text-align: center;
}

.pagination .btn:hover {
  background-color: var(--link-hover);
  transform: translateY(-2px);
}

/* Updated card class */
.website-card {
  background: var(--bg-secondary);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 18px var(--card-shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
}

.website-card:hover {
  transform: translateY(-4px);
}

.website-card .card-image {
  display: block;
  min-height: 200px;
  text-decoration: none;
}

.website-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  object-position: top;
  background-color: var(--bg-tertiary);
}

.website-card img.failed {
  background-color: var(--bg-tertiary);
}

.website-card .card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1 1 auto;
  text-decoration: none;
  color: inherit;
}

.website-card h3 {
  margin: 0;
  font-size: 1.5em;
  color: var(--text-primary);
}

.website-card .type-city {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
}

.website-card .type,
.website-card .city {
  font-size: 0.8em;
  color: var(--text-light);
  font-weight: 600;
  text-transform: uppercase;
  margin: 0;
}

.website-card .description {
  color: var(--text-secondary);
}

/* Events */
.website-card .events {
  list-style: none;
  padding: 0;
  margin: 10px 0;
}

.website-card .events li {
  margin-bottom: 6px;
  display: flex;
  flex-direction: column;
}

.website-card .date {
  font-weight: 600;
  color: var(--text-primary);
}

.website-card .event-name {
  color: var(--text-secondary);
}

.center {
    text-align: center;
}

.btn {
    padding: 10px 16px;
    text-align: center;
    border-radius: 4px;
    background-color: var(--link-color);
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}


.btn:hover {
    background-color: var(--link-hover);
}


/* Button at the bottom */
.website-card .btn {
    margin-top: auto;  /* this pushes the button to the bottom */
}


/* Container for the whole page */
.website-page {
    max-width: 900px;          /* same width as cards row on index */
    margin: 2rem auto;         /* center horizontally with spacing */
    padding: 1rem 2rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* Website title */
.website-page h1 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* Website image */
.website-page img {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    object-position: top;
    border-radius: 12px;
    margin-bottom: 1rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Website description */
.website-page p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    color: var(--text-secondary);
}

/* Events list */
.website-page ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Individual event */
.website-page ul li {
    background-color: var(--bg-tertiary);
    border-left: 4px solid var(--accent-color);   /* accent color like index cards */
    padding: 1rem;
    margin-bottom: 1rem;
    border-radius: 8px;
    transition: box-shadow 0.2s ease;
}

/* Hover effect on events */
.website-page ul li:hover {
    box-shadow: 0 4px 12px var(--button-hover-shadow);
}

/* Event date */
.website-page .date {
    display: block;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 0.25rem;
}

/* Event name */
.website-page .event-name {
    display: block;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Event description */
.website-page .event-description {
    display: block;
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}
.website-page .links {
    display: block;
    margin-top: 16px;
}

/* Responsive for mobile */
/* Static pages (terms of service, contact) */
.static-page {
    max-width: 900px;
    margin: 2rem auto;
    padding: 1rem 2rem;
    font-family: "Helvetica Neue", Arial, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

.static-page h1 {
    font-size: 2.2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.static-page h2 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.static-page p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.static-page ul {
    margin: 1rem 0;
    padding-left: 2rem;
}

.static-page ul li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* Form styling */
.add-event-form {
    max-width: 500px;
    margin: 2rem 0;
}

.form-group {
    margin-bottom: 1.5rem;
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    font-size: 0.95em;
}

.form-group input,
.form-group select {
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.95em;
    font-family: Arial, sans-serif;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: border-color 0.2s ease;
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--link-color);
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.2);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 2rem;
}

/* Form action buttons */
.form-actions .btn,
.form-actions .btn-primary,
.form-actions .btn-secondary {
    flex: 1;
}

@media (max-width: 768px) {
    main {
        padding: 1rem;
    }

    /* Header adjustments */
    .header-container {
        flex-direction: column;
        align-items: flex-start;
    }

    header h1 {
        font-size: 1.8rem;
    }

    .header-actions {
        flex-direction: column;
        width: 100%;
        padding-right: 50px;
    }

    .search-bar {
        width: 100%;
    }

    .search-bar .btn {
        display: none;
    }

    .search-input {
        width: 100%;
        min-width: 100%;
    }

    header .btn-success {
        position: absolute;
        top: 0;
        right: 0;
        width: auto;
        padding: 0px 2px;
        font-size: 0;
        min-width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    header .btn-success::before {
        content: '+';
        font-size: 24px;
        font-weight: 300;
    }

    /* Grid adjustments */
    .card-grid {
        grid-template-columns: 1fr;
        padding: 10px;
        gap: 18px;
    }

    .website-page {
        padding: 1rem;
    }

    .website-page h1 {
        font-size: 1.8rem;
    }

    .website-page ul li {
        padding: 0.75rem;
    }

    .static-page {
        padding: 1rem;
    }

    .static-page h1 {
        font-size: 1.8rem;
    }

    .introduction {
        border-left: none;
    }

    .search-results-header {
        padding: 1rem;
        border-left: none;
    }

    .website-page ul li {
        border-left: none;
    }
}

/* Breadcrumb navigation */
.breadcrumb-nav {
    background-color: transparent;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 2rem;
    font-size: 0.9em;
}

.breadcrumb-container {
    max-width: var(--max-width);
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.breadcrumb-nav a {
    color: var(--link-color);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb-nav a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

.breadcrumb-separator {
    color: var(--text-light);
    margin: 0 0.5rem;
}

.breadcrumb-current {
    color: var(--text-primary);
    font-weight: 500;
}

@media (max-width: 768px) {
    .breadcrumb-nav {
        padding: 0.5rem 1rem;
        font-size: 0.85em;
    }

    .breadcrumb-separator {
        margin: 0 0.25rem;
    }
}

