*, *::before, *::after {
    box-sizing: border-box;
}

:root {
    --accent-blue: #0088ff;
    --white: #ffffff;
    --gray-bg: rgba(244, 244, 244, 0.65);
    --header-bg: #eaeaea;
    --text-black: #000000;
}

body {
    margin: 0;
    font-family: 'SF Pro Display', sans-serif;
    background-color: var(--white);
    color: var(--text-black);
}

.main-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 80px;
    background-color: var(--header-bg);
    padding: 0 40px;
}

.logo {
    font-size: 35px;
    font-weight: 700;
    margin: 0;
}

.search-bar {
    position: relative;
    display: flex;
    align-items: center;
    background: #f9f9f9;
    border: 2.5px solid black;
    border-radius: 20px;
    padding: 10px 20px;
    width: 500px;
}

.search-bar.disabled {
    background: #e0e0e0;
    opacity: 0.5;
    pointer-events: none;
}

.search-icon {
    width: 30px;
    margin-right: 15px;
}

.search-bar input {
    background: transparent;
    border: none;
    font-size: 20px;
    width: 100%;
    outline: none;
}

.header-btn {
    text-decoration: none;
    color: black;
    border: 2px solid black;
    padding: 10px 25px;
    border-radius: 12px;
    margin-left: 20px;
    font-weight: 500;
}

.hero {
    text-align: center;
    padding: 80px 20px;
}

.hero h1 {
    font-size: 96px;
    margin: 0;
    font-weight: 700;
}

.hero p {
    font-size: 48px;
    font-weight: 300;
    margin-top: 10px;
}

.categories-container {
    padding: 0 30px;
    max-width: 1600px;
    margin: 0 auto;
}

.category-pane {
    margin-bottom: 60px;
}

.category-header {
    background-color: var(--cat-color);
    padding: 10px 30px;
    border-radius: 30px 30px 0 0;
    display: block;
    width: fit-content;
}

.category-header h2 {
    color: white;
    font-family: 'JetBrains Mono', monospace;
    font-size: 32px;
    margin: 0;
    line-height: 1;
}

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

.category-content {
    background-color: var(--cat-color);
    padding: 10px;
    border-radius: 0 50px 50px 50px;
    margin-top: -1px; /* Ensure overlap to prevent tiny gaps */
}

.apps-grid-container {
    overflow: hidden;
}

.apps-grid {
    display: grid;
    gap: 20px;
}

.app-card-wrapper {
    display: flex;
}

.app-card-wrapper.hidden-app {
    display: none;
}

.app-card {
    background-color: var(--gray-bg);
    width: 270px;
    padding: 20px;
    border-radius: 30px;
    position: relative;
    text-align: center;
    display: flex;
    flex-direction: column;
    height: 100%;
}



.info-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    cursor: pointer;
}

.info-icon img {
    width: 30px;
}

.app-icon-container {
    width: 110px;
    height: 110px;
    margin: 0 auto 20px;
    background-color: black;
    border-radius: 23px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 5%;
    box-sizing: border-box;
}

.app-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 1000;
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid black;
    text-decoration: none;
}

.close-btn img {
    width: 35px;
    height: 35px;
}

/* Carousel Styles */
.carousel {
    position: relative;
    width: 100%;
    height: 100%;
}

.carousel-inner {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 23px;
    background: #eee;
}

.carousel-item {
    display: none;
    width: 100%;
    height: 100%;
    object-fit: scale-down;
}

.carousel-item.active {
    display: block;
}

.carousel-prev, .carousel-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: white;
    border: none;
    padding: 20px;
    cursor: pointer;
    font-size: 24px;
    border-radius: 50%;
}

.carousel-prev { left: 10px; }
.carousel-next { right: 10px; }

.app-details h3 {
    font-size: 30px;
    margin: 10px 0;
    font-weight: 400;
}

.tagline {
    font-size: 20px;
    color: black;
    margin: 5px 0;
}

.replaces {
    font-size: 18px;
    font-style: italic;
    color: black;
    margin-bottom: 20px;
}

.add-button {
    margin-top: auto;
    padding-top: 20px;
    background: #efeef6;
    border: 5px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 10px 30px;
    border-radius: 20px;
    font-size: 28px;
    font-family: 'SF Pro Display', sans-serif;
    cursor: pointer;
    transition: 0.2s;
}

.add-button.added {
    margin-top: auto;
    padding-top: 20px;
    background: black;
    border-color: black;
    color: white;
    opacity: 0.3;
}

.show-more-container {
    text-align: center;
    margin-top: 30px;
}

.show-more-btn {
    background: whitesmoke;
    border: 5px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 10px 40px;
    border-radius: 20px;
    font-size: 28px;
    opacity: 0.6;
    cursor: pointer;
}

/* Next Button */
.next-button-container {
    position: fixed;
    bottom: 40px;
    right: 40px;
    z-index: 100;
}

.next-btn {
    background: #efeef6;
    border: 5px solid var(--accent-blue);
    color: var(--accent-blue);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
    padding: 15px 30px;
    border-radius: 20px;
    gap: 15px;
}

.next-arrow {
    width: 40px;
    height: 40px;
}

.hidden {
    display: none;
}

/* App Info Page/Modal Overlay Look */
.app-info-page {
    position: relative;
    padding: 40px;
}

body:has(.app-info-page) .next-button-container {
    display: none !important;
}

.app-info-modal {
    background: white;
    border: 5px solid black;
    border-radius: 23px;
    padding: 40px;
    display: flex;
    gap: 40px;
    align-items: stretch;
}

.app-info-left {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.app-info-right {
    width: 400px;
}

.screenshot-container {
    width: 100%;
    display: flex;
    min-height: 0;
    aspect-ratio: 16 / 9;
}

.screenshot-main {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    border-radius: 23px;
}

.app-info-header {
    display: flex;
    align-items: center;
    gap: 30px;
    margin-bottom: 40px;
}

.app-info-header h1 {
    font-size: 96px;
    margin: 0;
}

.app-info-modal .app-icon-container {
    width: 120px;
    height: 120px;
}

.app-info-desc {
    font-size: 36px;
    line-height: 1.4;
    margin-bottom: 20px;
}

.app-markdown-content {
    font-size: 20px;
    line-height: 1.6;
    margin-bottom: 20px;
}

.app-stats {
    background: #d9d9d9;
    padding: 20px 30px;
    border-radius: 23px;
    margin-top: 20px;
}

.app-stats p {
    font-size: 20px;
    margin: 5px 0;
}

.stats-btns {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.stats-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #efeef6;
    border: 3px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 10px 20px;
    border-radius: 15px;
    font-size: 24px;
    text-decoration: none;
    font-weight: 500;
}

.stats-btn svg {
    width: 24px;
    height: 24px;
}

/* Install Screen Redesign */
.install-container {
    background: #d9d9d9;
    border-radius: 20px;
    padding: 20px;
    display: flex;
    height: 1041px;
    width: 1865px;
    margin: 20px auto;
}

.steps-grid {
    display: flex;
    width: 100%;
    justify-content: space-between;
}

.step-card {
    flex: 1;
    text-align: center;
    padding: 40px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.divider {
    width: 20px;
    background-color: #aaa;
    height: 100%;
    border-radius: 23px;
}

.step-circle {
    width: 420px;
    height: 420px;
    margin-bottom: 40px;
    border-radius: 50%;
}

.step-card h3 {
    font-size: 64px;
    margin: 20px 0;
}

.step-card p {
    font-size: 45px;
    line-height: 1.2;
    margin-bottom: auto;
}

.step-actions {
    margin-top: 40px;
}

.action-btn {
    background: #efeef6;
    border: 5px solid var(--accent-blue);
    color: var(--accent-blue);
    padding: 15px 40px;
    border-radius: 20px;
    font-size: 40px;
    opacity: 0.3;
    cursor: pointer;
    white-space: nowrap;
}

/* Responsive Styles */
@media (max-width: 1200px) {
    .main-header {
        padding: 0 20px;
    }
    .search-bar {
        width: 300px;
    }
    .logo {
        font-size: 28px;
    }
    .app-info-modal {
        flex-direction: column;
    }
    .app-info-right {
        width: 100%;
    }
    .install-container {
        width: 95%;
        height: auto;
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .main-header {
        height: auto;
        padding: 10px 20px;
        flex-direction: column;
        gap: 15px;
    }
    .header-right {
        margin-top: 10px;
    }
    .search-bar {
        width: 100%;
    }
    .hero h1 {
        font-size: 48px;
    }
    .hero p {
        font-size: 24px;
    }
}
