/* VOX - Main Stylesheet */
/* Mobile-first, minimalist design */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --success: #16a34a;
    --warning: #eab308;
    --danger: #dc2626;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-500: #6b7280;
    --gray-700: #374151;
    --gray-900: #111827;
    --radius: 8px;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-lg: 0 4px 6px rgba(0,0,0,0.1);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: white;
    box-shadow: var(--shadow);
    padding: 0 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
}

.nav-brand a {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--primary);
    text-decoration: none;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--gray-700);
}

.nav-menu {
    display: none;
    position: absolute;
    top: 56px;
    left: 0;
    right: 0;
    background: white;
    list-style: none;
    padding: 1rem;
    box-shadow: var(--shadow-lg);
}

.nav-menu.active {
    display: block;
}

.nav-menu li a {
    display: block;
    padding: 0.75rem;
    color: var(--gray-700);
    text-decoration: none;
    border-radius: var(--radius);
}

.nav-menu li a:hover,
.nav-menu li a.active {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-logout {
    color: var(--danger) !important;
}

@media (min-width: 768px) {
    .nav-toggle {
        display: none;
    }

    .nav-menu {
        display: flex;
        position: static;
        background: none;
        box-shadow: none;
        padding: 0;
        gap: 0.5rem;
    }

    .nav-menu li a {
        padding: 0.5rem 1rem;
    }
}

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

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.card h2 {
    font-size: 1.125rem;
    margin-bottom: 1rem;
    color: var(--gray-700);
}

.card-wide {
    grid-column: 1 / -1;
}

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

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

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

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--gray-700);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
}

.form-group small {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-error {
    color: var(--danger);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

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

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
}

.alert-error {
    background: #fef2f2;
    color: var(--danger);
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: var(--success);
    border: 1px solid #bbf7d0;
}

/* Auth */
.auth-container {
    min-height: calc(100vh - 56px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.auth-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 100%;
    max-width: 400px;
}

.auth-card h1 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-link {
    text-align: center;
    margin-top: 1rem;
    font-size: 0.875rem;
}

.auth-link a {
    color: var(--primary);
}

.disabled-link {
    color: var(--gray-500);
    cursor: not-allowed;
    text-decoration: none;
}

/* Dashboard */
.dashboard h1 {
    margin-bottom: 1.5rem;
}

.dashboard-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.page-header h1 {
    font-size: 1.5rem;
}

.back-link {
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.875rem;
}

.back-link:hover {
    color: var(--primary);
}

/* Filters */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.filters input,
.filters select {
    padding: 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.875rem;
}

.filters input[type="text"] {
    flex: 1;
    min-width: 200px;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-500);
    font-weight: 500;
    border-radius: var(--radius);
}

.tab:hover {
    background: var(--gray-100);
}

.tab.active {
    color: var(--primary);
    background: var(--gray-100);
}

/* Contact/Person Cards */
.persons-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 640px) {
    .persons-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .persons-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.person-card {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s;
}

.person-card:hover {
    box-shadow: var(--shadow-lg);
}

.person-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.person-avatar.large {
    width: 80px;
    height: 80px;
    font-size: 2rem;
}

.person-info h3 {
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.person-weight {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.person-tags {
    margin-top: 0.25rem;
}

.tag {
    display: inline-block;
    font-size: 0.625rem;
    background: var(--gray-100);
    color: var(--gray-700);
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    margin-right: 0.25rem;
}

/* Status indicators */
.status-ok .person-status { background: var(--success); }
.status-warning .person-status { background: var(--warning); }
.status-overdue .person-status { background: var(--danger); }

.person-status {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
}

/* Person Page */
.person-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.person-title h1 {
    margin-bottom: 0.25rem;
}

.person-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .person-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.info-list dt {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.75rem;
}

.info-list dt:first-child {
    margin-top: 0;
}

.info-list dd {
    font-size: 0.875rem;
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 1.5rem;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--gray-200);
}

.timeline-item {
    position: relative;
    padding-bottom: 1rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.5rem;
    top: 0.5rem;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid white;
}

.timeline-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.timeline-content {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: var(--radius);
    margin-top: 0.25rem;
}

.timeline-content p {
    font-size: 0.875rem;
}

/* Touches */
.touches-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.touch-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

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

.touch-type {
    font-size: 0.875rem;
}

.touch-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.touch-summary {
    font-size: 0.875rem;
    color: var(--gray-700);
}

.touch-context {
    font-size: 0.75rem;
    color: var(--gray-500);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--gray-100);
}

/* Commitments */
.commitments-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.commitment-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border-left: 3px solid var(--gray-300);
}

.commitment-card.overdue {
    border-left-color: var(--danger);
}

.commitment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

.commitment-direction {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.commitment-date {
    font-size: 0.75rem;
    color: var(--gray-500);
}

.commitment-date.overdue {
    color: var(--danger);
    font-weight: 500;
}

.commitment-desc {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
}

.commitment-actions {
    display: flex;
    gap: 0.5rem;
}

.status-badge {
    font-size: 0.75rem;
    color: var(--gray-500);
}

/* Settings */
.settings-grid {
    display: grid;
    gap: 1rem;
}

@media (min-width: 768px) {
    .settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.settings-page code {
    display: block;
    background: var(--gray-100);
    padding: 0.75rem;
    border-radius: var(--radius);
    font-family: monospace;
    margin: 0.5rem 0;
}

/* FAB */
.fab {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 50;
    transition: transform 0.2s;
}

.fab:hover {
    transform: scale(1.1);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.active {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: var(--radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
}

.modal-header h2 {
    font-size: 1.125rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--gray-500);
}

.modal-body {
    padding: 1rem;
}

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

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
}

/* Touch Preview */
.touch-preview {
    background: var(--gray-50);
    padding: 1rem;
    border-radius: var(--radius);
    margin-top: 1rem;
}

.touch-preview.hidden {
    display: none;
}

/* Utilities */
.hidden {
    display: none !important;
}

.loading {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

.empty {
    text-align: center;
    color: var(--gray-500);
    padding: 2rem;
}

.error {
    text-align: center;
    color: var(--danger);
    padding: 1rem;
}

.success {
    color: var(--success);
}

/* Load More */
.load-more {
    text-align: center;
    padding: 1rem;
}

/* Contact List (Dashboard) */
.contact-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.contact-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    text-decoration: none;
    color: inherit;
}

.contact-item:hover {
    background: var(--gray-100);
}

.contact-item.status-overdue {
    border-left: 3px solid var(--danger);
}

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

/* Commitment List (Dashboard) */
.commitment-list .commitment-item {
    padding: 0.5rem;
    border-bottom: 1px solid var(--gray-100);
}

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

.commitment-list .commitment-item.overdue {
    color: var(--danger);
}

/* Touch List (Dashboard) */
.touch-list .touch-item {
    padding: 0.75rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}

.touch-list .touch-item:last-child {
    margin-bottom: 0;
}
