/* Secret Santa - Moderately Festive Theme */

:root {
    --red: #c41e3a;
    --red-dark: #a01830;
    --green: #228b22;
    --green-dark: #1a6b1a;
    --gold: #d4af37;
    --snow: #f8f9fa;
    --white: #ffffff;
    --gray-100: #f1f3f5;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #868e96;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --radius: 8px;
    --radius-lg: 12px;
}

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

body {
    font-family: var(--font-sans);
    background: linear-gradient(135deg, var(--snow) 0%, var(--gray-100) 100%);
    color: var(--gray-800);
    min-height: 100vh;
    line-height: 1.6;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: calc(100vh - 60px);
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }

a {
    color: var(--green);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Cards */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 20px;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-800);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--red);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--red-dark);
}

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

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--gray-300);
    color: var(--gray-700);
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.875rem;
}

.btn-icon {
    padding: 8px;
    background: transparent;
    border: none;
    color: var(--gray-600);
    cursor: pointer;
}

.btn-icon:hover {
    color: var(--gray-800);
}

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

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

.form-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid var(--gray-300);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--green);
}

.form-hint {
    margin-top: 4px;
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Header */
.page-header {
    text-align: center;
    margin-bottom: 32px;
}

.page-header h1 {
    color: var(--red);
    margin-bottom: 8px;
}

.page-header .emoji {
    font-size: 3rem;
    margin-bottom: 16px;
}

.countdown {
    display: inline-block;
    background: var(--gray-100);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.875rem;
    color: var(--gray-600);
}

.status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    font-weight: 500;
}

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

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

/* Assignment reveal */
.assignment-box {
    background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 100%);
    color: var(--white);
    padding: 24px;
    border-radius: var(--radius-lg);
    text-align: center;
    margin: 20px 0;
}

.assignment-box h2 {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.assignment-name {
    font-size: 2rem;
    font-weight: 700;
}

/* Wishlist */
.wishlist-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-100);
    border-radius: var(--radius);
    margin-bottom: 8px;
}

.wishlist-item-content {
    flex: 1;
    word-break: break-word;
}

.wishlist-item-actions {
    display: flex;
    gap: 4px;
}

.wishlist-empty {
    text-align: center;
    padding: 32px;
    color: var(--gray-500);
}

/* Member list (admin) */
.member-table {
    width: 100%;
    border-collapse: collapse;
}

.member-table th,
.member-table td {
    text-align: left;
    padding: 12px;
    border-bottom: 1px solid var(--gray-200);
}

.member-table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Mobile cards for member list */
.member-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

.member-card-header {
    font-weight: 600;
    margin-bottom: 4px;
}

.member-card-email {
    color: var(--gray-500);
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.member-card-status {
    display: flex;
    gap: 16px;
    font-size: 0.875rem;
    margin-bottom: 12px;
}

.member-card-actions {
    display: flex;
    gap: 8px;
}

/* Status icons */
.status-icon {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.status-icon.success { color: var(--green); }
.status-icon.warning { color: var(--gold); }
.status-icon.error { color: var(--red); }
.status-icon.muted { color: var(--gray-500); }

/* Exclusion groups */
.exclusion-card {
    background: var(--gray-100);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
}

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

.exclusion-card-name {
    font-weight: 600;
}

.exclusion-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.pill {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.pill-inactive {
    background: var(--gray-200);
    color: var(--gray-600);
}

.pill-active {
    background: var(--green);
    color: var(--white);
}

.pill:hover {
    transform: scale(1.05);
}

.pool-hint {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 8px;
}

/* Checklist */
.checklist {
    list-style: none;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--gray-200);
}

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

.checklist-number {
    width: 32px;
    height: 32px;
    background: var(--gray-200);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: var(--gray-600);
    flex-shrink: 0;
}

.checklist-item.completed .checklist-number {
    background: var(--green);
    color: var(--white);
}

.checklist-content {
    flex: 1;
}

.checklist-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.checklist-description {
    font-size: 0.875rem;
    color: var(--gray-500);
}

/* Copy link box */
.copy-box {
    display: flex;
    gap: 8px;
    margin-top: 12px;
}

.copy-input {
    flex: 1;
    padding: 10px 12px;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-family: monospace;
    font-size: 0.875rem;
}

/* Settings section */
.settings-section {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--gray-200);
}

.settings-title {
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-500);
    margin-bottom: 16px;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.setting-label {
    font-weight: 500;
}

.setting-value {
    color: var(--gray-600);
}

/* Alerts */
.alert {
    padding: 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

/* Empty states */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 8px;
}

/* Footer */
.footer {
    text-align: center;
    padding: 20px;
    color: var(--gray-500);
    font-size: 0.875rem;
}

/* Masked assignment */
.assignment-masked {
    font-family: monospace;
    letter-spacing: 2px;
}

.reveal-btn {
    cursor: pointer;
    padding: 4px;
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.25rem; }
    
    .btn {
        width: 100%;
    }
    
    .member-table {
        display: none;
    }
    
    .copy-box {
        flex-direction: column;
    }
    
    .setting-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Desktop member table visible */
@media (min-width: 641px) {
    .member-cards-mobile {
        display: none;
    }
}

/* Snowflakes - subtle festive touch */
.snowflakes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
}

.snowflake {
    position: absolute;
    color: var(--gray-300);
    font-size: 1rem;
    animation: fall linear infinite;
    opacity: 0.7;
}

@keyframes fall {
    0% {
        transform: translateY(-10vh) rotate(0deg);
    }
    100% {
        transform: translateY(110vh) rotate(360deg);
    }
}

/* Modal overlay */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
}

.modal {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 500px;
    width: 90%;
    box-shadow: var(--shadow-lg);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Loading states */
.htmx-request .btn-loading {
    opacity: 0.7;
    pointer-events: none;
}

.htmx-request .btn-loading::after {
    content: "...";
}

/* Member pill editing */
.members-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.member-pill {
    display: inline-block;
}

.member-pill-view {
    display: flex;
    align-items: center;
    gap: 4px;
}

.member-pill-edit {
    background: var(--gray-100);
    padding: 12px;
    border-radius: var(--radius);
    margin: 4px 0;
}

.member-edit-form {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

.member-edit-form .form-input {
    width: auto;
    flex: 1;
    min-width: 120px;
}

.btn-icon {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    font-size: 0.875rem;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-icon:hover {
    opacity: 1;
}

.btn-icon.btn-danger:hover {
    opacity: 1;
}

.owner-badge {
    font-size: 0.75rem;
    margin-left: 2px;
}

.form-input-sm {
    padding: 6px 10px;
    font-size: 0.875rem;
}

/* Settings header */
.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.settings-section .form-input {
    flex: 1;
}

/* Settings edit mode */
#settings-edit .setting-row {
    margin-bottom: 12px;
}

#settings-edit .setting-label {
    min-width: 120px;
}
