:root {
    --bg-color: #0f172a;
    --panel-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --border: rgba(255, 255, 255, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    min-height: 100vh;
}

/* Typography & Utilities */
h1,
h2,
h3,
h4 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

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

.text-small {
    font-size: 0.875rem;
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--panel-bg);
    border-right: 1px solid var(--border);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
}

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

.user-badge {
    background: var(--primary);
    width: 35px;
    height: 35px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.nav-menu {
    list-style: none;
    padding: 20px 0;
    flex-grow: 1;
}

.nav-link {
    display: block;
    padding: 12px 20px;
    color: var(--text-main);
    text-decoration: none;
    transition: 0.2s;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
}

.logout-link {
    margin-top: auto;
}

/* Main Content */
.main-content {
    flex-grow: 1;
    padding: 30px;
    overflow-y: auto;
}

.main-content.full-width {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Glass Panels */
.glass-panel {
    background: var(--panel-bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Forms & Inputs */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

input[type="text"],
input[type="password"],
textarea {
    width: 100%;
    padding: 12px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: white;
    font-family: inherit;
}

input:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
}

/* Buttons */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    color: white;
}

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

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

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-action {
    background: linear-gradient(135deg, #8b5cf6, #3b82f6);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

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

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

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8rem;
}

/* Login & Auth Pages */
.auth-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    animation: authFadeIn 0.6s ease-out;
}

@keyframes authFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-card {
    position: relative;
    overflow: hidden;
    padding: 40px 36px;
}

/* Decorative background glow */
.auth-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    pointer-events: none;
    z-index: 0;
}

.auth-glow-1 {
    width: 250px;
    height: 250px;
    background: #60a5fa;
    top: -60px;
    left: -60px;
    animation: glowPulse 4s ease-in-out infinite alternate;
}

.auth-glow-2 {
    width: 200px;
    height: 200px;
    background: #a78bfa;
    bottom: -50px;
    right: -50px;
    animation: glowPulse 4s ease-in-out 2s infinite alternate;
}

@keyframes glowPulse {
    from {
        opacity: 0.1;
        transform: scale(1);
    }

    to {
        opacity: 0.25;
        transform: scale(1.15);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.auth-logo {
    margin-bottom: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: rgba(96, 165, 250, 0.08);
    border: 1px solid rgba(96, 165, 250, 0.15);
}

.auth-title {
    font-size: 1.75rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa, #a78bfa);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 6px;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Alerts */
.auth-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
    animation: alertSlide 0.3s ease-out;
}

@keyframes alertSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-alert-error {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

.auth-alert-success {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #6ee7b7;
}

/* Form */
.auth-form {
    position: relative;
    z-index: 1;
}

.auth-form-group {
    margin-bottom: 22px;
    position: relative;
}

.auth-form-group label {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 8px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    transition: color 0.2s;
}

.auth-form-group.focused label {
    color: #93c5fd;
}

.auth-form-group input[type="text"],
.auth-form-group input[type="password"] {
    width: 100%;
    padding: 13px 16px;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: #f1f5f9;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s, background 0.3s;
}

.auth-form-group input:focus {
    outline: none;
    border-color: rgba(96, 165, 250, 0.5);
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
    background: rgba(15, 23, 42, 0.8);
}

.auth-form-group input::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.input-focus-line {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #60a5fa, #a78bfa);
    border-radius: 1px;
    transition: width 0.3s ease, left 0.3s ease;
}

.auth-form-group.focused .input-focus-line {
    width: 100%;
    left: 0;
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 48px !important;
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-password:hover {
    color: #93c5fd;
}

/* Password strength */
.password-strength {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 22px;
}

.strength-bars {
    display: flex;
    gap: 4px;
    flex: 1;
}

.strength-bar {
    height: 4px;
    flex: 1;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.08);
    transition: background 0.3s, transform 0.3s;
    transform-origin: left;
}

.strength-label {
    font-size: 0.75rem;
    font-weight: 600;
    min-width: 45px;
    text-align: right;
    transition: color 0.3s;
}

/* Auth button */
.auth-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
}

.auth-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transition: left 0.5s;
}

.auth-btn:hover::before {
    left: 100%;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.auth-btn:active {
    transform: translateY(0);
}

.btn-arrow {
    transition: transform 0.3s;
}

.auth-btn:hover .btn-arrow {
    transform: translateX(3px);
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 28px 0 20px;
    z-index: 1;
}

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

.auth-divider span {
    position: relative;
    padding: 0 16px;
    font-size: 0.8rem;
    color: var(--text-muted);
    background: var(--panel-bg);
}

/* Footer link */
.auth-footer {
    text-align: center;
    position: relative;
    z-index: 1;
}

.auth-footer p {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.auth-link {
    color: #60a5fa;
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.auth-link:hover {
    color: #93c5fd;
    text-decoration: underline;
}


/* Dashboard */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.repo-card {
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    gap: 15px;
}

.repo-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
}

.repo-icon {
    font-size: 2.5rem;
    flex-shrink: 0;
}

.repo-info {
    overflow: hidden;
}

.repo-info .path {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Repository View */
.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.repo-actions {
    display: flex;
    gap: 10px;
}

.repo-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media(min-width: 1200px) {
    .repo-layout {
        grid-template-columns: 350px 1fr;
    }
}

/* Timeline */
.timeline {
    position: relative;
    padding-left: 20px;
    margin-top: 20px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 25px;
}

.timeline-marker {
    position: absolute;
    left: -25px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary);
    border: 2px solid var(--panel-bg);
}

.commit-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.commit-actions {
    margin-top: 10px;
    display: flex;
    gap: 5px;
}

/* Diff Viewer */
.diff-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
}

.diff-content {
    overflow-x: auto;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    padding: 10px;
}

.diff {
    width: 100%;
    border-collapse: collapse;
    font-family: monospace;
    font-size: 0.9rem;
    color: #e2e8f0;
}

.diff td {
    padding: 4px 8px;
    vertical-align: top;
    word-break: break-all;
}

.diff_add {
    background-color: rgba(16, 185, 129, 0.25) !important;
    border-left: 3px solid #10b981;
}

.diff_sub {
    background-color: rgba(239, 68, 68, 0.25) !important;
    border-left: 3px solid #ef4444;
}

.diff_chg {
    background-color: rgba(245, 158, 11, 0.25) !important;
    border-left: 3px solid #f59e0b;
}

span.diff_add {
    background-color: rgba(16, 185, 129, 0.4) !important;
    color: #34d399 !important;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}

span.diff_sub {
    background-color: rgba(239, 68, 68, 0.4) !important;
    color: #f87171 !important;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
    text-decoration: line-through;
}

span.diff_chg {
    background-color: rgba(245, 158, 11, 0.4) !important;
    color: #fbbf24 !important;
    font-weight: 600;
    padding: 1px 4px;
    border-radius: 3px;
}

th.diff_header {
    background-color: rgba(15, 23, 42, 0.9) !important;
    text-align: center;
    color: #fff;
    font-weight: 600;
    padding: 10px 15px;
    border-bottom: 2px solid var(--border);
    font-size: 0.95rem;
}

td.diff_header {
    background-color: rgba(15, 23, 42, 0.6) !important;
    text-align: right;
    color: var(--text-muted);
    font-weight: 500;
    width: 45px;
    border-right: 1px solid var(--border);
    padding-right: 8px;
    user-select: none;
    font-size: 0.8rem;
}

.diff_next {
    display: none;
}

/* Hide navigation column */
.badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.75rem;
    text-transform: uppercase;
}

.badge.added {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.badge.modified {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge.deleted {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Modals & Wizards */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 10% auto;
    width: 90%;
    max-width: 500px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.wizard-modal .modal-content {
    max-width: 600px;
}

.modal-header,
.wizard-header {
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    margin-bottom: 15px;
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-muted);
}

.wizard-steps {
    display: flex;
    margin-top: 15px;
    gap: 10px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: var(--text-muted);
    transition: 0.3s;
}

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

.wizard-body {
    min-height: 150px;
    padding: 20px 0;
}

.wizard-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    border-top: 1px solid var(--border);
    padding-top: 15px;
}

.changes-list {
    list-style: none;
    max-height: 200px;
    overflow-y: auto;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 6px;
    padding: 10px;
    margin-top: 10px;
}

.changes-list li {
    padding: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    gap: 10px;
}

.status-badge {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.status-badge.green {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
}

.status-badge.orange {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.status-badge.red {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

/* Loader */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

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

.progress-bar-container {
    width: 300px;
    height: 10px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    margin-top: 15px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.2s;
}

/* Toasts */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    padding: 15px 25px;
    border-radius: 6px;
    margin-top: 10px;
    color: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

.toast.success {
    background: var(--success);
}

.toast.error {
    background: var(--danger);
}

.toast.info {
    background: var(--primary);
}

/* Split Layout for Wizards */
.wizard-split-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 20px;
}

.clickable-change-item {
    cursor: pointer;
    transition: background 0.2s, border-left 0.2s;
    border-left: 3px solid transparent;
}

.clickable-change-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.clickable-change-item.active {
    background: rgba(255, 255, 255, 0.1);
    border-left-color: var(--primary);
}

.diff td {
    padding: 4px 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.85rem;
    vertical-align: top;
    white-space: pre-wrap;
    word-break: break-all;
}