/* Eventer - Flat Boxy Design System */

/* ===== CSS Variables ===== */
:root {
    /* Primary Colors */
    --bg-cream: #F5ECD7;
    --bg-white: #FFFEF9;
    --accent-orange: #E9A820;
    --accent-orange-hover: #D4950A;
    --accent-orange-light: #FEF4D9;

    /* Text Colors */
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-muted: #7A7A7A;

    /* UI Colors - Strong borders */
    --border-color: #1A1A1A;
    --border-light: #C5C0B0;

    /* Status Colors */
    --success: #2E7D32;
    --success-bg: #E8F5E9;
    --error: #C62828;
    --error-bg: #FFEBEE;
    --warning: #E65100;
    --warning-bg: #FFF3E0;
    --info: #1565C0;
    --info-bg: #E3F2FD;
}

/* ===== Reset & Base ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-cream);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

p { margin-bottom: 1rem; }

a {
    color: var(--text-primary);
    text-decoration: underline;
}

a:hover {
    color: var(--accent-orange-hover);
}

code {
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 0.85rem;
    background: var(--bg-white);
    padding: 3px 8px;
    border: 2px solid var(--border-color);
}

/* ===== Header ===== */
header {
    background: var(--bg-white);
    border-bottom: 2px solid var(--border-color);
    padding: 0 20px;
    margin-bottom: 30px;
}

header .header-inner {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

header h1 {
    margin: 0;
}

header h1 a {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    text-decoration: none;
}

header h1 a:hover {
    color: var(--accent-orange-hover);
}

nav {
    display: flex;
    gap: 4px;
}

nav a {
    padding: 10px 18px;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 400;
    border: 2px solid transparent;
    background: transparent;
}

nav a:hover {
    background: var(--accent-orange);
    border-color: var(--border-color);
}

/* ===== Main Content ===== */
main {
    min-height: 60vh;
}

/* ===== Buttons ===== */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: var(--accent-orange);
    color: var(--text-primary);
    text-decoration: none;
    border: 2px solid var(--border-color);
    cursor: pointer;
    font-size: 1rem;
    font-family: inherit;
    font-weight: 500;
}

.btn:hover {
    background: var(--accent-orange-hover);
    color: var(--text-primary);
}

.btn-secondary {
    background: var(--bg-white);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

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

.btn-outline {
    background: transparent;
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-outline:hover {
    background: var(--accent-orange-light);
}

.btn-danger {
    background: var(--error);
    border-color: var(--border-color);
    color: white;
}

.btn-danger:hover {
    background: #B71C1C;
}

/* ===== Forms ===== */
form {
    max-width: 500px;
}

form.form-wide {
    max-width: 100%;
}

label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    margin-bottom: 18px;
    border: 2px solid var(--border-color);
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-primary);
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: var(--accent-orange);
    background: var(--accent-orange-light);
}

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

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

/* Search Input Style */
.search-input {
    background: var(--accent-orange-light);
    border-color: var(--accent-orange);
}

.search-input:focus {
    background: var(--bg-white);
    border-color: var(--border-color);
}

/* ===== Cards ===== */
.card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    padding: 20px;
    margin-bottom: 16px;
}

.card:hover {
    background: var(--accent-orange-light);
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card h3 a {
    text-decoration: none;
}

.card h3 a:hover {
    color: var(--accent-orange-hover);
}

.card p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.card .meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Event Card specific */
.event-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    padding: 20px;
    margin-bottom: 16px;
    position: relative;
}

.event-card:hover {
    background: var(--accent-orange-light);
}

.event-card h3 {
    margin-bottom: 0.5rem;
}

.event-card h3 a {
    text-decoration: none;
    color: var(--text-primary);
}

.event-card h3 a:hover {
    color: var(--accent-orange-hover);
}

.event-card p {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.event-card .meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Page Header ===== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 15px;
    flex-wrap: wrap;
}

.page-header h2 {
    margin: 0;
}

/* ===== RSVP Buttons ===== */
.rsvp-options {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin: 24px 0;
}

.rsvp-btn {
    padding: 16px 32px;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
    cursor: pointer;
    font-size: 1.1rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text-primary);
}

.rsvp-btn:hover {
    background: var(--accent-orange-light);
}

.rsvp-btn.selected {
    background: var(--accent-orange);
    color: var(--text-primary);
}

/* ===== Toast Notifications ===== */
.toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.toast {
    padding: 14px 20px;
    border: 2px solid var(--border-color);
    font-weight: 400;
    opacity: 0;
    transform: translateX(100%);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    background: var(--success-bg);
    color: var(--success);
}

.toast.error {
    background: var(--error-bg);
    color: var(--error);
}

.toast.info {
    background: var(--info-bg);
    color: var(--info);
}

.toast.warning {
    background: var(--warning-bg);
    color: var(--warning);
}

/* Standalone success class for inline use */
.success {
    background: var(--success-bg);
    color: var(--success);
}

/* ===== Error Display ===== */
.error {
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.errorlist {
    list-style: none;
    color: var(--error);
    font-size: 0.9rem;
    margin-bottom: 10px;
    padding: 12px 16px;
    background: var(--error-bg);
    border: 2px solid var(--error);
}

/* ===== Tables ===== */
.table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
}

.table th {
    padding: 14px 16px;
    text-align: left;
    background: var(--accent-orange);
    font-weight: 500;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
}

.table tr:last-child td {
    border-bottom: none;
}

.table tr:hover td {
    background: var(--accent-orange-light);
}

.table .actions {
    text-align: right;
    white-space: nowrap;
}

.table .actions a {
    margin-left: 12px;
}

.delete-link {
    color: var(--error) !important;
}

/* ===== Tabs ===== */
.tab-nav {
    display: flex;
    gap: 0;
    margin: 20px 0;
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    padding: 0;
    overflow: hidden;
}

.tab-btn {
    flex: 1;
    padding: 14px 20px;
    background: var(--bg-white);
    border: none;
    border-right: 2px solid var(--border-color);
    font-size: 1rem;
    font-family: inherit;
    cursor: pointer;
    color: var(--text-secondary);
    font-weight: 400;
}

.tab-btn:last-child {
    border-right: none;
}

.tab-btn:hover {
    background: var(--accent-orange-light);
    color: var(--text-primary);
}

.tab-btn.active {
    background: var(--accent-orange);
    color: var(--text-primary);
    font-weight: 500;
}

/* ===== Panels ===== */
.panel-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    padding: 24px;
}

/* ===== Info Box ===== */
.info-box {
    padding: 20px;
    background: var(--accent-orange-light);
    border: 2px solid var(--accent-orange);
    margin: 20px 0;
}

.info-box p {
    margin: 0;
}

.info-box p + p {
    margin-top: 8px;
}

/* ===== Share Link Box ===== */
.share-box {
    margin-top: 24px;
    padding: 16px;
    background: var(--bg-cream);
    border: 2px solid var(--border-color);
}

.share-box .meta {
    margin: 0 0 6px 0;
    font-weight: 600;
}

/* ===== Guest List Item ===== */
.guest-list {
    border: 2px solid var(--border-color);
    overflow: hidden;
    background: var(--bg-white);
}

.guest-item {
    padding: 14px 18px;
    border-bottom: 2px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.guest-item:last-child {
    border-bottom: none;
}

.guest-item:hover {
    background: var(--accent-orange-light);
}

.guest-name {
    font-weight: 500;
}

.guest-channel {
    font-size: 0.8rem;
    background: var(--accent-orange-light);
    padding: 4px 12px;
    border: 2px solid var(--accent-orange);
    color: var(--text-secondary);
    margin-left: 10px;
}

.guest-status {
    font-size: 0.9rem;
    font-weight: 500;
}

.guest-status.going { color: var(--success); }
.guest-status.not-going { color: var(--text-muted); }
.guest-status.maybe { color: var(--warning); }
.guest-status.pending { color: var(--text-muted); }

/* ===== Contact Cards (Mobile) ===== */
.contact-card {
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    padding: 18px;
    margin-bottom: 14px;
}

.contact-card:hover {
    background: var(--accent-orange-light);
}

.contact-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.contact-card-name {
    font-weight: 500;
    font-size: 1.1rem;
}

.contact-card-channel {
    font-size: 0.8rem;
    background: var(--accent-orange-light);
    padding: 4px 12px;
    color: var(--text-secondary);
    border: 2px solid var(--accent-orange);
}

.contact-card-details {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 14px;
}

.contact-card-details div {
    margin-bottom: 4px;
}

.contact-card-actions {
    display: flex;
    gap: 16px;
}

/* ===== Empty State ===== */
.empty-state {
    padding: 40px;
    text-align: center;
    background: var(--bg-white);
    border: 3px dashed var(--border-color);
}

.empty-state p {
    color: var(--text-secondary);
    margin: 0;
}

/* ===== Checkbox List ===== */
.checkbox-list {
    max-height: 220px;
    overflow-y: auto;
    border: 2px solid var(--border-color);
    background: var(--bg-white);
}

.checkbox-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border-light);
    cursor: pointer;
}

.checkbox-item:last-child {
    border-bottom: none;
}

.checkbox-item:hover {
    background: var(--accent-orange-light);
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0 12px 0 0;
    accent-color: var(--accent-orange);
    transform: scale(1.2);
}

.checkbox-item label {
    font-weight: normal;
    margin: 0;
    flex: 1;
    cursor: pointer;
}

.checkbox-item .channel {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* ===== Two Column Layout ===== */
.two-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-top: 24px;
}

/* ===== Status Badges ===== */
.status-badge {
    padding: 6px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 2px solid var(--border-color);
}
.status-badge.going { background: var(--success-bg); color: var(--success); }
.status-badge.not-going { background: var(--bg-cream); color: var(--text-muted); }
.status-badge.maybe { background: var(--warning-bg); color: var(--warning); }
.status-badge.pending { background: var(--bg-cream); color: var(--text-muted); }
.status-badge.completed { background: var(--success-bg); color: var(--success); }

/* ===== Attention Badge ===== */
.attention-badge {
    position: absolute;
    top: -10px;
    right: -10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    background: var(--accent-orange);
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 600;
    border: 2px solid var(--border-color);
    text-decoration: none;
}

a.attention-badge:hover {
    background: var(--accent-orange-hover);
    color: var(--text-primary);
}

/* ===== Attendee List ===== */
.attendee-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.attendee-chip {
    display: inline-block;
    padding: 8px 14px;
    background: var(--success-bg);
    color: var(--success);
    border: 2px solid var(--success);
    font-size: 0.9rem;
    font-weight: 500;
}

/* ===== Message Bubbles ===== */
.message-bubble {
    margin-bottom: 16px;
    padding: 16px;
    border: 2px solid var(--border-color);
}

.message-bubble.inbound {
    background: var(--accent-orange-light);
    margin-right: 60px;
    border-left: 4px solid var(--accent-orange);
}

.message-bubble.outbound {
    background: var(--bg-white);
    margin-left: 60px;
    border-left: 4px solid var(--border-light);
}

/* ===== Utility Classes ===== */
.meta {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mt-1 { margin-top: 8px; }
.mb-1 { margin-bottom: 8px; }
.mt-2 { margin-top: 16px; }
.mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; }
.mb-3 { margin-bottom: 24px; }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    header .header-inner {
        flex-direction: column;
        gap: 16px;
        padding: 16px 0;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .two-column {
        display: block;
    }

    .two-column > * + * {
        margin-top: 30px;
    }

    .page-header {
        flex-direction: column;
        align-items: stretch;
    }

    .page-header .btn {
        text-align: center;
    }

    .message-bubble.inbound {
        margin-right: 20px;
    }

    .message-bubble.outbound {
        margin-left: 20px;
    }
}

@media (max-width: 600px) {
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }

    .rsvp-btn {
        flex: 1;
        min-width: 100px;
    }

    .table {
        display: none;
    }

    .toast-container {
        left: 20px;
        right: 20px;
        max-width: none;
    }
}
