/* ============================================================
   PSYOBJECTS — main.css
   Global styles, colour scheme, typography
   ============================================================ */

/* ── FONT ───────────────────────────────────────────────────── */
@font-face {
    font-family: 'Outfit';
    src: url('/assets/fonts/Outfit-Regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('/assets/fonts/Outfit-SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Outfit';
    src: url('/assets/fonts/Outfit-Bold.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ── CSS VARIABLES ──────────────────────────────────────────── */
:root {
    /* Colours */
    --color-deep-purple:   #4B0082;
    --color-med-purple:    #8A2BE2;
    --color-soft-lavender: #B496DC;
    --color-light-lilac:   #E6D2FA;
    --color-near-black:    #12001C;
    --color-dark-surface:  #231432;
    --color-muted-text:    #A08CB4;
    --color-white:         #FFFFFF;
    --color-success:       #50C88C;
    --color-warning:       #FFB432;
    --color-error:         #DC4650;

    /* Typography */
    --font-family:   'Outfit', Arial, sans-serif;
    --font-size-xs:  11px;
    --font-size-sm:  13px;
    --font-size-md:  15px;
    --font-size-lg:  18px;
    --font-size-xl:  24px;
    --font-size-xxl: 32px;

    /* Spacing */
    --space-xs:  4px;
    --space-sm:  8px;
    --space-md:  16px;
    --space-lg:  24px;
    --space-xl:  40px;
    --space-xxl: 64px;

    /* Borders */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 100px;

    /* Transitions */
    --transition: 0.2s ease;
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-size-md);
    background-color: var(--color-near-black);
    color: var(--color-white);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── TYPOGRAPHY ─────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    color: var(--color-light-lilac);
}

h1 { font-size: var(--font-size-xxl); }
h2 { font-size: var(--font-size-xl); }
h3 { font-size: var(--font-size-lg); }
h4 { font-size: var(--font-size-md); }

p {
    line-height: 1.7;
    color: var(--color-white);
}

a {
    color: var(--color-soft-lavender);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--color-light-lilac);
}

strong { font-weight: 700; }
em     { font-style: italic; }

small {
    font-size: var(--font-size-xs);
    color: var(--color-muted-text);
}

/* ── IMAGES ─────────────────────────────────────────────────── */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ── LISTS ───────────────────────────────────────────────────── */
ul, ol {
    padding-left: var(--space-lg);
}

li {
    margin-bottom: var(--space-xs);
}

/* ── HORIZONTAL RULE ────────────────────────────────────────── */
hr {
    border: none;
    border-top: 1px solid var(--color-deep-purple);
    margin: var(--space-lg) 0;
}

/* ── UTILITY CLASSES ────────────────────────────────────────── */

/* Text colours */
.text-muted    { color: var(--color-muted-text); }
.text-lavender { color: var(--color-soft-lavender); }
.text-lilac    { color: var(--color-light-lilac); }
.text-success  { color: var(--color-success); }
.text-warning  { color: var(--color-warning); }
.text-error    { color: var(--color-error); }
.text-white    { color: var(--color-white); }

/* Text sizes */
.text-xs  { font-size: var(--font-size-xs); }
.text-sm  { font-size: var(--font-size-sm); }
.text-md  { font-size: var(--font-size-md); }
.text-lg  { font-size: var(--font-size-lg); }
.text-xl  { font-size: var(--font-size-xl); }

/* Text alignment */
.text-left   { text-align: left; }
.text-center { text-align: center; }
.text-right  { text-align: right; }

/* Font weights */
.font-normal  { font-weight: 400; }
.font-semibold{ font-weight: 600; }
.font-bold    { font-weight: 700; }

/* Display */
.d-none    { display: none; }
.d-block   { display: block; }
.d-flex    { display: flex; }
.d-grid    { display: grid; }

/* Flex utilities */
.flex-center  { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-gap-sm  { gap: var(--space-sm); }
.flex-gap-md  { gap: var(--space-md); }
.flex-gap-lg  { gap: var(--space-lg); }

/* Spacing */
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* Width */
.w-full { width: 100%; }

/* Overflow */
.overflow-hidden { overflow: hidden; }

/* Cursor */
.cursor-pointer { cursor: pointer; }

/* Visibility */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── ALERTS ─────────────────────────────────────────────────── */
.alert {
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    line-height: 1.6;
    margin-bottom: var(--space-md);
}

.alert-success {
    background: rgba(80, 200, 140, 0.12);
    border: 1px solid var(--color-success);
    color: var(--color-success);
}

.alert-warning {
    background: rgba(255, 180, 50, 0.12);
    border: 1px solid var(--color-warning);
    color: var(--color-warning);
}

.alert-error {
    background: rgba(220, 70, 80, 0.12);
    border: 1px solid var(--color-error);
    color: var(--color-error);
}

.alert-info {
    background: rgba(180, 150, 220, 0.12);
    border: 1px solid var(--color-soft-lavender);
    color: var(--color-soft-lavender);
}

/* ── BADGES ─────────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: var(--radius-xl);
    font-size: var(--font-size-xs);
    font-weight: 600;
    line-height: 1.6;
}

.badge-purple  { background: rgba(138, 43, 226, 0.2);  color: var(--color-soft-lavender); }
.badge-success { background: rgba(80, 200, 140, 0.2);  color: var(--color-success); }
.badge-warning { background: rgba(255, 180, 50, 0.2);  color: var(--color-warning); }
.badge-error   { background: rgba(220, 70, 80, 0.2);   color: var(--color-error); }
.badge-muted   { background: rgba(160, 140, 180, 0.2); color: var(--color-muted-text); }

/* ── PROGRESS BAR ───────────────────────────────────────────── */
.progress-bar {
    width: 100%;
    height: 6px;
    background: var(--color-dark-surface);
    border-radius: var(--radius-xl);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-med-purple);
    border-radius: var(--radius-xl);
    transition: width 0.4s ease;
}

.progress-fill.success { background: var(--color-success); }
.progress-fill.warning { background: var(--color-warning); }

/* ── LOADING SPINNER ────────────────────────────────────────── */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(180, 150, 220, 0.3);
    border-top-color: var(--color-soft-lavender);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
    text-align: center;
    padding: var(--space-xxl) var(--space-xl);
}

.empty-state img {
    width: 120px;
    height: auto;
    margin: 0 auto var(--space-lg);
    opacity: 0.85;
}

.empty-state h3 {
    font-size: var(--font-size-lg);
    color: var(--color-light-lilac);
    margin-bottom: var(--space-sm);
}

.empty-state p {
    font-size: var(--font-size-sm);
    color: var(--color-muted-text);
    max-width: 340px;
    margin: 0 auto;
}

/* ── AVATAR ─────────────────────────────────────────────────── */
.avatar {
    border-radius: 50%;
    object-fit: cover;
    background: var(--color-dark-surface);
}

.avatar-sm  { width: 28px;  height: 28px; }
.avatar-md  { width: 40px;  height: 40px; }
.avatar-lg  { width: 72px;  height: 72px; }
.avatar-xl  { width: 120px; height: 120px; }

/* ── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: var(--color-near-black);
}

::-webkit-scrollbar-thumb {
    background: var(--color-deep-purple);
    border-radius: var(--radius-xl);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--color-med-purple);
}

/* ── SELECTION ──────────────────────────────────────────────── */
::selection {
    background: var(--color-med-purple);
    color: var(--color-white);
}

/* ── FOCUS OUTLINE ──────────────────────────────────────────── */
:focus-visible {
    outline: 2px solid var(--color-med-purple);
    outline-offset: 2px;
}

/* ── RESPONSIVE BREAKPOINTS ─────────────────────────────────── */
/* Mobile first — breakpoints added in layout.css and page CSS */
@media (max-width: 768px) {
    h1 { font-size: var(--font-size-xl); }
    h2 { font-size: var(--font-size-lg); }
}
