/*
    Built by Ali Coder (https://x.com/AliCoder)

    This project was built for fun as part of the AI Foundation community on Skool.
    We do projects like this all the time to learn and grow together.

    ⭐ Top 1% Skool Community | 🏆 Verified Skool Games Winners
    ➡️ Join and implement automations & agents TODAY!
    When you join, you’ll instantly access:
    📚 6+ 𝗘𝗩𝗢𝗟𝗩𝗜𝗡𝗚 Courses! (Agents, Vibe Coding, Fundamentals)
    🔴 Live Calls 𝗘𝗩𝗘𝗥𝗬 week! (Support, Q&A, Networking, etc)
    ⏬ Weekly agent & AI system drops! (Community Exclusive)
    💰 Making money with AI (Challenges & Content)
    👥 Network of 1,200+ AI enthusiasts ready to help!
    This community will ensure you get to the next level in your life and your business! 🔥
    Maybe the 'next level' is saving 10+ hours per week, making money with AI or even just learning something new!
    More than that, we are a 𝒄𝒐𝒎𝒎𝒖𝒏𝒊𝒕𝒚. Not a course portal.
    This community thrives on real connections and shared knowledge.
    So, if you’re ready → Act fast and 𝒍𝒐𝒄𝒌 𝒊𝒏 this price discount forever.
    👉🏼 Market valued price:
    $179/month
    🔥𝑳𝑰𝑴𝑰𝑻𝑬𝑫 𝑶𝑭𝑭𝑬𝑹:
    $79/month
    Still unsure? Schedule a call with a member on the inside ($5):
    https://swiy.co/call-aif-member
*/
.top-links {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.top-links a {
    color: #5f6368;
    text-decoration: none;
    margin-right: 20px;
}

.top-links a:hover {
    text-decoration: underline;
}

body.dark-mode .top-links a {
    color: #969ba1;
}

body {
    font-family: Arial, sans-serif;
    background-color: #fff;
    color: #202124;
    margin: 0;
    padding: 20px;
    padding-top: 60px;
}

.container {
    max-width: 98%;
    margin: 0 auto;
}

.header {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

@keyframes fadeInSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.logo {
    display: flex;
    align-items: center;
    position: relative;
}

.spinning-8 {
    display: inline-block;
    animation: spin 1s linear infinite;
}

.magnifying-glass {
    width: 50px;
    height: 50px;
    background-image: url('favicon.svg');
    background-size: contain;
    background-repeat: no-repeat;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    animation: move-magnifier 1.5s ease-in-out forwards;
}

.find-text, .n-text {
    opacity: 0;
    animation: fade-in 1s ease-in forwards;
    animation-delay: 1.5s;
}

.tagline-word {
    display: inline-block;
    opacity: 0;
    transform: translateY(20px);
    animation: slide-up 0.5s ease-out forwards;
}

.tagline-word:nth-child(1) {
    animation-delay: 1.7s;
}

.tagline-word:nth-child(2) {
    animation-delay: 1.9s;
}

.tagline-word:nth-child(3) {
    animation-delay: 2.1s;
}

@keyframes slide-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

@keyframes move-magnifier {
    0% { left: -20%; }
    40% { left: 50%; }
    60% { left: 50%; }
    100% { left: 120%; }
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.logo-svg {
    width: 60px;
    height: 60px;
    margin-right: 15px;
}

.logo-text-container {
    display: flex;
    flex-direction: column;
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-size: 60px;
    font-weight: bold;
    color: #333333;
}

.tagline {
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    color: #5f6368;
}

body.dark-mode .logo-text {
    color: #e8eaed;
}

body.dark-mode .tagline {
    color: #969ba1;
}

.community-button:hover {
    background-color: #3367D6;
}

.search-container {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    position: relative;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#searchInput {
    width: 100%;
    padding: 10px 20px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    font-size: 16px;
    box-shadow: 0 1px 6px rgba(32, 33, 36, 0.28);
    box-sizing: border-box;
}

#searchInput:focus {
    outline: none;
}

.search-input-wrapper::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border-radius: 26px;
    background: linear-gradient(-45deg, #FFA63D, #FF3D77, #338AFF, #3CF0C5);
    background-size: 600%;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
}

.search-input-wrapper.focused::before {
    opacity: 1;
    animation: anime 16s linear infinite;
}

@keyframes anime {
   0% {
     background-position: 0% 50%
   }
   50% {
     background-position: 100% 50%
   }
   100% {
     background-position: 0% 50%
   }
}

#searchButton {
    display: none; /* Hide the original search button */
}

#sortOptions, #languageFilter {
    margin-left: 10px;
    padding: 10px;
    border: 1px solid #dfe1e5;
    border-radius: 24px;
    font-size: 16px;
    background-color: #f8f9fa;
    color: #3c4043;
}

.result-item {
    margin-bottom: 24px;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.3s;
}

.result-item:hover {
    background-color: #f8f9fa;
}

.result-item h3 {
    margin-top: 0;
    margin-bottom: 2px;
}

.result-item h3 a {
    color: #1a0dab;
    font-size: 13px;
    text-decoration: none;
}

.result-item p {
    line-height: 1.6;
    margin-bottom: 10px;
}

.repo-name {
    font-family: 'Roboto', sans-serif;
    color: #4a4a4a;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.1);
    font-size: 20px;
}

body.dark-mode .repo-name {
    color: #8ab4f8;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

.result-item h3 a:hover {
    text-decoration: underline;
}

.repo-details {
    color: #5f6368;
    font-size: 14px;
    margin-bottom: 4px;
}

.repo-details span {
    margin-right: 10px;
}

.clone-container {
    font-size: 14px;
}

.button-container {
    margin: 0;
    padding: 0;
    margin-top: 5px;
}

.clone-command {
    color: #006621;
}

.clone-command a {
    color: #006621;
}

.copy-button, .download-button, .pin-button {
    border-radius: 20px;
    color: white;
    font-family: arial, sans-serif;
    font-size: 14px;
    margin: 0 4px;
    padding: 0 16px;
    line-height: 25px;
    height: 23px;
    min-width: 54px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    text-decoration: none;
    border: none;
    opacity: 0.78;
}

.copy-button {
    background-color: #388E3C;
}

.download-button {
    background-color: #1976D2;
}


.pin-button {
    background-color: #5E35B1;
}

#paginationContainer {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
}

#paginationContainer button {
    background-color: #f8f9fa;
    border: 1px solid #f8f9fa;
    border-radius: 4px;
    color: #3c4043;
    font-family: arial,sans-serif;
    font-size: 14px;
    margin: 0 4px;
    padding: 0 16px;
    line-height: 27px;
    height: 36px;
    min-width: 54px;
    text-align: center;
    cursor: pointer;
    user-select: none;
}

#paginationContainer button:hover {
    border-color: #dadce0;
    box-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

#paginationContainer button:disabled {
    background-color: #f8f9fa;
    color: #bdc1c6;
    cursor: not-allowed;
    border: 1px solid #f8f9fa;
    text-decoration: none;
}

#paginationContainer button.active {
    border: 1px solid #1a73e8;
    color: #1a73e8;
}

.loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4285F4;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}


.switchers-container {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    align-items: center;
}

.theme-switcher-container, .infinite-scroll-switcher-container {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

.theme-switcher-container span, .infinite-scroll-switcher-container span {
    margin-right: 10px;
}

.theme-switcher {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.theme-switcher input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked + .slider {
    background-color: #2196F3;
}

input:checked + .slider:before {
    transform: translateX(26px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Dark Mode Styles */
body.dark-mode {
    background-color: #202124;
    color: #e8eaed;
}

body.dark-mode .container {
    background-color: #202124;
}

body.dark-mode h1 {
    color: #e8eaed;
}

body.dark-mode .search-input-wrapper {
    background-color: #303134;
    border-radius: 24px;
}

body.dark-mode #searchInput {
    background-color: #303134;
    border-color: #5f6368;
    color: #e8eaed;
    position: relative;
    z-index: 1;
}

body.dark-mode .search-input-wrapper::before {
    z-index: 0;
}

body.dark-mode #sortOptions, body.dark-mode #languageFilter {
    background-color: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark-mode .result-item {
    border-color: #5f6368;
}

body.dark-mode .result-item:hover {
    background-color: #303134;
}

body.dark-mode .result-item h3 a {
    color: #8ab4f8;
}

body.dark-mode .repo-details {
    color: #969ba1;
}

body.dark-mode .clone-command {
    color: #81c995;
}

body.dark-mode .clone-command a {
    color: #81c995;
}

body.dark-mode .copy-button {
    background-color: #388E3C;
}

body.dark-mode .download-button {
    background-color: #1976D2;
}


body.dark-mode .pin-button {
    background-color: #5E35B1;
}

body.dark-mode .copy-button, body.dark-mode .download-button, body.dark-mode .pin-button {
    border-color: #5f6368;
    color: #e8eaed;
    opacity: 1;
}

body.dark-mode .copy-button:hover, body.dark-mode .download-button:hover {
    border-color: #969ba1;
}

body.dark-mode #paginationContainer button {
    background-color: #303134;
    border-color: #5f6368;
    color: #e8eaed;
}

body.dark-mode #paginationContainer button:hover {
    border-color: #969ba1;
}

body.dark-mode #paginationContainer button:disabled {
    background-color: #303134;
    color: #5f6368;
}

body.dark-mode #paginationContainer span {
    color: #969ba1;
}

#historyContainer {
    margin-top: 40px;
}

#historyContainer h3 {
    font-size: 16px;
    color: #5f6368;
    font-weight: normal;
    margin-bottom: 10px;
}

#historyList {
    list-style: none;
    padding: 0;
}

#historyList li {
    padding: 5px 0;
}

#historyList li a {
    color: #1a0dab;
    text-decoration: none;
}

#historyList li a:hover {
    text-decoration: underline;
}

body.dark-mode #historyContainer h3 {
    color: #969ba1;
}

body.dark-mode #historyList li a {
    color: #8ab4f8;
}

#resultsCountContainer {
    color: #70757a;
    font-size: 14px;
    margin-bottom: 20px;
}

#pinnedContainer h3 {
    font-size: 16px;
    color: #5f6368;
    font-weight: normal;
    margin-bottom: 10px;
}

.pinned {
    background-color: #f8f9fa;
    border: 1px solid #dadce0;
}

body.dark-mode #pinnedContainer h3 {
    color: #969ba1;
}

body.dark-mode .pinned {
    background-color: #303134;
    border: 1px solid #5f6368;
}

body.dark-mode #resultsCountContainer {
    color: #969ba1;
}

body.initial-view {
    padding: 0;
}

body.initial-view .container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    max-width: 100%;
}

body.initial-view .top-links,
body.initial-view .switchers-container,
body.initial-view #resultsCountContainer,
body.initial-view #pinnedContainer,
body.initial-view #paginationContainer,
body.initial-view #loader,
body.initial-view #sortOptions,
body.initial-view #languageFilter {
    display: none;
}

body.initial-view .header {
    margin-bottom: 20px;
}

body.initial-view .search-container {
    width: 600px;
    max-width: 90%;
}

.search-results-view .header {
    justify-content: flex-start;
}

.search-results-view .logo-text {
    font-size: 34px;
    text-align: left;
}

@media (max-width: 750px) {
    .top-links {
        position: static;
        text-align: center;
        margin-bottom: 15px;
    }

    .switchers-container {
        position: static;
        justify-content: center;
        margin-top: 15px;
        margin-bottom: 15px;
    }

    .header {
        margin-top: 20px;
        justify-content: center;
    }

    .search-results-view .header {
        justify-content: center;
    }
}

@media (max-width: 600px) {
    body {
        padding: 10px;
    }

    h1 {
        font-size: 60px;
    }

    .search-container {
        flex-direction: column;
        align-items: stretch;
    }

    #searchInput {
        width: 100%;
    }

    #sortOptions, #languageFilter {
        margin-left: 0;
        margin-top: 10px;
    }
}


@media (max-width: 750px) {
    .result-item {
        padding: 15px;
    }

    .result-item p {
        line-height: 1.6;
    }

    .repo-details {
        display: flex;
        flex-wrap: wrap;
    }

    .repo-details span {
        margin-bottom: 10px;
    }

    .clone-container {
        display: flex;
        flex-wrap: wrap;
    }

    .copy-button, .download-button, .pin-button {
        margin-bottom: 10px;
    }
}

.advertisement-item {
    background-color: #e6f7ff;
    border: 1px solid #91d5ff;
    cursor: pointer;
}

.advertisement-link {
    text-decoration: none;
    color: inherit;
}

body.dark-mode .advertisement-item {
    background-color: #1a2c3a;
    border: 1px solid #1890ff;
}

.matched-query {
    font-size: 12px;
    color: #5f6368;
    margin-bottom: 5px;
}

body.dark-mode .matched-query {
    color: #969ba1;
}
