/* ============================================================
   RPG Solo — Theme sombre inspire GNOME/libadwaita
   ============================================================ */

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Palette GNOME/libadwaita sombre */
    --bg-dark:       #242424;
    --bg-surface:    #363636;
    --bg-surface-alt:#2d2d2d;
    --bg-hover:      #3e3e3e;
    --accent:        #3584e4;
    --accent-hover:  #4a90e8;
    --accent-active: #1c71d8;
    --text-primary:  #ffffff;
    --text-secondary:#c0c0c0;
    --text-dim:      #888888;
    --border:        #555555;
    --border-light:  #444444;
    --error:         #ff6b6b;
    --error-bg:      #3d2020;
    --success:       #57e389;
    --success-bg:    #1e3a2a;

    /* Layout */
    --sidebar-width: 260px;
    --mobile-nav-height: 60px;
    --radius: 8px;
    --padding: 16px;
    --gap: 16px;

    /* Typo */
    font-family: "Inter", "Cantarell", system-ui, -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-dark);
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

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

a:hover {
    color: var(--accent-hover);
}

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

/* --- Sidebar (desktop) --- */
.sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background-color: var(--bg-surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 10;
}

.sidebar-header {
    padding: 24px var(--padding) 20px;
    border-bottom: 1px solid var(--border-light);
}

.app-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.app-icon {
    font-size: 1.5rem;
}

.sidebar-nav {
    flex: 1;
    padding: 12px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    transition: none;
}

.nav-item:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.nav-item.active {
    background-color: var(--accent);
    color: #ffffff;
}

.nav-item.active:hover {
    background-color: var(--accent-hover);
}

.nav-item.disabled {
    opacity: 0.4;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-separator {
    height: 1px;
    margin: 8px 12px;
    background-color: var(--border-light);
}

.nav-icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-footer {
    padding: 12px var(--padding);
    border-top: 1px solid var(--border-light);
}

.sidebar-settings {
    padding: 8px var(--padding);
    border-top: 1px solid var(--border-light);
}

.version {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* --- Main content --- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 40px 32px;
    min-height: 100vh;
}

/* --- Mobile nav (bottom) --- */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: var(--mobile-nav-height);
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border);
    z-index: 10;
    justify-content: space-around;
    align-items: center;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius);
    color: var(--text-secondary);
    font-size: 1.3rem;
}

.mobile-nav-item.active {
    background-color: var(--accent);
    color: #ffffff;
}

.mobile-nav-item.disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* --- Welcome page --- */
.welcome-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 80px);
}

.welcome-card {
    background-color: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 48px 40px;
    text-align: center;
    max-width: 520px;
    width: 100%;
}

.welcome-icon {
    font-size: 4rem;
    margin-bottom: 16px;
    filter: grayscale(0.3);
}

.welcome-card h2 {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--text-primary);
}

.welcome-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 32px;
}

.welcome-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
}

.welcome-note {
    color: var(--text-dim);
    font-size: 0.85rem;
    font-style: italic;
}

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.9375rem;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.4;
}

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

.btn-primary {
    background-color: var(--accent);
    color: #ffffff;
}

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

.btn-primary:active:not(:disabled) {
    background-color: var(--accent-active);
}

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

.btn-secondary:hover:not(:disabled) {
    background-color: #494949;
}

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

    .main-content {
        margin-left: 0;
        padding: 24px 16px;
        padding-bottom: calc(var(--mobile-nav-height) + 16px);
    }

    .mobile-nav {
        display: flex;
    }

    .welcome-card {
        padding: 32px 20px;
    }

    .welcome-card h2 {
        font-size: 1.4rem;
    }

    .welcome-icon {
        font-size: 3rem;
    }
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* --- Sidebar auth --- */
.sidebar-auth {
    padding: 12px var(--padding);
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.user-email {
    font-size: 0.8rem;
    color: var(--text-dim);
    word-break: break-all;
}

.btn-logout {
    background: none;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    padding: 6px 12px;
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 0.8rem;
    cursor: pointer;
    width: 100%;
}

.btn-logout:hover {
    background-color: var(--bg-hover);
    color: var(--text-primary);
}

.sidebar-auth-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.btn-small {
    padding: 8px 16px;
    font-size: 0.85rem;
}

/* --- Auth pages --- */
@media (max-width: 768px) {
    .sidebar-auth {
        display: none;
    }
}
