/* ============================================
   GitHub Docker Manager – Custom Styles
   Default: Dark Mode
   ============================================ */

:root {
    --navbar-height: 60px;
    --sidebar-width: 0px;
    --transition-speed: 0.25s;
}

/* ---- Navbar ---- */
.navbar {
    height: var(--navbar-height);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 1040;
}

[data-bs-theme="dark"] .navbar {
    background: rgba(13, 17, 23, 0.92) !important;
}

[data-bs-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.92) !important;
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

.navbar-brand {
    font-size: 1rem;
    letter-spacing: -0.02em;
}

/* ---- Main Wrapper ---- */
.main-wrapper {
    padding-top: calc(var(--navbar-height) + 1rem);
    min-height: 100vh;
}

/* ---- Footer ---- */
.footer {
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 3rem;
}

[data-bs-theme="light"] .footer {
    border-top-color: rgba(0, 0, 0, 0.06);
}

/* ---- Cards ---- */
.card {
    border-radius: 12px;
    transition: box-shadow var(--transition-speed);
}

[data-bs-theme="dark"] .card {
    background: #161b22;
    border-color: #30363d;
}

[data-bs-theme="dark"] .card-header {
    background: #21262d;
    border-bottom-color: #30363d;
}

[data-bs-theme="light"] .card {
    background: #ffffff;
    border-color: #e1e4e8;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

[data-bs-theme="light"] .card-header {
    background: #f6f8fa;
    border-bottom-color: #e1e4e8;
}

.repo-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-bs-theme="light"] .repo-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
}

/* ---- Stat Cards ---- */
.stat-card {
    border-radius: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: 700;
    line-height: 1;
}

.stat-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--bs-text-opacity);
    opacity: 0.6;
    margin-top: 2px;
}

/* ---- Badges ---- */
.badge-update {
    background: rgba(234, 179, 8, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(234, 179, 8, 0.3);
    font-weight: 500;
}

.badge-ok {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
    border: 1px solid rgba(34, 197, 94, 0.25);
    font-weight: 500;
}

[data-bs-theme="light"] .badge-update {
    background: rgba(234, 179, 8, 0.12);
    color: #b45309;
    border-color: rgba(234, 179, 8, 0.3);
}

[data-bs-theme="light"] .badge-ok {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.25);
}

.badge-error {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.25);
    font-weight: 500;
}

[data-bs-theme="light"] .badge-error {
    color: #dc2626;
}

/* ---- Tables ---- */
[data-bs-theme="dark"] .table {
    --bs-table-hover-bg: rgba(255, 255, 255, 0.04);
}

/* ---- Log Output ---- */
.log-output {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.78rem;
    line-height: 1.5;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
    border-radius: 0 0 6px 6px;
}

[data-bs-theme="dark"] .log-output {
    background: #0d1117;
    color: #e6edf3;
}

[data-bs-theme="light"] .log-output {
    background: #f6f8fa;
    color: #24292f;
}

/* ---- Form Controls ---- */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background-color: #0d1117;
    border-color: #30363d;
    color: #c9d1d9;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background-color: #0d1117;
    border-color: #58a6ff;
    color: #e6edf3;
    box-shadow: 0 0 0 3px rgba(88, 166, 255, 0.1);
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: #484f58;
}

/* ---- Nav tabs ---- */
[data-bs-theme="dark"] .nav-tabs {
    border-bottom-color: #30363d;
}

[data-bs-theme="dark"] .nav-tabs .nav-link {
    color: #8b949e;
    border-color: transparent;
}

[data-bs-theme="dark"] .nav-tabs .nav-link:hover {
    border-color: #30363d;
    color: #e6edf3;
}

[data-bs-theme="dark"] .nav-tabs .nav-link.active {
    background: #161b22;
    border-color: #30363d #30363d #161b22;
    color: #e6edf3;
}

/* ---- Accordion ---- */
[data-bs-theme="dark"] .accordion-item {
    background: #161b22;
    border-color: #30363d;
}

[data-bs-theme="dark"] .accordion-button {
    background: #21262d;
    color: #c9d1d9;
}

[data-bs-theme="dark"] .accordion-button:not(.collapsed) {
    background: #21262d;
    color: #e6edf3;
    box-shadow: inset 0 -1px 0 #30363d;
}

[data-bs-theme="dark"] .accordion-button::after {
    filter: invert(1);
}

/* ---- Login Page ---- */
.login-page {
    background: linear-gradient(135deg, #0d1117 0%, #161b22 50%, #0d1117 100%);
}

[data-bs-theme="light"] .login-page {
    background: linear-gradient(135deg, #f0f4f8 0%, #e8f0fe 50%, #f0f4f8 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    padding: 2rem;
    border-radius: 16px;
}

[data-bs-theme="dark"] .login-card {
    background: #161b22;
    border: 1px solid #30363d;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
}

[data-bs-theme="light"] .login-card {
    background: #ffffff;
    border: 1px solid #e1e4e8;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.1);
}

/* ---- Transitions ---- */
body {
    transition: background-color var(--transition-speed), color var(--transition-speed);
}

.card, .btn, .badge, .navbar, .form-control, .form-select {
    transition: all var(--transition-speed);
}

/* ---- Scrollbar (dark mode) ---- */
[data-bs-theme="dark"] ::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-track {
    background: #0d1117;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb {
    background: #30363d;
    border-radius: 3px;
}

[data-bs-theme="dark"] ::-webkit-scrollbar-thumb:hover {
    background: #484f58;
}

/* ---- Alert ---- */
[data-bs-theme="dark"] .alert-secondary {
    background: rgba(139, 148, 158, 0.1);
    border-color: rgba(139, 148, 158, 0.2);
    color: #8b949e;
}

/* ---- Code ---- */
[data-bs-theme="dark"] code {
    color: #79c0ff;
    background: rgba(121, 192, 255, 0.08);
    padding: 0.1em 0.3em;
    border-radius: 4px;
    font-size: 0.85em;
}

/* ---- Responsive ---- */
@media (max-width: 576px) {
    .stat-value {
        font-size: 1.4rem;
    }

    .main-wrapper {
        padding-top: calc(var(--navbar-height) + 0.5rem);
    }
}
