/* -------------------- GLOBAL RESET -------------------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Poppins", sans-serif;
}

/* -------------------- GLOBAL PAGE BACKGROUND -------------------- */
body {
    min-height: 100vh;
    background: linear-gradient(135deg, #0a1a2f, #122b45);
    /* unified dark blue gradient */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    color: #fff;
    font-family: 'Inter', sans-serif;
}

/* -------------------- COMMON PAGE STYLES -------------------- */
.login-page,
.home-hero,
.repo-section {
    background: none;
    /* background now handled by body */
    color: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
}

/* -------------------- LOGIN / USER CARD -------------------- */
.login-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem 0;
}

.login-card {
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    width: 350px;
    animation: fadeIn 1s ease forwards;
    color: #333;
}

h2 {
    font-size: 28px;
    margin-bottom: 0.5rem;
    color: #141e30;
}

.subtitle {
    color: #555;
    font-size: 14px;
    margin-bottom: 2rem;
}

/* -------------------- INPUT GROUPS -------------------- */
.input-group {
    margin-bottom: 1.2rem;
}

.input-group input {
    width: 100%;
    padding: 12px 15px;
    border: none;
    border-radius: 10px;
    background: #f3f3f3;
    color: #333;
    font-size: 15px;
    transition: all 0.3s ease;
}

.input-group input::placeholder {
    color: #777;
}

.input-group input:focus {
    outline: none;
    background: #e8e8e8;
    box-shadow: 0 0 8px #00bfff;
}

/* -------------------- CHECKBOX + BUTTONS -------------------- */
.remember {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
    font-size: 14px;
    color: #444;
}

.remember input {
    accent-color: #00bfff;
    margin-right: 8px;
    cursor: pointer;
}

.btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #00bfff, #0077ff);
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn:hover {
    background: linear-gradient(135deg, #00ffff, #00bfff);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 191, 255, 0.3);
}

.btn-logout {
    background: linear-gradient(135deg, #ff4d4d, #cc0000);
    color: #fff;
}

.btn-logout:hover {
    background: linear-gradient(135deg, #ff6666, #ff1a1a);
}

/* -------------------- GITHUB LOGIN BUTTON -------------------- */
.btn-github {
    margin-top: 1.5rem;
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 10px;
    background: #24292e;
    color: #fff;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
}

.btn-github:hover {
    background: #333;
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.github-logo {
    width: 20px;
    height: 20px;
    filter: brightness(0) invert(1);
}

/* -------------------- NAVBAR -------------------- */
.navbar-brand span {
    font-size: 1.3rem;
    color: #000;
}

.navbar .nav-link {
    color: #333;
    font-weight: 500;
}

.navbar .nav-link:hover {
    color: #007bff;
}

/* -------------------- FOOTER -------------------- */
footer {
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
}

/* -------------------- ABOUT PAGE -------------------- */
.about-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 4rem 1rem;
    /* adds breathing space */
    min-height: 100vh;
    /* keeps it centered on tall pages */
    box-sizing: border-box;
}

.about-card {
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    text-align: left;
    width: 100%;
    max-width: 700px;
    /* centers nicely */
    color: #333;
    line-height: 1.7;
    animation: fadeIn 1s ease forwards;
    overflow-wrap: break-word;
}

.about-card h1 {
    text-align: center;
    color: #141e30;
    margin-bottom: 1.5rem;
}

.about-card p {
    margin-bottom: 1rem;
}

/* -------------------- REPOSITORY GRID -------------------- */
.repo-section {
    width: 100%;
    padding: 4rem 2rem 6rem;
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: linear-gradient(135deg, #141e30, #243b55);
}

.repo-title {
    color: #00bfff;
    font-size: 2.2rem;
    font-weight: 600;
    text-align: center;
    position: relative;
    margin-bottom: 2.5rem;
}

.repo-title::after {
    content: "";
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, #00bfff, #0077ff);
    margin: 10px auto 0;
    border-radius: 10px;
    animation: glowBar 3s ease-in-out infinite alternate;
}

@keyframes glowBar {
    from {
        box-shadow: 0 0 5px #00bfff;
    }

    to {
        box-shadow: 0 0 20px #00bfff, 0 0 40px #0077ff;
    }
}

.repo-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1600px;
    /* wider to fit 4 cleanly */
    margin: 0 auto;
    justify-items: center;
    align-items: start;
}

/* 🖥️ Desktop (≥1200px) — force 4 columns evenly spaced */
@media (min-width: 1200px) {
    .repo-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* 💻 Tablet (≤991px) — 2 per row */
@media (max-width: 991px) {
    .repo-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 📱 Mobile (≤576px) — 1 per row */
@media (max-width: 576px) {
    .repo-container {
        grid-template-columns: 1fr;
    }
}

/* -------------------- REPOSITORY CARD LAYOUT -------------------- */
.repo-card {
    background: #fff;
    color: #333;
    border-radius: 16px;
    padding: 1.5rem;
    width: 100%;
    max-width: 340px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 480px;
    /* ✅ Keeps consistent height for all cards */
}

/* Hover glow */
.repo-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 20px rgba(0, 191, 255, 0.3);
}

/* --- Card Header --- */
.repo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.repo-header h3 {
    font-size: 1rem;
    margin: 0;
}

.repo-header a {
    color: #0077ff;
    text-decoration: none;
    font-weight: 600;
}

.repo-header a:hover {
    color: #00bfff;
}

.repo-stats {
    font-size: 0.9rem;
    color: #666;
}

/* --- Card Description --- */
.repo-card p {
    font-size: 0.9rem;
    color: #444;
    margin-top: 0.5rem;
    line-height: 1.4;
    min-height: 40px;
    /* ✅ ensures spacing even if description missing */
}

/* --- Footer Section (Language + Date) --- */
.repo-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin-top: auto;
    padding-top: 0.8rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    margin-bottom: 1rem;
    /* ✅ breathing space before buttons */
}

.badge {
    background: linear-gradient(135deg, #00bfff, #0077ff);
    color: white;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
}

.repo-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px 16px;
    /* vertical | horizontal spacing */
    margin-top: 1rem;
}

.repo-actions .btn-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    /* equal height, flexible width */
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 8px;
    border: none;
    line-height: 1.2;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    /* prevents wrapping */
    transition: all 0.2s ease;
}

.repo-actions .btn-action:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.repo-actions .btn-action:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}


.btn-action {
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.85rem;
    text-decoration: none;
    color: white;
    transition: background 0.3s, transform 0.2s;
    white-space: nowrap;
    border: none;
    cursor: pointer;
}

.btn-action:hover {
    transform: translateY(-3px);
    opacity: 0.9;
}

.btn-action.view {
    background: linear-gradient(135deg, #0077ff, #00bfff);
}

.btn-action.download {
    background: linear-gradient(135deg, #28a745, #20c997);
}

.btn-action.fork {
    background: linear-gradient(135deg, #ff7b00, #ffb300);
}

.btn-action.star {
    background: linear-gradient(135deg, #ffd700, #ffb300);
    color: #222;
}



/* -------------------- ANIMATIONS -------------------- */
@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(30px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

/* -------------------- RESPONSIVE -------------------- */

.btn-action.bookmark,
.btn-action.remove {
    background: linear-gradient(135deg, #6f42c1, #9b59b6);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-action.bookmark:hover,
.btn-action.remove:hover {
    background: linear-gradient(135deg, #8e44ad, #a569bd);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.btn-action.delete {
    background: linear-gradient(135deg, #6f42c1, #9b59b6);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.btn-action.delete:hover {
    background: linear-gradient(135deg, #8e44ad, #a569bd);
    color: #ffffff;
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(155, 89, 182, 0.4);
}

.repo-section .text-muted {
    color: #ffffff !important;
    opacity: 1 !important;
}

.search-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    background: linear-gradient(135deg, #00bfff, #0077ff);
    border: none;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: linear-gradient(135deg, #00ffff, #00bfff);
    transform: translateY(-2px);
    box-shadow: 0 3px 10px rgba(0, 191, 255, 0.4);
}

.repo-comments-container {
    margin-top: 0.8rem;
    text-align: center;
}

.repo-comments {
    max-height: 220px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #444 transparent;
    padding-right: 5px;
    margin-top: 0.5rem;
    text-align: left;
}

.repo-comments::-webkit-scrollbar {
    width: 6px;
}

.repo-comments::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 3px;
}

.comment-item {
    margin-bottom: 0.3rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #333;
}

.comment-item:hover {
    background-color: rgba(255, 255, 255, 0.02);
}


.toggle-comments-btn {
    width: 90%;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.toggle-comments-btn:hover,
.toggle-comments-btn:focus {
    background-color: #007bff;
    color: white;
    border-color: #007bff;
}

.toggle-comments-btn {
    background-color: #dc3545;
    color: #fff;
    border: none;
    width: 90%;
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.4rem;
    font-weight: 500;
    border-radius: 10px;
    transition: all 0.2s ease;
}

.toggle-comments-btn:hover,
.toggle-comments-btn:focus {
    background-color: #c82333;
    color: #fff;
    transform: scale(1.02);
}

.btn-action.comment {
    background-color: #dc3545;
    color: #fff;
    border: none;
    border-radius: 8px;
    transition: all 0.2s ease-in-out;
}

.btn-action.comment:hover,
.btn-action.comment:focus {
    background-color: #c82333;
    color: #fff;
    transform: scale(1.05);
}

section#alerts {
    margin-top: 5em;
}

/* -------------------- 404 PAGE -------------------- */
.error-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 4rem 1rem;
}

.error-card {
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 500px;
    width: 100%;
    color: #333;
    animation: fadeIn 1s ease forwards;
}

.error-card h1 {
    font-size: 4rem;
    font-weight: 700;
    color: #0077ff;
    margin-bottom: 0.5rem;
}

.error-card h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #141e30;
}

.error-card p {
    margin-bottom: 1.5rem;
    color: #555;
}

/* -------------------- SUCCESS PAGE -------------------- */
.success-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex: 1;
    padding: 4rem 1rem;
}

.success-card {
    background: #ffffff;
    padding: 3rem 2.5rem;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-width: 550px;
    width: 100%;
    color: #333;
    animation: fadeIn 1s ease forwards;
}

.success-card h1 {
    color: #28a745;
    font-weight: 700;
    margin-bottom: 1rem;
}

.success-card p {
    color: #555;
    margin-bottom: 1.5rem;
}