﻿/* ============================================================
   NekoGit - Dark Theme Stylesheet
   Self-hosted Git code hosting platform
   ============================================================ */

/* ---------- CSS Variables ---------- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --bg: #0f172a;
    --bg-card: #1e293b;
    --bg-hover: #334155;
    --bg-input: #0f172a;
    --text: #e2e8f0;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --border: #334155;
    --border-light: #475569;
    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --danger-dark: #dc2626;
    --info: #3b82f6;
    --radius: 8px;
    --radius-sm: 6px;
    --radius-lg: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
    --transition: all 0.2s ease;
    --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, 'Courier New', monospace;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

img {
    max-width: 100%;
    display: block;
}

code {
    font-family: var(--font-mono);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: var(--radius-sm);
    font-size: 0.9em;
    color: var(--primary-light);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--text);
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 28px; }
h2 { font-size: 22px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }

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

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

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 5px;
    border: 2px solid var(--bg);
}

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

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

* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) var(--bg);
}

/* ============================================================
   1. Navigation Bar with User Dropdown
   ============================================================ */
nav {
    background: var(--bg-card);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    gap: 24px;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(8px);
}

nav .logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    transition: var(--transition);
}

nav .logo:hover {
    opacity: 0.85;
}

nav .nav-links {
    display: flex;
    gap: 4px;
    flex: 1;
    align-items: center;
}

nav .nav-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 12px;
    border-radius: var(--radius);
    transition: var(--transition);
    white-space: nowrap;
}

nav .nav-links a:hover {
    color: var(--text);
    background: var(--bg-hover);
    text-decoration: none;
}

nav .nav-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

nav .nav-right a,
nav .nav-right button {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 14px;
    padding: 6px 14px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: transparent;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

nav .nav-right a:hover,
nav .nav-right button:hover {
    color: var(--text);
    background: var(--bg-hover);
    text-decoration: none;
}

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

nav .nav-right .btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

/* User dropdown menu */
.user-menu {
    position: relative;
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-menu .user-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border-radius: var(--radius);
    transition: var(--transition);
}

.user-menu:hover .user-trigger {
    background: var(--bg-hover);
}

.user-menu .user-trigger .avatar {
    width: 28px;
    height: 28px;
}

.user-menu .user-trigger .username {
    font-size: 14px;
    color: var(--text);
}

.user-menu .dropdown-arrow {
    font-size: 10px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.user-menu:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    min-width: 200px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 200;
    overflow: hidden;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.user-dropdown .dropdown-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
}

.user-dropdown .dropdown-header strong {
    color: var(--text);
    display: block;
    font-size: 14px;
}

.user-dropdown a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    text-decoration: none;
    transition: var(--transition);
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
}

.user-dropdown a:hover {
    background: var(--bg-hover);
    color: var(--primary);
    text-decoration: none;
}

.user-dropdown .dropdown-divider {
    height: 1px;
    background: var(--border);
    margin: 4px 0;
}

/* ============================================================
   2. Cards, Forms, Buttons
   ============================================================ */

/* ---------- Cards ---------- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    transition: var(--transition);
}

.card-hover:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    margin: 0;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
}

/* ---------- Forms ---------- */
.form-group {
    margin-bottom: 16px;
}

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

.form-group label.inline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="url"],
.form-group input[type="number"],
.form-group input:not([type]),
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 14px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: var(--transition);
    font-family: var(--font-sans);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.form-group input:disabled,
.form-group textarea:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-dim);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
    font-family: var(--font-mono);
    line-height: 1.6;
}

.form-group input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary);
    cursor: pointer;
}

.form-group input[type="file"] {
    padding: 8px;
    font-size: 13px;
}

.form-group select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394a3b8' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

.form-actions {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-top: 20px;
}

.form-hint {
    font-size: 12px;
    color: var(--text-dim);
    margin-top: 4px;
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: var(--radius);
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--font-sans);
    transition: var(--transition);
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    line-height: 1.4;
}

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

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

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    text-decoration: none;
    color: white;
}

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

.btn-danger:hover {
    background: var(--danger-dark);
    border-color: var(--danger-dark);
    text-decoration: none;
    color: white;
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border);
}

.btn-ghost:hover {
    color: var(--text);
    background: var(--bg-hover);
    border-color: var(--border-light);
    text-decoration: none;
}

.btn-success {
    background: var(--success);
    color: #000;
    border-color: var(--success);
}

.btn-success:hover {
    opacity: 0.9;
    text-decoration: none;
    color: #000;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    padding: 8px;
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* ============================================================
   3. Repository List & Repo Detail
   ============================================================ */

/* ---------- Repo List ---------- */
.repo-list {
    display: grid;
    gap: 12px;
}

.repo-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.repo-item:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.repo-item .repo-icon {
    font-size: 28px;
    color: var(--text-muted);
    flex-shrink: 0;
}

.repo-item .repo-info {
    flex: 1;
    min-width: 0;
}

.repo-item .repo-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.repo-item .repo-name .owner {
    color: var(--text-muted);
    font-weight: 400;
}

.repo-item .repo-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.repo-item .repo-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    gap: 16px;
    align-items: center;
    flex-shrink: 0;
}

.repo-item .repo-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ---------- Repo Detail ---------- */
.repo-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.repo-header h2 {
    margin: 0;
    display: inline;
}

.repo-header .repo-path {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.repo-description {
    color: var(--text-muted);
    margin-bottom: 16px;
    font-size: 14px;
}

.repo-info-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}

.repo-info-bar .info-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---------- File Tree ---------- */
.file-tree {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
}

.file-tree-header {
    padding: 10px 16px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
}

.file-entry {
    padding: 8px 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    transition: var(--transition);
}

.file-entry:hover {
    background: var(--bg-hover);
}

.file-entry:last-child {
    border-bottom: none;
}

.file-entry .file-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.file-entry .file-name {
    flex: 1;
    color: var(--text);
}

.file-entry .file-name:hover {
    color: var(--primary);
}

.file-entry .file-size {
    color: var(--text-muted);
    font-size: 12px;
}

.file-entry .file-commit-msg {
    color: var(--text-muted);
    font-size: 12px;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-entry.is-dir .file-name {
    font-weight: 500;
}

/* ---------- README ---------- */
.readme-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 16px;
    overflow: hidden;
}

.readme-card .readme-header {
    padding: 12px 20px;
    border-bottom: 1px solid var(--border);
    background: var(--bg-hover);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
}

.readme-card .readme-body {
    padding: 20px;
    color: var(--text);
    line-height: 1.7;
}

.readme-card .readme-body h1,
.readme-card .readme-body h2,
.readme-card .readme-body h3 {
    margin-top: 20px;
    margin-bottom: 10px;
}

.readme-card .readme-body h1:first-child,
.readme-card .readme-body h2:first-child,
.readme-card .readme-body h3:first-child {
    margin-top: 0;
}

.readme-card .readme-body p {
    margin-bottom: 12px;
}

.readme-card .readme-body ul,
.readme-card .readme-body ol {
    margin: 12px 0;
    padding-left: 24px;
}

.readme-card .readme-body li {
    margin-bottom: 4px;
}

.readme-card .readme-body code {
    font-family: var(--font-mono);
    background: var(--bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.readme-card .readme-body pre {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px;
    overflow-x: auto;
    margin: 12px 0;
}

.readme-card .readme-body pre code {
    background: none;
    padding: 0;
}

.readme-card .readme-body blockquote {
    border-left: 3px solid var(--primary);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--text-muted);
}

.readme-card .readme-body a {
    color: var(--primary);
}

.readme-card .readme-body table {
    margin: 12px 0;
}

.readme-card .readme-body img {
    max-width: 100%;
    border-radius: var(--radius);
}

.readme-card .readme-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 20px 0;
}

/* ---------- Clone URL Box ---------- */
.clone-box {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
}

.clone-box .clone-label {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    min-width: 50px;
}

.clone-box .url {
    flex: 1;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.clone-box button {
    padding: 4px 12px;
    font-size: 12px;
}

/* ============================================================
   4. Tabs
   ============================================================ */
.tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
    overflow-x: auto;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 500;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    white-space: nowrap;
    background: transparent;
    border-top: none;
    border-left: none;
    border-right: none;
    margin-bottom: -1px;
}

.tab:hover {
    color: var(--text);
}

.tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.tabs-counter {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--bg-hover);
    border-radius: 10px;
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
}

.tab.active .tabs-counter {
    background: var(--primary);
    color: white;
}

/* ============================================================
   5. Tables
   ============================================================ */
.table-wrapper {
    overflow-x: auto;
    border-radius: var(--radius);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

thead {
    background: var(--bg-hover);
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    vertical-align: middle;
}

th {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
}

tbody tr {
    transition: var(--transition);
}

tbody tr:hover {
    background: var(--bg-hover);
}

tbody tr:last-child td {
    border-bottom: none;
}

td .btn {
    margin-right: 4px;
}

td code {
    font-size: 12px;
}

.table-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* ============================================================
   6. Stats Card Grid (Admin Panel)
   ============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-light);
    box-shadow: var(--shadow);
}

.stat-card .stat-icon {
    font-size: 24px;
    margin-bottom: 12px;
    display: inline-block;
}

.stat-card .stat-label {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-card .stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--primary);
    line-height: 1.2;
}

.stat-card .stat-sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
}

.stat-card .stat-trend {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    margin-top: 6px;
    padding: 2px 8px;
    border-radius: 12px;
}

.stat-trend.up {
    color: var(--success);
    background: rgba(34, 197, 94, 0.1);
}

.stat-trend.down {
    color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* ============================================================
   7. Progress Bar (CPU/Memory Usage)
   ============================================================ */
.progress-bar {
    height: 8px;
    background: var(--bg-input);
    border-radius: 4px;
    overflow: hidden;
    margin-top: 12px;
    position: relative;
}

.progress-bar .fill {
    height: 100%;
    background: var(--primary);
    border-radius: 4px;
    transition: width 0.5s ease;
    position: relative;
    overflow: hidden;
}

.progress-bar .fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.2),
        transparent
    );
    animation: shimmer 2s infinite;
}

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

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

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

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ============================================================
   8. Avatars (Circular, Multiple Sizes)
   ============================================================ */
.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bg-hover);
    border: 1px solid var(--border);
    flex-shrink: 0;
    display: inline-block;
}

.avatar-xs { width: 20px; height: 20px; }
.avatar-sm { width: 24px; height: 24px; }
.avatar-md { width: 40px; height: 40px; }
.avatar-lg { width: 80px; height: 80px; }
.avatar-xl { width: 120px; height: 120px; }

.avatar-link {
    display: inline-block;
    transition: var(--transition);
    position: relative;
}

.avatar-link:hover {
    opacity: 0.85;
}

.avatar-group {
    display: inline-flex;
    align-items: center;
}

.avatar-group .avatar {
    margin-left: -8px;
    border: 2px solid var(--bg-card);
}

.avatar-group .avatar:first-child {
    margin-left: 0;
}

.avatar-text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 600;
    text-transform: uppercase;
}

/* ============================================================
   9. Toast Notifications
   ============================================================ */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    padding: 12px 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: var(--radius);
    color: var(--text);
    z-index: 1000;
    animation: toastSlideIn 0.3s ease;
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.toast-error {
    border-left-color: var(--danger);
}

.toast.toast-success {
    border-left-color: var(--success);
}

.toast.toast-warning {
    border-left-color: var(--warning);
}

.toast.toast-info {
    border-left-color: var(--info);
}

.toast .toast-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.toast.fade-out {
    animation: toastFadeOut 0.3s ease forwards;
}

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

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

/* ============================================================
   10. Badges
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-private {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-public {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-admin {
    background: rgba(99, 102, 241, 0.15);
    color: var(--primary-light);
    border: 1px solid rgba(99, 102, 241, 0.3);
}

.badge-active {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-inactive {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.badge-info {
    background: rgba(59, 130, 246, 0.15);
    color: var(--info);
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.badge-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 2px;
}

.badge-dot-success { background: var(--success); }
.badge-dot-danger { background: var(--danger); }
.badge-dot-warning { background: var(--warning); }
.badge-dot-info { background: var(--info); }

/* ============================================================
   11. Code Viewer (Monospace with Syntax Highlighting Background)
   ============================================================ */
.code-viewer {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    white-space: pre;
    color: var(--text);
    position: relative;
}

.code-viewer .line-numbers {
    counter-reset: line;
    display: inline-block;
    text-align: right;
    padding-right: 16px;
    margin-right: 16px;
    border-right: 1px solid var(--border);
    color: var(--text-dim);
    user-select: none;
}

.code-viewer .line-numbers .line-number::before {
    counter-increment: line;
    content: counter(line);
    display: block;
}

.code-block {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 12px 0;
}

.code-block .code-header {
    padding: 8px 16px;
    background: var(--bg-hover);
    border-bottom: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.code-block .code-header .copy-btn {
    cursor: pointer;
    color: var(--text-muted);
    transition: var(--transition);
}

.code-block .code-header .copy-btn:hover {
    color: var(--primary);
}

.code-block pre {
    padding: 16px;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}

/* Syntax highlight tokens */
.token-keyword { color: #c084fc; }
.token-string { color: #86efac; }
.token-number { color: #fbbf24; }
.token-comment { color: var(--text-dim); font-style: italic; }
.token-function { color: #60a5fa; }
.token-tag { color: #f87171; }
.token-attr { color: #fbbf24; }
.token-punctuation { color: var(--text-muted); }
.token-operator { color: #f472b6; }
.token-property { color: var(--primary-light); }

/* Diff viewer */
.diff-viewer {
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: 13px;
}

.diff-line {
    padding: 2px 16px;
    white-space: pre;
    display: flex;
    align-items: center;
}

.diff-line.added {
    background: rgba(34, 197, 94, 0.1);
    color: #86efac;
}

.diff-line.removed {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
}

.diff-line.context {
    color: var(--text-muted);
}

.diff-line .line-num {
    color: var(--text-dim);
    min-width: 40px;
    user-select: none;
}

/* ============================================================
   12. Modal Dialog
   ============================================================ */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    padding: 20px;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.95);
    transition: var(--transition);
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal.modal-lg {
    max-width: 800px;
}

.modal.modal-sm {
    max-width: 400px;
}

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

.modal-header h3 {
    margin: 0;
    font-size: 18px;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 22px;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
    transition: var(--transition);
}

.modal-close:hover {
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* ============================================================
   13. Pagination
   ============================================================ */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
    flex-wrap: wrap;
}

.pagination .page-item {
    list-style: none;
}

.pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg-card);
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
}

.pagination .page-link:hover {
    background: var(--bg-hover);
    border-color: var(--border-light);
    color: var(--text);
    text-decoration: none;
}

.pagination .page-item.active .page-link {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}

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

.pagination .page-link.prev,
.pagination .page-link.next {
    font-size: 13px;
}

.pagination-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: 8px;
}

/* ============================================================
   14. Empty State
   ============================================================ */
.empty-state {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
}

.empty-state .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.empty-state .empty-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
}

.empty-state .empty-desc {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-state .empty-action {
    margin-top: 16px;
}

/* ============================================================
   15. Loading Spinner
   ============================================================ */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

.spinner-sm {
    width: 14px;
    height: 14px;
    border-width: 2px;
}

.spinner-container {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px;
    flex-direction: column;
    gap: 12px;
}

.spinner-container .spinner-text {
    color: var(--text-muted);
    font-size: 14px;
}

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

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    border-radius: inherit;
}

/* ============================================================
   16. User Profile Page
   ============================================================ */
.profile-header {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    display: flex;
    align-items: flex-start;
    gap: 24px;
    flex-wrap: wrap;
}

.profile-header .profile-avatar {
    flex-shrink: 0;
}

.profile-header .profile-info {
    flex: 1;
    min-width: 250px;
}

.profile-header .profile-name {
    font-size: 24px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.profile-header .profile-username {
    font-size: 16px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.profile-header .profile-bio {
    color: var(--text);
    font-size: 14px;
    margin-bottom: 12px;
    line-height: 1.6;
}

.profile-header .profile-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 13px;
    color: var(--text-muted);
}

.profile-header .profile-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.profile-header .profile-stats {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
}

.profile-header .profile-stat {
    text-align: center;
}

.profile-header .profile-stat .stat-num {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.profile-header .profile-stat .stat-text {
    font-size: 12px;
    color: var(--text-muted);
}

.profile-header .profile-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ============================================================
   17. Issue List
   ============================================================ */
.issue-list {
    display: grid;
    gap: 8px;
}

.issue-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    transition: var(--transition);
}

.issue-item:hover {
    border-color: var(--border-light);
    background: var(--bg-hover);
}

.issue-item .issue-icon {
    font-size: 20px;
    flex-shrink: 0;
    margin-top: 2px;
}

.issue-item .issue-icon.open { color: var(--success); }
.issue-item .issue-icon.closed { color: var(--danger); }

.issue-item .issue-content {
    flex: 1;
    min-width: 0;
}

.issue-item .issue-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.issue-item .issue-title:hover {
    color: var(--primary);
}

.issue-item .issue-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

.issue-item .issue-meta {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 6px;
    flex-wrap: wrap;
}

.issue-item .issue-assignees {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.issue-labels {
    display: inline-flex;
    gap: 4px;
    flex-wrap: wrap;
}

.issue-label {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid var(--border);
}

/* ============================================================
   18. Commit History
   ============================================================ */
.commit-list {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.commit-item {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: flex-start;
    gap: 12px;
    transition: var(--transition);
}

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

.commit-item:hover {
    background: var(--bg-hover);
}

.commit-item .commit-avatar {
    flex-shrink: 0;
}

.commit-item .commit-content {
    flex: 1;
    min-width: 0;
}

.commit-item .commit-msg {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.commit-item .commit-msg .commit-subject {
    font-weight: 600;
}

.commit-item .commit-meta {
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.commit-item .commit-author {
    color: var(--text);
    font-weight: 500;
}

.commit-item .commit-hash {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
    background: var(--bg);
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.commit-item .commit-hash:hover {
    color: var(--primary);
    border-color: var(--primary);
}

.commit-item .commit-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.commit-stats {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-family: var(--font-mono);
}

.commit-stats .additions {
    color: var(--success);
}

.commit-stats .deletions {
    color: var(--danger);
}

/* ============================================================
   Utility Classes
   ============================================================ */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-sm { font-size: 12px; }
.text-lg { font-size: 16px; }
.text-bold { font-weight: 700; }
.text-mono { font-family: var(--font-mono); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }

.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }

.w-full { width: 100%; }
.hidden { display: none; }

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.divider {
    height: 1px;
    background: var(--border);
    margin: 20px 0;
    border: none;
}

.alert {
    padding: 12px 16px;
    border-radius: var(--radius);
    margin-bottom: 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: var(--warning);
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: var(--info);
}

/* ============================================================
   Layout
   ============================================================ */
#app {
    flex: 1;
    padding: 32px 24px;
    max-width: 1280px;
    margin: 0 auto;
    width: 100%;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 12px;
}

.page-header h2 {
    margin: 0;
}

.page-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: var(--text-muted);
}

.breadcrumb a:hover {
    color: var(--primary);
}

.breadcrumb .separator {
    color: var(--text-dim);
}

.breadcrumb .current {
    color: var(--text);
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

footer {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: auto;
}

footer a {
    color: var(--text-muted);
}

footer a:hover {
    color: var(--primary);
}

/* ============================================================
   19. Responsive Design (Mobile Adaptation)
   ============================================================ */
@media (max-width: 1024px) {
    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    nav {
        padding: 0 12px;
        gap: 12px;
        height: 52px;
    }

    nav .logo {
        font-size: 18px;
    }

    nav .nav-links {
        gap: 2px;
    }

    nav .nav-links a {
        padding: 6px 8px;
        font-size: 13px;
    }

    nav .nav-right a,
    nav .nav-right button {
        padding: 6px 10px;
        font-size: 13px;
    }

    #app {
        padding: 16px 12px;
    }

    h1 { font-size: 24px; }
    h2 { font-size: 20px; }
    h3 { font-size: 16px; }

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

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 16px;
    }

    .repo-item {
        flex-wrap: wrap;
        padding: 14px 16px;
    }

    .repo-item .repo-meta {
        width: 100%;
        margin-top: 8px;
    }

    .repo-item .repo-desc {
        white-space: normal;
    }

    .tabs {
        gap: 2px;
    }

    .tab {
        padding: 8px 12px;
        font-size: 13px;
    }

    th, td {
        padding: 8px 10px;
        font-size: 13px;
    }

    .table-wrapper {
        overflow-x: auto;
    }

    .profile-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .profile-header .profile-info {
        width: 100%;
    }

    .profile-header .profile-meta {
        justify-content: center;
    }

    .profile-header .profile-stats {
        justify-content: center;
    }

    .profile-header .profile-actions {
        justify-content: center;
        width: 100%;
    }

    .modal {
        max-width: 100%;
        margin: 10px;
    }

    .toast {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .clone-box {
        flex-wrap: wrap;
    }

    .clone-box .url {
        width: 100%;
        order: 3;
    }

    .commit-item {
        flex-direction: column;
    }

    .commit-item .commit-actions {
        margin-top: 8px;
    }

    .pagination .page-link {
        min-width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .user-menu .user-trigger .username {
        display: none;
    }
}

@media (max-width: 480px) {
    nav .nav-links {
        display: none;
    }

    nav {
        justify-content: space-between;
    }

    .btn {
        padding: 8px 14px;
        font-size: 13px;
    }

    .stat-card .stat-value {
        font-size: 22px;
    }
}

/* ============================================================
   20. Print Styles
   ============================================================ */
@media print {
    nav, footer, .btn, .toast, .modal-overlay {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card {
        border: 1px solid #ccc;
        background: white;
    }
}
