/* pathfindr-common.css */
/* Shared styles for all PathFindr pages */

/* CSS Variables for theming */
:root {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    --border-color: #e1e5e9;
    --purple-primary: #8B5CF6;
    --purple-secondary: #A855F7;
    --purple-tertiary: #C084FC;
    --purple-light: #faf5ff;
    --header-bg: #ffffff;
    --card-bg: #ffffff;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --info: #06b6d4;

    /* Type scale — the ONLY sizes/weights pages should use.
       page title 24/800 · section 16/700 · card title 15/700 ·
       body 14/400 · caption 12/500 · eyebrow 11/800 uppercase */
    --font-stack: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Inter', 'Helvetica Neue', Arial, sans-serif;
    --text-page-title: 24px;
    --text-section: 16px;
    --text-card-title: 15px;
    --text-body: 14px;
    --text-caption: 12px;
    --text-eyebrow: 11px;
    --weight-heavy: 800;
    --weight-bold: 700;
    --weight-medium: 500;
    --weight-regular: 400;
}

/* Dark Mode Variables — Neutral Black & Gray */
body.dark-mode {
    --bg-primary: #0b0d10;      /* near-black background */
    --bg-secondary: #14171c;    /* cards / panels */
    --bg-tertiary: #1c2026;     /* hover states / inputs */

    --text-primary: #f3f4f6;   /* main text */
    --text-secondary: #9ca3af; /* muted text */
    --text-tertiary: #6b7280;  /* subtle labels */

    --border-color: #262b33;   /* soft borders */

    --purple-light: #2a254d;   /* accent shadow / glow */
    --header-bg: #14171c;
    --card-bg: #14171c;
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-stack);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.5;
    font-size: var(--text-body);
    -webkit-font-smoothing: antialiased;
}

/* Form controls and buttons default to the UA font — force the page font so
   <button> and <a> siblings always match. */
button, input, select, textarea {
    font-family: inherit;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-primary);
    font-weight: var(--weight-bold);
}

a {
    color: var(--purple-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--purple-secondary);
}

/* Common Layout Components */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 20px;
}

/* Cards */
.card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.card-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.card-description {
    font-size: 14px;
    color: var(--text-secondary);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-primary), var(--purple-secondary));
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--border-color);
}

.btn-outline {
    background: transparent;
    color: var(--purple-primary);
    border: 2px solid var(--purple-primary);
}

.btn-outline:hover:not(:disabled) {
    background: var(--purple-primary);
    color: white;
}

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

.btn-danger:hover:not(:disabled) {
    background: #dc2626;
}

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

.btn-success:hover:not(:disabled) {
    background: #059669;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--purple-primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

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

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

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

.badge-success {
    background: #f0fdf4;
    color: #15803d;
}

.badge-warning {
    background: #fffbeb;
    color: #d97706;
}

.badge-error {
    background: #fef2f2;
    color: #dc2626;
}

.badge-info {
    background: #f0f9ff;
    color: #0369a1;
}

/* Avatar/Profile Pictures */
.avatar {
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    flex-shrink: 0;
}

.avatar-sm {
    width: 32px;
    height: 32px;
    font-size: 12px;
}

.avatar-md {
    width: 44px;
    height: 44px;
    font-size: 16px;
}

.avatar-lg {
    width: 64px;
    height: 64px;
    font-size: 24px;
}

.avatar-xl {
    width: 120px;
    height: 120px;
    font-size: 36px;
}

/* Dividers */
.divider {
    margin: 24px 0;
    text-align: center;
    position: relative;
    color: var(--text-secondary);
    font-size: 14px;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color);
}

.divider span {
    background: var(--card-bg);
    padding: 0 16px;
    position: relative;
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top-color: var(--purple-primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-success {
    border-left: 4px solid var(--success);
}

.toast-error {
    border-left: 4px solid var(--error);
}

.toast-warning {
    border-left: 4px solid var(--warning);
}

.toast-info {
    border-left: 4px solid var(--info);
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.p-0 { padding: 0; }
.p-1 { padding: 8px; }
.p-2 { padding: 16px; }
.p-3 { padding: 24px; }
.p-4 { padding: 32px; }

.hidden {
    display: none;
}

.flex {
    display: flex;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.gap-4 { gap: 32px; }

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        padding: 16px;
    }
}

@media (max-width: 768px) {
    .container,
    .main-container {
        padding: 12px;
    }

    .card {
        padding: 16px;
    }
}