/* ===== KREO ECOSYSTEM - Industry Grade CSS ===== */

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --bg-glass: rgba(255, 255, 255, 0.04);
    --bg-glass-hover: rgba(255, 255, 255, 0.08);
    --border-color: rgba(255, 255, 255, 0.1);
    --text-primary: #ffffff;
    --text-secondary: #888888;
    --accent: #ffffff;
    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 28px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== LOADER ===== */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-primary);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-content {
    text-align: center;
}

.loader-title {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.loader-title span {
    font-size: clamp(3rem, 10vw, 5rem);
    font-weight: 100;
    letter-spacing: -4px;
    opacity: 0;
    transform: translateY(30px);
    animation: letterReveal 0.8s ease forwards;
}

.loader-title span:nth-child(1) {
    animation-delay: 0.1s;
}

.loader-title span:nth-child(2) {
    animation-delay: 0.2s;
}

.loader-title span:nth-child(3) {
    animation-delay: 0.3s;
}

.loader-title span:nth-child(4) {
    animation-delay: 0.4s;
}

.loader-subtitle {
    margin-top: 16px;
    font-size: 0.9rem;
    letter-spacing: 6px;
    color: var(--text-secondary);
    opacity: 0;
    animation: fadeIn 0.8s ease forwards 0.8s;
}

@keyframes letterReveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

/* ===== NAVIGATION ===== */
.nav-bar {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    padding: 16px 24px;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.nav-brand {
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 3px;
}

.nav-search {
    flex: 1;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 100px;
    padding: 12px 20px;
    transition: var(--transition);
}

.nav-search:focus-within {
    border-color: var(--text-secondary);
    background: var(--bg-glass-hover);
}

.nav-search i {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.nav-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 1.3rem;
    transition: color 0.2s;
}

.nav-link:hover {
    color: var(--text-primary);
}

/* ===== MAIN CONTENT ===== */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

/* ===== HERO ===== */
.hero {
    text-align: center;
    padding: 60px 0 80px;
}

.hero h1 {
    font-size: clamp(3rem, 12vw, 7rem);
    font-weight: 100;
    letter-spacing: -3px;
    line-height: 1;
    background: linear-gradient(180deg, #fff 0%, #666 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: fadeUp 1s ease;
}

.hero p {
    margin-top: 20px;
    color: var(--text-secondary);
    font-size: 1rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: fadeUp 1s ease 0.2s backwards;
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== FEATURED SECTION ===== */
.featured-section {
    margin-bottom: 60px;
}

.featured-card {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    min-height: 400px;
    display: flex;
    align-items: flex-end;
    cursor: pointer;
    transition: var(--transition);
}

.featured-card:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.5);
}

.featured-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    transition: transform 0.6s ease, opacity 0.3s;
}

.featured-card:hover .featured-bg {
    transform: scale(1.05);
    opacity: 0.4;
}

.featured-content {
    position: relative;
    z-index: 2;
    padding: 40px;
    width: 100%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 100%);
}

.featured-tag {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
}

.featured-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 300;
    margin-bottom: 16px;
    line-height: 1.1;
}

.featured-desc {
    color: #ccc;
    font-size: 1rem;
    line-height: 1.6;
    max-width: 600px;
    margin-bottom: 24px;
}

.featured-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
}

/* ===== APPS SECTION ===== */
.apps-section {
    margin-top: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-header h2 {
    font-weight: 400;
    font-size: 1.5rem;
}

.badge {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* ===== APP CARD ===== */
.app-card {
    position: relative;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 28px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.app-card:hover {
    transform: translateY(-4px);
    background: var(--bg-glass-hover);
    border-color: rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.4);
}

.app-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.app-icon {
    width: 56px;
    height: 56px;
    background: var(--bg-glass-hover);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.app-version {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.app-card h3 {
    font-size: 1.2rem;
    font-weight: 500;
}

.app-card-desc {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.app-card-arrow {
    width: 36px;
    height: 36px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: auto;
    align-self: flex-end;
    transition: var(--transition);
}

.app-card:hover .app-card-arrow {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
    transform: rotate(-45deg);
}

/* ===== MODAL ===== */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-container {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 36px;
    position: relative;
    transform: translateY(20px);
    transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
    transform: translateY(0);
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close-btn:hover {
    background: var(--bg-glass-hover);
    color: var(--text-primary);
}

/* Modal Content */
.modal-hero {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-icon {
    width: 72px;
    height: 72px;
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
}

.modal-info h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 8px;
}

.modal-dev {
    display: inline-block;
    background: var(--bg-glass);
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

.modal-stats {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 20px;
}

.modal-stat {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.modal-desc {
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 24px;
}

.modal-features {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.modal-feature {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-glass);
    padding: 12px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
}

.modal-feature i {
    color: var(--text-secondary);
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    background: var(--text-primary);
    color: var(--bg-primary);
    padding: 16px 28px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: scale(1.02);
    box-shadow: 0 10px 30px rgba(255, 255, 255, 0.1);
}

.btn-full {
    width: 100%;
}

.btn-secondary {
    background: var(--bg-glass);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 12px 20px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    text-decoration: none;
}

/* ===== GUIDE MODAL ===== */
.z-top {
    z-index: 1100;
}

.modal-small {
    max-width: 420px;
    text-align: center;
}

.guide-content {
    padding-top: 20px;
}

.guide-icon {
    font-size: 3rem;
    color: #ffcc00;
    margin-bottom: 20px;
}

.guide-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 10px 0 20px;
}

.guide-image {
    width: 100%;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-bottom: 20px;
    opacity: 0.9;
}

.guide-steps {
    background: var(--bg-glass);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 16px;
    text-align: left;
    margin-bottom: 20px;
}

.guide-steps p {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 8px 0;
}

.highlight {
    color: #ff6b6b;
    font-weight: 600;
}

/* ===== FOOTER ===== */
.footer {
    text-align: center;
    padding: 40px 24px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.dim {
    opacity: 0.6;
}

/* ===== RESPONSIVE ===== */

/* Tablet */
@media (max-width: 768px) {
    .nav-search {
        display: none;
    }

    .hero h1 {
        font-size: 15vw;
    }

    .featured-card {
        min-height: 350px;
    }

    .featured-content {
        padding: 30px;
    }

    .modal-features {
        grid-template-columns: 1fr;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .nav-bar {
        padding: 12px 16px;
    }

    .main-content {
        padding: 20px 16px 60px;
    }

    .hero {
        padding: 40px 0 60px;
    }

    .hero h1 {
        font-size: 18vw;
    }

    .apps-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .featured-content {
        padding: 24px;
    }

    .featured-title {
        font-size: 1.8rem;
    }

    /* Full Screen Modal on Mobile */
    .modal-container {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        border-radius: 0;
        border: none;
        padding: 24px;
        padding-top: 60px;
    }

    .modal-hero {
        flex-direction: column;
        text-align: center;
    }

    .modal-info h2 {
        font-size: 1.5rem;
    }

    .modal-stats {
        justify-content: center;
    }

    /* Guide Modal Stays Centered */
    .modal-small {
        height: auto;
        max-height: 90vh;
        border-radius: var(--radius-lg);
        border: 1px solid var(--border-color);
    }

    /* Loader Mobile */
    .loader-title span {
        font-size: 3rem;
        letter-spacing: -2px;
    }
}