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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

header {
    background-color: #1e3a8a;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 1.5rem;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 1rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

main {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 2rem;
}

h2 {
    margin-bottom: 1.5rem;
    color: #1e3a8a;
}

.events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.event-card {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s, box-shadow 0.2s;
}

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

.event-card h3 {
    color: #1e3a8a;
    margin-bottom: 0.5rem;
}

.event-date {
    font-weight: bold;
    color: #666;
    margin-bottom: 0.5rem;
}

.event-location {
    color: #666;
    margin-bottom: 0.5rem;
}

.event-description {
    color: #555;
    margin: 1rem 0;
}

.event-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #1e3a8a;
    margin: 1rem 0;
}

.event-age {
    color: #666;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary {
    background-color: #1e3a8a;
    color: white;
}

.btn-primary:hover {
    background-color: #1e40af;
}

.btn-secondary {
    background-color: #6b7280;
    color: white;
}

.btn-secondary:hover {
    background-color: #4b5563;
}

.registration-form {
    background: white;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
textarea,
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: #1e3a8a;
    box-shadow: 0 0 0 3px rgba(30, 58, 138, 0.1);
}

.participant-form {
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.participant-form h4 {
    margin-bottom: 1rem;
    color: #1e3a8a;
}

.btn-remove {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: #ef4444;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
}

.btn-remove:hover {
    background-color: #dc2626;
}

.age-validation {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.age-validation.error {
    color: #ef4444;
}

.age-validation.valid {
    color: #10b981;
}

.error-message {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.error-message:empty {
    display: none;
}

.error {
    color: #ef4444;
}

.event-info {
    margin-bottom: 2rem;
}

#add-participant-btn {
    margin-bottom: 1.5rem;
}

/* Unified events page */

.event-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.event-card-header h3 {
    flex: 1;
    margin-bottom: 0;
}

.expand-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    cursor: pointer;
    color: #1e3a8a;
    font-weight: 500;
    font-size: 0.9rem;
    user-select: none;
}

.expand-toggle:hover {
    color: #1e40af;
}

.expand-icon {
    font-size: 0.75rem;
    transition: transform 0.2s;
}

.expand-icon.expanded {
    transform: rotate(90deg);
}

.expand-label {
    font-size: 0.9rem;
}

.event-summary {
    display: flex;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    background-color: #e5e7eb;
    color: #374151;
}

.badge-created {
    background-color: #dbeafe;
    color: #1e40af;
}

.badge-paid {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-ok {
    background-color: #d1fae5;
    color: #065f46;
}

.badge-pending {
    background-color: #e5e7eb;
    color: #6b7280;
}

.badge-expired {
    background-color: #fee2e2;
    color: #991b1b;
}

.badge-cancelled {
    background-color: #e5e7eb;
    color: #4b5563;
}

.badge-none {
    background-color: #f3f4f6;
    color: #9ca3af;
}

.badge-clickable {
    cursor: pointer;
    transition: opacity 0.2s;
}

.badge-clickable:hover {
    opacity: 0.8;
}

.status-dropdown {
    padding: 0.25rem;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-size: 0.85rem;
    margin-left: 0.25rem;
}

.registrations-section {
    margin-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
    padding-top: 1rem;
}

.registrations-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    gap: 0.5rem;
}

.registrations-header h4 {
    color: #1e3a8a;
    margin: 0;
}

.registrations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.registrations-table th,
.registrations-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid #e5e7eb;
}

.registrations-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #374151;
}

.registrations-table tr:hover {
    background-color: #f9fafb;
}

.actions-cell {
    white-space: nowrap;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.8rem;
}

.btn-danger {
    background-color: #ef4444;
    color: white;
}

.btn-danger:hover {
    background-color: #dc2626;
}

.event-card-footer {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.settings-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem 2rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
    max-width: 600px;
}

.success-message {
    background-color: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

/* Event Series Styles */

.badge-series {
    background-color: #ede9fe;
    color: #5b21b6;
}

.series-card {
    border-left: 4px solid #7c3aed;
}

.series-schedule {
    color: #7c3aed;
    font-weight: 500;
    margin: 0.5rem 0;
}

.series-dates-preview {
    margin: 1rem 0;
    padding: 0.75rem;
    background-color: #f9fafb;
    border-radius: 4px;
}

.series-dates-preview ul {
    margin: 0.5rem 0 0 1.5rem;
    padding: 0;
}

.series-dates-preview li {
    margin: 0.25rem 0;
    color: #374151;
}

/* Admin Tabs */

.admin-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.5rem;
    border-bottom: 2px solid #e5e7eb;
}

.admin-tab {
    padding: 0.75rem 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    color: #6b7280;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.admin-tab.active {
    color: #1e3a8a;
    border-bottom-color: #1e3a8a;
    font-weight: 500;
}

.admin-tab:hover {
    color: #1e3a8a;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Recurrence Builder */

.recurrence-builder {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    padding: 1rem;
    background-color: #f9fafb;
    border-radius: 4px;
}

.recurrence-builder select {
    width: auto;
    min-width: 100px;
}

.recurrence-builder label {
    margin: 0;
    font-weight: normal;
}

/* Series Registration Success */

.registered-events-list,
.skipped-events-list {
    margin: 0.5rem 0 0 1.5rem;
}

.skipped-events-notice {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #fef3c7;
    border-radius: 4px;
}

/* Section Headers */

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    margin-bottom: 0;
}

/* Modal styles */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 2rem;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.close {
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    font-size: 1.75rem;
    color: #6b7280;
    cursor: pointer;
}

.close:hover {
    color: #374151;
}

/* Job notice */

.job-notice {
    background-color: #dbeafe;
    color: #1e40af;
    padding: 0.75rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    font-weight: 500;
}

/* Table responsive wrapper */

.table-responsive {
    overflow-x: auto;
}
