/* ── Pindrop Light Theme — Shared Styles ──
   Used by: index.html, teams.html, pages.html
*/

:root {
    --accent: #f43f5e;
    --accent-light: #fb7185;
    --accent-dark: #e11d48;
    --accent-warm: #f97316;
    --bg: #fffbfb;
    --surface: #ffffff;
    --text: #1c1017;
    --text-soft: #64748b;
    --text-muted: #94a3b8;
    --border: rgba(244, 63, 94, 0.1);
    --border-hover: rgba(244, 63, 94, 0.25);
    --glow: rgba(244, 63, 94, 0.12);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* ── Background decoration ── */
.bg-grid {
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 1px 1px, rgba(244, 63, 94, 0.04) 1px, transparent 0);
    background-size: 32px 32px;
    pointer-events: none;
    z-index: 0;
}

.bg-glow {
    position: fixed;
    top: -200px;
    left: 50%;
    transform: translateX(-50%);
    width: 800px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(244, 63, 94, 0.08) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.bg-glow-2 {
    position: fixed;
    bottom: -300px;
    right: -200px;
    width: 600px;
    height: 600px;
    background: radial-gradient(ellipse, rgba(249, 115, 22, 0.06) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* ── Layout ── */
.page {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1100px;
    padding: 3rem 2rem 4rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* ── Nav ── */
.nav {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 3rem;
    opacity: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text);
}

.nav-logo svg {
    width: 28px;
    height: 36px;
    filter: drop-shadow(0 2px 4px rgba(244, 63, 94, 0.2));
}

.nav-logo span {
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.nav-badge {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    background: rgba(244, 63, 94, 0.08);
    padding: 4px 10px;
    border-radius: 100px;
}

/* ── Floating pins decoration ── */
.floating-pin {
    position: fixed;
    z-index: 0;
    opacity: 0;
    pointer-events: none;
}

.floating-pin svg {
    filter: drop-shadow(0 2px 8px rgba(244, 63, 94, 0.15));
}

/* ── Card base ── */
.card {
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 2.5rem;
    box-shadow:
        0 1px 2px rgba(0, 0, 0, 0.04),
        0 4px 16px rgba(244, 63, 94, 0.06),
        0 12px 40px rgba(244, 63, 94, 0.04);
}

/* ── Section header ── */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.section-header .subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Form elements ── */
.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg);
    border: 1.5px solid var(--border);
    border-radius: 14px;
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 500;
    color: var(--text);
    outline: none;
    transition: all 0.2s ease;
}

.form-input::placeholder {
    color: var(--text-muted);
    font-weight: 400;
}

.form-input:focus {
    border-color: var(--accent-light);
    box-shadow: 0 0 0 4px var(--glow);
}

.form-hint {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
}

.form-error {
    font-size: 0.75rem;
    color: var(--accent-dark);
    margin-top: 0.4rem;
    display: none;
}

.form-error.visible {
    display: block;
}

/* ── Buttons ── */
.btn-primary {
    padding: 16px;
    border: none;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent), var(--accent-warm));
    color: white;
    font-size: 1rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.btn-primary:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 20px rgba(244, 63, 94, 0.35);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    filter: none;
    box-shadow: none;
}

.btn-primary .btn-arrow {
    display: inline-block;
    transition: transform 0.2s ease;
    margin-left: 6px;
}

.btn-primary:hover .btn-arrow {
    transform: translateX(4px);
}

.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: btn-spin 0.6s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes btn-spin {
    to { transform: rotate(360deg); }
}

/* ── Breadcrumb ── */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    width: 100%;
}

.breadcrumb a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb .sep {
    color: var(--text-muted);
    opacity: 0.5;
}

.breadcrumb .current {
    color: var(--text);
    font-weight: 600;
}

/* ── Empty state ── */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
}

.empty-state-icon {
    width: 56px;
    height: 56px;
    color: var(--text-muted);
    opacity: 0.3;
    margin-bottom: 1rem;
}

.empty-state h3 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-soft);
    margin-bottom: 0.35rem;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* ── Loading state ── */
.loading-state {
    text-align: center;
    padding: 3rem 2rem;
}

.loading-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: btn-spin 0.8s linear infinite;
    margin: 0 auto 1rem;
}

.loading-state p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ── Team / page list items ── */
.list-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text);
}

.list-card:hover {
    border-color: var(--border-hover);
    box-shadow: 0 4px 16px rgba(244, 63, 94, 0.08);
    transform: translateY(-2px);
}

.list-card-icon {
    width: 40px;
    height: 40px;
    min-width: 40px;
    border-radius: 12px;
    background: rgba(244, 63, 94, 0.06);
    border: 1px solid rgba(244, 63, 94, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.list-card-icon svg {
    width: 20px;
    height: 20px;
}

.list-card-content {
    flex: 1;
    min-width: 0;
}

.list-card-title {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

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

.list-card-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.list-card-arrow svg {
    width: 16px;
    height: 16px;
}

.list-card:hover .list-card-arrow {
    transform: translateX(3px);
    color: var(--accent);
}

/* ── Inline add form ── */
.add-form {
    display: flex;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.add-form .form-input {
    flex: 1;
    padding: 12px 16px;
}

.add-form .btn-primary {
    padding: 12px 24px;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ── Footer ── */
footer {
    margin-top: 5rem;
    padding: 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    opacity: 0;
}

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

/* ── Archive / Restore / Delete button on cards ── */
.list-card-archive,
.list-card-unarchive,
.list-card-delete {
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    transition: all 0.15s ease;
    padding: 3px 8px;
    margin-top: 6px;
    font-family: inherit;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.list-card-archive svg,
.list-card-unarchive svg,
.list-card-delete svg {
    width: 12px;
    height: 12px;
}

.list-card-archive:hover {
    background: rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.list-card-unarchive:hover {
    background: rgba(16, 185, 129, 0.12);
    color: #10b981;
}

.list-card-delete:hover {
    background: rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.list-card-actions {
    display: flex;
    gap: 4px;
    margin-top: 6px;
}

/* ── Confirm modal ── */
.pd-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.pd-modal-overlay.visible {
    opacity: 1;
}

.pd-modal {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 32px;
    max-width: 380px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(244, 63, 94, 0.08), 0 8px 24px rgba(0, 0, 0, 0.08);
    transform: scale(0.95) translateY(8px);
    transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
    text-align: center;
}

.pd-modal-overlay.visible .pd-modal {
    transform: scale(1) translateY(0);
}

.pd-modal-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 18px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-modal-icon.warning {
    background: rgba(245, 158, 11, 0.08);
    border: 1px solid rgba(245, 158, 11, 0.12);
    color: #f59e0b;
}

.pd-modal-icon.danger {
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.12);
    color: #ef4444;
}

.pd-modal-icon svg {
    width: 24px;
    height: 24px;
}

.pd-modal h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
}

.pd-modal p {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.pd-modal-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.pd-modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s ease;
}

.pd-modal-cancel {
    background: var(--bg);
    color: var(--text-soft);
    border: 1px solid var(--border);
}

.pd-modal-cancel:hover {
    border-color: var(--border-hover);
    color: var(--text);
}

.pd-modal-confirm {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
}

.pd-modal-confirm:hover {
    filter: brightness(1.08);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
    transform: translateY(-1px);
}

.pd-modal-confirm.danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.pd-modal-confirm.danger:hover {
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}

/* ── Archived section ── */
.archived-section {
    margin-top: 2rem;
}

.archived-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px 0;
    transition: color 0.15s ease;
}

.archived-toggle:hover {
    color: var(--text-soft);
}

.archived-toggle-chevron {
    width: 10px;
    height: 6px;
    transform: rotate(-90deg);
    transition: transform 0.2s ease;
}

.archived-toggle.open .archived-toggle-chevron {
    transform: rotate(0deg);
}

.archived-count {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.04);
    padding: 1px 7px;
    border-radius: 6px;
}

.archived-list {
    display: none;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

.archived-list.open {
    display: flex;
}

.archived-list .list-card {
    opacity: 0.6;
}

.archived-list .list-card:hover {
    opacity: 1;
}

/* ── Toast ── */
.pd-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: #1a1a1a;
    color: #f1f1f1;
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 0.82rem;
    font-weight: 600;
    z-index: 999;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ── Connection indicator ── */
.connection-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 100px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.12);
    transition: all 0.3s ease;
}

.connection-indicator.offline {
    background: rgba(239, 68, 68, 0.06);
    border-color: rgba(239, 68, 68, 0.12);
}

.connection-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.4);
    flex-shrink: 0;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.connection-indicator.offline .connection-dot {
    background: #ef4444;
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.connection-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: #10b981;
    transition: color 0.3s ease;
}

.connection-indicator.offline .connection-label {
    color: #ef4444;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .page { padding: 2rem 1.25rem 3rem; }
    .card { padding: 2rem 1.5rem; }
    .add-form { flex-direction: column; }
}
