/* ================================================================
   KN8X Portal — Public Landing Page Styles
   ================================================================ */

:root {
    --primary: #1a73e8;
    --primary-dark: #1557b0;
    --primary-light: #4285f4;
    --accent: #00c4b4;
    --accent-dark: #00a89a;
    --hero-bg: #0f172a;
    --hero-bg-alt: #1e293b;
    --surface: #ffffff;
    --surface-alt: #f8fafc;
    --surface-glass: rgba(255, 255, 255, 0.08);
    --text: #1e293b;
    --text-secondary: #64748b;
    --text-light: #94a3b8;
    --text-on-dark: #e2e8f0;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --max-width: 1280px;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: var(--text);
    background: var(--surface);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
}

/* ================================================================
   Navbar
   ================================================================ */

.portal-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: var(--transition);
}

.portal-nav .nav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 64px;
}

.portal-nav .brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 700;
    font-size: 1.25rem;
    color: #fff;
}

.portal-nav .brand-logo {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.8rem;
    color: #fff;
}

.portal-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    list-style: none;
}

.portal-nav .nav-links a {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-on-dark);
    transition: var(--transition);
}

.portal-nav .nav-links a:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.portal-nav .nav-cta {
    background: var(--primary) !important;
    color: #fff !important;
    padding: 0.5rem 1.25rem !important;
}

.portal-nav .nav-cta:hover {
    background: var(--primary-dark) !important;
}

/* ================================================================
   Hero Section
   ================================================================ */

.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--hero-bg) 0%, #162044 50%, var(--hero-bg-alt) 100%);
    overflow: hidden;
    padding: 6rem 2rem 4rem;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(ellipse at 30% 50%, rgba(26, 115, 232, 0.12) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 30%, rgba(0, 196, 180, 0.08) 0%, transparent 50%);
    animation: heroGlow 15s ease-in-out infinite alternate;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-2%, 2%) rotate(3deg); }
}

.hero-grid {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    background: rgba(26, 115, 232, 0.15);
    border: 1px solid rgba(26, 115, 232, 0.3);
    border-radius: 50px;
    color: var(--primary-light);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1.5rem;
}

.hero-badge .dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.hero h1 .gradient-text {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-on-dark);
    max-width: 600px;
    margin: 0 auto 2.5rem;
    line-height: 1.7;
    opacity: 0.85;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(26, 115, 232, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 115, 232, 0.5);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.hero-stat {
    text-align: center;
}

.hero-stat .stat-value {
    font-size: 2rem;
    font-weight: 800;
    color: #fff;
}

.hero-stat .stat-label {
    font-size: 0.8rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-top: 0.25rem;
}

/* ================================================================
   Sections common
   ================================================================ */

.section {
    padding: 5rem 2rem;
}

.section-alt {
    background: var(--surface-alt);
}

.section-dark {
    background: var(--hero-bg);
    color: #fff;
}

.section-inner {
    max-width: var(--max-width);
    margin: 0 auto;
}

.section-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.section-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.section-dark .section-label {
    color: var(--accent);
}

.section-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.75rem;
}

.section-header p {
    font-size: 1.05rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.section-dark .section-header p {
    color: var(--text-on-dark);
    opacity: 0.7;
}

/* ================================================================
   Services Grid
   ================================================================ */

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    opacity: 0;
    transition: var(--transition);
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: transparent;
}

.service-card:hover::before {
    opacity: 1;
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.1), rgba(0, 196, 180, 0.1));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
}

.service-card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.service-card p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

.service-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    margin-top: 1rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.service-status .dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
}

.service-status.active { color: #16a34a; }
.service-status.active .dot { background: #16a34a; }
.service-status.planned { color: var(--text-light); }
.service-status.planned .dot { background: var(--text-light); }

/* ================================================================
   Applications Grid
   ================================================================ */

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.app-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    padding: 2rem;
    transition: var(--transition);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.app-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.app-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.app-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    color: #fff;
}

.app-card-header .app-meta h3 {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
}

.app-card-header .app-meta .app-domain {
    font-size: 0.75rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-card p {
    font-size: 0.875rem;
    color: var(--text-on-dark);
    opacity: 0.7;
    line-height: 1.6;
    flex: 1;
}

.app-card .app-tagline {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 500;
    margin-top: 0.75rem;
    opacity: 1;
}

.app-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.app-version {
    font-size: 0.75rem;
    color: var(--text-light);
}

.app-arrow {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: var(--transition);
    font-size: 0.85rem;
}

.app-card:hover .app-arrow {
    background: var(--primary);
    color: #fff;
}

.app-featured {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    background: rgba(0, 196, 180, 0.15);
    color: var(--accent);
    border: 1px solid rgba(0, 196, 180, 0.3);
}

.app-card {
    position: relative;
}

/* ================================================================
   Departments
   ================================================================ */

.departments-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.dept-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition);
}

.dept-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.dept-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.dept-code {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.02em;
}

.dept-card h3 {
    font-size: 1rem;
    font-weight: 700;
    flex: 1;
}

.dept-head {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.dept-services {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.dept-services .tag {
    font-size: 0.7rem;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    background: var(--surface-alt);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

/* ================================================================
   News
   ================================================================ */

.news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 1.5rem;
}

.news-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    transition: var(--transition);
    position: relative;
}

.news-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.news-card.pinned::after {
    content: 'IMPORTANT';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    background: rgba(234, 67, 53, 0.1);
    color: #ea4335;
}

.news-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.news-date {
    font-size: 0.75rem;
    color: var(--text-light);
}

.news-category {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    border-radius: 50px;
    background: rgba(26, 115, 232, 0.08);
    color: var(--primary);
}

.news-card h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.news-card p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ================================================================
   Footer
   ================================================================ */

.portal-footer {
    background: var(--hero-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 3rem 2rem;
    color: var(--text-on-dark);
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.footer-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.footer-brand .brand-logo {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.7rem;
    color: #fff;
}

.footer-brand span {
    font-weight: 700;
    font-size: 1rem;
}

.footer-info {
    font-size: 0.8rem;
    color: var(--text-light);
    text-align: center;
}

.footer-links {
    display: flex;
    gap: 1.5rem;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-light);
    transition: var(--transition);
}

.footer-links a:hover {
    color: #fff;
}

/* ================================================================
   Loading & Empty States
   ================================================================ */

.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(26, 115, 232, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

/* ================================================================
   Animations
   ================================================================ */

.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ================================================================
   Responsive
   ================================================================ */

@media (max-width: 768px) {
    .portal-nav .nav-links {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: 8rem 1.5rem 4rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-stats {
        gap: 1.5rem;
        flex-wrap: wrap;
    }

    .hero-stat .stat-value {
        font-size: 1.5rem;
    }

    .section {
        padding: 3.5rem 1.5rem;
    }

    .services-grid,
    .apps-grid,
    .departments-grid,
    .news-grid {
        grid-template-columns: 1fr;
    }

    .footer-inner {
        flex-direction: column;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        align-items: center;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* ================================================================
   Catalog / E-commerce Section
   ================================================================ */

.catalog-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
}

.catalog-filter {
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,0.2);
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
}

.catalog-filter:hover {
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}

.catalog-filter.active {
    background: #4285f4;
    border-color: #4285f4;
    color: #fff;
}

.catalog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.catalog-card {
    background: rgba(255,255,255,0.05);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.catalog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    border-color: rgba(66,133,244,0.4);
}

.catalog-card-img {
    height: 160px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
}

.catalog-card-body {
    padding: 16px;
}

.catalog-card-type {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.catalog-card-title {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
}

.catalog-card-desc {
    font-size: 13px;
    color: rgba(255,255,255,0.6);
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.catalog-card-brand {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 12px;
}

.catalog-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.08);
}

.catalog-card-price {
    font-size: 20px;
    font-weight: 700;
    color: #4285f4;
}

.catalog-card-status {
    font-size: 12px;
    color: #0f9d58;
    font-weight: 600;
    padding: 4px 12px;
    background: rgba(15,157,88,0.15);
    border-radius: 12px;
}
