/* Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    line-height: 1.6;
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu,
        Cantarell, sans-serif;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    font-size: 1.5rem;
    font-weight: 700;
    color: #4a5568;
    text-decoration: none;
    transition: color 0.3s ease;
}

.logo a:hover {
    color: #667eea;
}

.nav {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    color: #4a5568;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.nav-link.logout {
    color: #e53e3e;
}

.nav-link.logout:hover {
    background: rgba(229, 62, 62, 0.1);
    color: #c53030;
}

/* Main Content */
.main {
    flex: 1;
    padding: 2rem 0;
}

/* Cards */
.login-card,
.form-card,
.status-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
    max-width: 500px;
    margin: 0 auto;
}

.login-container,
.form-container,
.status-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 60vh;
}

/* Login Styles */
.login-card h2,
.form-card h2,
.status-card h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
    text-align: center;
}

.login-description,
.form-description {
    color: #718096;
    text-align: center;
    margin-bottom: 2rem;
}

.success-icon {
    font-size: 3rem;
    text-align: center;
    color: #38a169;
    margin-bottom: 1rem;
}

.status-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

.success-message,
.status-message {
    color: #4a5568;
    text-align: center;
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.login-info,
.status-info {
    background: #f7fafc;
    border-left: 4px solid #667eea;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-top: 1.5rem;
}

.login-info p,
.status-info p {
    color: #4a5568;
    font-size: 0.875rem;
    margin: 0;
}

/* Forms */
.login-form,
.participant-form,
.edit-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-weight: 600;
    color: #2d3748;
    font-size: 0.875rem;
}

.form-label.required::after {
    content: " *";
    color: #e53e3e;
}

.form-input {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-input:disabled,
.form-input[readonly] {
    background: #f7fafc;
    color: #4a5568;
    cursor: not-allowed;
}

.form-help {
    color: #718096;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

/* Form Sections */
.form-section {
    background: #f7fafc;
    padding: 1.5rem;
    border-radius: 0.5rem;
    border: 1px solid #e2e8f0;
}

.form-section h3 {
    color: #2d3748;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

/* Checkboxes */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.checkbox-group:last-child {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    flex: 1;
}

.checkbox-input {
    width: 1.25rem;
    height: 1.25rem;
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.checkbox-text {
    color: #4a5568;
    font-weight: 500;
    line-height: 1.5;
}

.admin-checkbox .checkbox-text {
    color: #2d3748;
    font-weight: 600;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
    text-align: center;
    min-width: 120px;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    color: #2d3748;
}

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

.btn-danger:hover {
    background: #c53030;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(229, 62, 62, 0.4);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: auto;
}

.form-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 1rem;
}

.status-actions {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

/* Messages */
.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #feb2b2;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

.info-message {
    background: #bee3f8;
    color: #2c5282;
    padding: 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid #90cdf4;
    margin-bottom: 1rem;
    text-align: center;
    font-weight: 500;
}

/* List Styles */
.list-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.list-header {
    text-align: center;
    margin-bottom: 2rem;
}

.list-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.list-description {
    color: #718096;
    font-size: 1.1rem;
}

.empty-state {
    text-align: center;
    color: #718096;
    font-size: 1.1rem;
    padding: 3rem;
}

/* Participant Grid */
.participant-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.participant-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.participant-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.participant-header {
    margin-bottom: 1rem;
}

.participant-name {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.participant-old-name {
    color: #718096;
    font-size: 0.875rem;
}

.participant-info {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.participant-status {
    flex-wrap: wrap;
    gap: 0.5rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.status-attending {
    background: #c6f6d5;
    color: #22543d;
}

.status-uncertain {
    background: #fed7d7;
    color: #742a2a;
}

.status-wants-info {
    background: #bee3f8;
    color: #2c5282;
}

.status-public {
    background: #e9d8fd;
    color: #553c9a;
}

.contact-link {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.contact-link:hover {
    text-decoration: underline;
}

.list-stats {
    text-align: center;
    color: #718096;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f7fafc;
    border-radius: 0.5rem;
}

.list-actions {
    display: flex;
    justify-content: center;
}

/* Admin Styles */
.admin-container {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow:
        0 20px 25px -5px rgba(0, 0, 0, 0.1),
        0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

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

.admin-header h2 {
    font-size: 2rem;
    font-weight: 700;
    color: #2d3748;
    margin: 0;
}

.admin-description {
    color: #718096;
    font-size: 1.1rem;
}

.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    padding: 1.5rem;
    text-align: center;
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: #667eea;
    margin-bottom: 0.25rem;
}

.stat-label {
    color: #718096;
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Admin Table */
.admin-table-container {
    overflow-x: auto;
    margin-bottom: 2rem;
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

.admin-table th {
    background: #f7fafc;
    color: #4a5568;
    font-weight: 600;
    padding: 1rem;
    text-align: left;
    border-bottom: 2px solid #e2e8f0;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.admin-table td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;
}

.admin-row:hover {
    background: #f7fafc;
}

.participant-names {
    min-width: 150px;
}

.name-primary {
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 0.25rem;
}

.name-secondary {
    color: #718096;
    font-size: 0.875rem;
}

.participant-email a {
    color: #667eea;
    text-decoration: none;
}

.participant-email a:hover {
    text-decoration: underline;
}

.status-badges,
.flag-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
}

.flag-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.flag-admin {
    background: #fed7d7;
    color: #c53030;
}

.flag-verified {
    background: #c6f6d5;
    color: #22543d;
}

.flag-unverified {
    background: #fed7d7;
    color: #c53030;
}

.participant-actions {
    min-width: 100px;
}

/* Edit Form */
.edit-row td {
    padding: 0 !important;
    border-bottom: none !important;
}

.admin-edit-form {
    background: #f7fafc;
    padding: 2rem;
    border-top: 2px solid #667eea;
}

.admin-edit-form h4 {
    color: #2d3748;
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
}

.add-user-container {
    margin-top: 2rem;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.form-row .form-group {
    flex: 1;
    min-width: 200px;
}

.admin-flags {
    background: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.admin-actions {
    display: flex;
    justify-content: center;
    margin-top: 2rem;
}

/* Footer */
.footer {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem 0;
    text-align: center;
    color: #718096;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 0.5rem;
    }

    .header .container {
        flex-direction: column;
        gap: 1rem;
    }

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

    .main {
        padding: 1rem 0;
    }

    .login-card,
    .form-card,
    .status-card {
        margin: 0.5rem;
        padding: 1.5rem;
    }

    .list-container,
    .admin-container {
        margin: 0.5rem;
        padding: 1.5rem;
    }

    .participant-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .admin-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .form-actions {
        flex-direction: column;
    }

    .form-row {
        flex-direction: column;
    }

    .admin-table {
        font-size: 0.875rem;
    }

    .admin-table th,
    .admin-table td {
        padding: 0.75rem 0.5rem;
    }
}

@media (max-width: 480px) {
    .admin-stats {
        grid-template-columns: 1fr;
    }

    .status-badges,
    .flag-badges {
        flex-direction: column;
        align-items: flex-start;
    }
}

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

.login-card,
.form-card,
.status-card,
.list-container,
.admin-container {
    animation: fadeIn 0.5s ease-out;
}

/* Focus styles for accessibility */
.btn:focus,
.form-input:focus,
.checkbox-input:focus,
.nav-link:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .footer,
    .btn,
    .form-actions,
    .admin-actions,
    .participant-actions {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .login-card,
    .form-card,
    .list-container,
    .admin-container {
        box-shadow: none !important;
        border: 1px solid #ccc !important;
    }
}
