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

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

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

.card {
    background: white;
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
}

.btn:hover {
    background: #0056b3;
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #545b62;
}

.form-group {
    margin-bottom: 16px;
}

label {
    display: block;
    margin-bottom: 4px;
    font-weight: 500;
}

input,
textarea,
select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

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

.map-container {
    height: 300px;
    border-radius: 4px;
    overflow: hidden;
    margin: 16px 0;
}

.participant-list {
    list-style: none;
}

.participant-item {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
}

.status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-registered {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

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

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin: 16px 0;
}

.phone-input-container {
    display: flex;
    gap: 8px;
}

.country-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 220px;
    min-width: 220px;
}

.flag-icon {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    border: 1px solid #ddd;
}

.country-select {
    flex: 1;
    min-width: 180px;
}

.phone-input {
    flex: 1;
}

.phone-preview {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.invite-code-input {
    font-family: monospace;
    font-size: 16px;
    letter-spacing: 2px;
    text-align: center;
}

.form-hint {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
    text-align: center;
}

/* Events list styling for home page */
.events-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.event-item {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
    transition:
        box-shadow 0.2s,
        border-color 0.2s;
}

.event-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    border-color: #007bff;
}

.event-item h3 {
    margin: 0 0 12px 0;
    color: #333;
}

.event-item h3 a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.event-item h3 a:hover {
    text-decoration: underline;
    color: #0056b3;
}

.event-item p {
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.4;
}

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

/* Admin Dashboard Styling */
.admin-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
}

.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.admin-header-left {
    flex: 1;
}

.admin-header-center {
    flex: 2;
    text-align: center;
}

.admin-header-right {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.admin-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
}

.admin-greeting {
    margin: 4px 0 0 0;
    opacity: 0.9;
    font-size: 14px;
}

.back-button {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.2);
    transition: background 0.2s;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    text-decoration: none;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3) !important;
}

.admin-content {
    padding: 24px;
}

.admin-actions {
    margin-bottom: 32px;
    display: flex;
    justify-content: center;
}

.create-event-btn {
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
}

.admin-events-section h2 {
    margin-bottom: 24px;
    text-align: center;
    color: #333;
}

.admin-events-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.admin-event-card {
    background: white;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border: 1px solid #e0e0e0;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
}

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

.event-status {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.status-active {
    background: #d4edda;
    color: #155724;
}

.status-cancelled {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-draft {
    background: #fff3cd;
    color: #856404;
}

.admin-event-card .event-link {
    text-decoration: none;
    color: inherit;
}

.admin-event-card .event-link:hover {
    color: #007bff;
}

.admin-event-card h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.event-details p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.event-actions {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 14px;
}

.btn-outline {
    background: transparent;
    border: 1px solid #007bff;
    color: #007bff;
}

.btn-outline:hover {
    background: #007bff;
    color: white;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    margin-bottom: 20px;
    font-size: 16px;
}

.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

/* Preserve line breaks in multiline text */
.multiline-text {
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Form help text */
.form-help {
    display: block;
    margin-top: 4px;
    color: #666;
    font-size: 12px;
    font-style: italic;
}

/* ProseMirror/Tiptap Editor Styles */
.ProseMirror {
    position: relative;
    word-wrap: break-word;
    white-space: pre-wrap;
    white-space: break-spaces;
    -webkit-font-variant-ligatures: none;
    font-variant-ligatures: none;
    font-feature-settings: "liga" 0; /* the above doesn't seem to work in Edge */
    outline: none;
    min-height: 100px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.ProseMirror:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.ProseMirror p {
    margin: 0 0 12px 0;
}

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

.ProseMirror h1,
.ProseMirror h2,
.ProseMirror h3,
.ProseMirror h4,
.ProseMirror h5,
.ProseMirror h6 {
    margin: 0 0 12px 0;
    font-weight: 600;
}

.ProseMirror h1 {
    font-size: 1.8em;
}
.ProseMirror h2 {
    font-size: 1.5em;
}
.ProseMirror h3 {
    font-size: 1.3em;
}
.ProseMirror h4 {
    font-size: 1.1em;
}
.ProseMirror h5 {
    font-size: 1em;
}
.ProseMirror h6 {
    font-size: 0.9em;
}

.ProseMirror ul,
.ProseMirror ol {
    margin: 0 0 12px 0;
    padding-left: 24px;
}

.ProseMirror li {
    margin-bottom: 6px;
}

.ProseMirror blockquote {
    margin: 12px 0;
    padding-left: 16px;
    border-left: 3px solid #ddd;
    color: #666;
    font-style: italic;
}

.ProseMirror pre {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 4px;
    overflow-x: auto;
    font-family: Monaco, Consolas, "Courier New", monospace;
    font-size: 13px;
}

.ProseMirror code {
    background: #f8f9fa;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: Monaco, Consolas, "Courier New", monospace;
    font-size: 13px;
}

.ProseMirror pre code {
    background: none;
    padding: 0;
}

.ProseMirror strong {
    font-weight: 700;
}

.ProseMirror em {
    font-style: italic;
}

.ProseMirror a {
    color: #007bff;
    text-decoration: underline;
}

.ProseMirror a:hover {
    color: #0056b3;
}

/* Rich text editor container */
.rich-editor-container {
    position: relative;
}

.rich-editor-container .ProseMirror {
    border: 1px solid #ddd;
    border-radius: 4px;
}

.rich-editor-container .ProseMirror:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Animated Participant Count Styles */
.participant-count-container {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.participant-count {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.participant-count-up {
    background: #d4edda;
    color: #155724;
    animation: highlight-green 2s ease-out;
    transform: scale(1.1);
    font-weight: 600;
}

.participant-count-down {
    background: #f8d7da;
    color: #721c24;
    animation: highlight-red 2s ease-out;
    transform: scale(1.1);
    font-weight: 600;
}

.count-arrow {
    font-size: 14px;
    font-weight: bold;
    animation: bounce-arrow 1s ease-out;
}

.count-arrow-up {
    color: #28a745;
}

.count-arrow-down {
    color: #dc3545;
}

.max-participants {
    color: #666;
}

@keyframes highlight-green {
    0% {
        background: #d4edda;
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(40, 167, 69, 0.4);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        background: transparent;
        transform: scale(1);
        box-shadow: none;
    }
}

@keyframes highlight-red {
    0% {
        background: #f8d7da;
        transform: scale(1.2);
        box-shadow: 0 0 8px rgba(220, 53, 69, 0.4);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        background: transparent;
        transform: scale(1);
        box-shadow: none;
    }
}

@keyframes bounce-arrow {
    0%,
    100% {
        transform: translateY(0);
        opacity: 1;
    }
    25% {
        transform: translateY(-3px);
        opacity: 0.8;
    }
    50% {
        transform: translateY(-5px);
        opacity: 0.9;
    }
    75% {
        transform: translateY(-2px);
        opacity: 1;
    }
}
