/**
 * COMTOO Onboarding MVP - Mobile-First Styles
 */

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --success: #16a34a;
    --success-light: #dcfce7;
    --warning: #ca8a04;
    --warning-light: #fef9c3;
    --danger: #dc2626;
    --danger-light: #fee2e2;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --radius: 0.5rem;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 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;
    font-size: 16px;
    line-height: 1.5;
    color: var(--gray-800);
    background: var(--gray-50);
    min-height: 100vh;
}

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

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

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: var(--radius);
    border: none;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 48px;
}

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

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

.btn-secondary {
    background: white;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
}

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

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

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

.btn-block {
    display: flex;
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-height: 40px;
}

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

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

.form-input, .form-select, .form-textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    background: white;
    min-height: 48px;
    transition: border-color 0.15s ease;
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

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

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

/* Cards */
.card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 600;
}

.card-body {
    padding: 1rem;
}

.card-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-200);
    background: var(--gray-50);
}

/* Progress Bar */
.progress {
    height: 8px;
    background: var(--gray-200);
    border-radius: 999px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    border-radius: 999px;
    transition: width 0.3s ease;
}

.progress-bar.success {
    background: var(--success);
}

/* Navigation */
.navbar {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

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

/* Bottom Navigation (Mobile) */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-top: 1px solid var(--gray-200);
    display: flex;
    padding: 0.5rem;
    z-index: 100;
}

.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.5rem;
    color: var(--gray-500);
    text-decoration: none;
    font-size: 0.75rem;
}

.bottom-nav-item.active {
    color: var(--primary);
}

.bottom-nav-item svg {
    width: 24px;
    height: 24px;
    margin-bottom: 0.25rem;
}

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

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

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

.checklist-checkbox {
    width: 24px;
    height: 24px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    flex-shrink: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s ease;
}

.checklist-checkbox:hover {
    border-color: var(--primary);
}

.checklist-checkbox.checked {
    background: var(--success);
    border-color: var(--success);
    color: white;
}

.checklist-content {
    flex: 1;
}

.checklist-title {
    font-weight: 500;
}

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

.checklist-item.completed .checklist-title {
    text-decoration: line-through;
    color: var(--gray-400);
}

/* Phase indicator */
.phase-indicator {
    display: flex;
    gap: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.phase-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--gray-300);
    flex-shrink: 0;
}

.phase-dot.completed {
    background: var(--success);
}

.phase-dot.current {
    background: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-light);
}

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

.alert-success {
    background: var(--success-light);
    color: var(--success);
}

.alert-error {
    background: var(--danger-light);
    color: var(--danger);
}

.alert-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.alert-info {
    background: var(--primary-light);
    color: var(--primary);
}

/* Badge */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 999px;
}

.badge-primary {
    background: var(--primary-light);
    color: var(--primary);
}

.badge-success {
    background: var(--success-light);
    color: var(--success);
}

.badge-warning {
    background: var(--warning-light);
    color: var(--warning);
}

.badge-danger {
    background: var(--danger-light);
    color: var(--danger);
}

/* Video Player */
.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--gray-900);
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Stats */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

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

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gray-900);
}

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

/* Emoji Rating */
.emoji-rating {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.emoji-rating button {
    font-size: 2rem;
    background: none;
    border: 2px solid transparent;
    border-radius: var(--radius);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.emoji-rating button:hover,
.emoji-rating button.selected {
    border-color: var(--primary);
    background: var(--primary-light);
}

/* File Upload */
.file-upload {
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.15s ease;
}

.file-upload:hover {
    border-color: var(--primary);
    background: var(--primary-light);
}

.file-upload input {
    display: none;
}

/* Table */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

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

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

.table th {
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.p-1 { padding: 0.5rem; }
.p-2 { padding: 1rem; }
.p-3 { padding: 1.5rem; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }

.hidden { display: none; }

/* Page with bottom nav */
.page-content {
    padding-bottom: 80px;
}

/* Auth Layout */
.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
}

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

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

.auth-logo h1 {
    color: var(--primary);
    font-size: 1.75rem;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

.admin-sidebar {
    width: 250px;
    background: var(--gray-800);
    color: white;
    flex-shrink: 0;
}

.admin-sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid var(--gray-700);
}

.admin-nav {
    padding: 1rem 0;
}

.admin-nav a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--gray-300);
    text-decoration: none;
    transition: all 0.15s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: var(--gray-700);
    color: white;
}

.admin-main {
    flex: 1;
    overflow-x: hidden;
}

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

.admin-content {
    padding: 1.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar {
        display: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .hide-mobile {
        display: none;
    }
}

@media (min-width: 769px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.5rem; }

    .bottom-nav {
        display: none;
    }

    .page-content {
        padding-bottom: 0;
    }

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