/* WTA Contact Review — Mobile-first styles */

:root {
    --wta-blue: #1a5276;
    --wta-light: #2980b9;
    --green: #27ae60;
    --green-light: #e8f8f0;
    --red: #e74c3c;
    --red-light: #fdf0ef;
    --grey-50: #f8f9fa;
    --grey-100: #f0f1f3;
    --grey-200: #e0e2e6;
    --grey-400: #a0a4ab;
    --grey-600: #6b7280;
    --grey-800: #374151;
    --grey-900: #1f2937;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.12);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 16px;
    padding-right: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--grey-50);
    color: var(--grey-900);
    line-height: 1.5;
}

/* Header */
.app-header {
    background: var(--wta-blue);
    color: white;
    padding: 12px 0;
    z-index: 100;
    box-shadow: var(--shadow-lg);
}
.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.app-header h1 { font-size: 1.2rem; font-weight: 600; white-space: nowrap; }
.staff-display { font-size: 0.9rem; opacity: 0.9; }
.btn-link {
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.85rem;
    padding: 0 4px;
}
.btn-link:hover { color: white; }

.progress-section {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.progress-bar {
    flex: 1;
    height: 8px;
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}
.progress-fill {
    height: 100%;
    transition: width 0.4s ease;
    width: 0%;
}
.progress-vouched { background: var(--green); }
.progress-removed { background: var(--red); opacity: 0.7; }
.pots {
    display: flex;
    gap: 12px;
    justify-content: center;
}
.pot {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: rgba(255,255,255,0.15);
    border-radius: var(--radius);
    padding: 6px 16px;
    min-width: 80px;
    cursor: pointer;
    transition: background 0.15s;
}
.pot:hover { background: rgba(255,255,255,0.3); }
.pot-count {
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1.2;
    transition: transform 0.2s;
}
.pot-count.pulse { animation: pot-pulse 0.3s ease; }
@keyframes pot-pulse { 50% { transform: scale(1.3); } }
.pot-label {
    font-size: 0.7rem;
    opacity: 0.7;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pot-vouched .pot-count { color: #a7f3d0; }
.pot-removed .pot-count { color: #fca5a5; }

/* Instructions bar */
.instructions-bar {
    padding: 10px 0;
    background: white;
    border-bottom: 1px solid var(--grey-200);
    text-align: center;
}
.instructions-list {
    list-style-position: inside;
    font-size: 0.85rem;
    color: var(--grey-600);
    display: inline-block;
    text-align: left;
    margin: 0;
    padding: 0;
}
.instructions-list li { padding: 2px 0; }
.instructions-list .instruction-vouch { color: var(--green); font-weight: 500; }
.instructions-list .instruction-remove { color: var(--red); font-weight: 500; }
.instructions-note {
    font-size: 0.8rem;
    color: var(--grey-400);
    font-style: italic;
    margin-top: 4px;
}

/* Filter bar */
.filter-bar {
    padding: 12px 0;
    background: white;
    border-bottom: 1px solid var(--grey-200);
    position: sticky;
    top: 0;
    z-index: 90;
}
.filter-bar-inner {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
}
.filter-bar input,
.filter-bar select {
    padding: 8px 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
}
#search-input { flex: 1; min-width: 200px; }
.filter-bar select { min-width: 120px; }

.toggle-group {
    display: flex;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    overflow: hidden;
}
.toggle-btn {
    padding: 8px 14px;
    border: none;
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
    color: var(--grey-600);
    border-right: 1px solid var(--grey-200);
}
.toggle-btn:last-child { border-right: none; }
.toggle-btn.active { background: var(--wta-blue); color: white; }
.toggle-btn:hover:not(.active) { background: var(--grey-100); }

/* Contact grid */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 0;
}
@media (min-width: 640px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }

/* Contact card */
.contact-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    transition: box-shadow 0.2s;
    position: relative;
    display: flex;
    flex-direction: column;
}
.contact-card:hover { box-shadow: var(--shadow-lg); }
.contact-card.card-exiting {
    animation: card-exit 0.4s ease forwards;
    pointer-events: none;
}
@keyframes card-exit {
    0% { opacity: 1; transform: scale(1); }
    100% { opacity: 0; transform: scale(0.85); }
}
.contact-card.is-vouched { border-left: 4px solid var(--green); background: var(--green-light); }
.contact-card.is-removed { border-left: 4px solid var(--red); background: var(--red-light); opacity: 0.7; }

.card-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--grey-900);
    margin-bottom: 8px;
}
.card-org {
    color: var(--wta-light);
    font-size: 0.9rem;
    margin-bottom: 6px;
}
.card-role {
    color: var(--grey-600);
    font-size: 0.85rem;
    margin-bottom: 6px;
}
.card-meta {
    font-size: 0.8rem;
    color: var(--grey-400);
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Card action buttons */
.card-actions {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
}
.action-btn {
    padding: 6px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.85rem;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s, transform 0.1s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.action-btn:active { transform: scale(0.96); }
.btn-vouch { background: var(--green); color: white; }
.btn-vouch:hover { background: #219a52; }
.btn-remove { background: var(--red); color: white; }
.btn-remove:hover { background: #c0392b; }
.btn-undo { background: var(--grey-200); color: var(--grey-600); }
.btn-undo:hover { background: var(--grey-400); color: white; }

.expand-btn {
    background: none;
    border: none;
    color: var(--grey-400);
    cursor: pointer;
    font-size: 0.8rem;
    margin-left: auto;
}
.expand-btn:hover { color: var(--grey-600); }

.card-status-info {
    font-size: 0.75rem;
    margin-top: 6px;
}
.card-status-info.vouched-info { color: var(--green); }
.card-status-info.removed-info { color: var(--red); }

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 4px;
    padding: 20px 16px 40px;
    flex-wrap: wrap;
}
.page-btn {
    padding: 8px 14px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    background: white;
    cursor: pointer;
    font-size: 0.85rem;
}
.page-btn:hover { background: var(--grey-100); }
.page-btn.active { background: var(--wta-blue); color: white; border-color: var(--wta-blue); }
.page-btn:disabled { opacity: 0.4; cursor: default; }

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 200;
}
.modal-overlay[hidden] { display: none; }
.modal {
    background: white;
    border-radius: var(--radius);
    padding: 28px;
    min-width: min(360px, 90vw);
    max-width: 90vw;
    box-shadow: var(--shadow-lg);
}
.modal h3 { margin-bottom: 4px; font-size: 1.2rem; }
.modal-subtitle { color: var(--grey-600); font-size: 0.9rem; margin-bottom: 16px; }
.staff-select-large {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    font-size: 1rem;
    margin-bottom: 16px;
}
.modal textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    font-size: 0.9rem;
    margin-bottom: 16px;
    resize: vertical;
    font-family: inherit;
}
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.btn-primary {
    padding: 10px 24px;
    background: var(--wta-blue);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 0.95rem;
}
.btn-primary:disabled { opacity: 0.4; cursor: default; }
.btn-secondary {
    padding: 10px 24px;
    background: var(--grey-200);
    color: var(--grey-800);
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}
.btn-danger {
    padding: 10px 24px;
    background: var(--red);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
}

/* Edit modal */
.modal-edit { min-width: min(480px, 90vw); max-width: 600px; }
.edit-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.edit-field { display: flex; flex-direction: column; gap: 4px; }
.edit-field.full-width { grid-column: 1 / -1; }
.edit-field label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--grey-600);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.edit-field input,
.edit-field select {
    padding: 8px 10px;
    border: 1px solid var(--grey-200);
    border-radius: var(--radius);
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.15s;
}
.edit-field input:focus,
.edit-field select:focus {
    outline: none;
    border-color: var(--wta-light);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, 0.1);
}
@media (max-width: 480px) {
    .modal-edit { min-width: auto; }
    .edit-form-grid { grid-template-columns: 1fr; }
}

/* Toast */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--grey-900);
    color: white;
    padding: 10px 24px;
    border-radius: var(--radius);
    font-size: 0.9rem;
    z-index: 300;
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.2s;
}
.toast[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

@keyframes flash-green { 0% { background: #a7f3d0; } 100% { background: transparent; } }
.flash { animation: flash-green 0.8s ease-out; }

.loading-text {
    text-align: center;
    padding: 60px 20px;
    color: var(--grey-400);
    font-size: 1.1rem;
    grid-column: 1 / -1;
}
