/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #667eea;
    --secondary: #764ba2;
    --background: #ffffff;
    --background-alt: #f9fafb;
    --text: #1f2937;
    --text-subtle: #9ca3af;
    --success: #10b981;
    --warning: #f59e0b;
    --border: #e5e7eb;

    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-light: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);

    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background-color: var(--background);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
    align-items: center;
}

.nav-links a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    transition: color 0.2s;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-links a:not(.btn-demo):hover {
    color: var(--primary);
}

.btn-demo {
    padding: 8px 20px;
    background: var(--gradient);
    color: white !important;
    border-radius: 8px;
    -webkit-text-fill-color: white !important;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

.btn-demo:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-demo::after {
    display: none;
}

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text);
    transition: all 0.3s;
}

/* Hero Section */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 80px;
    overflow: hidden;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-light);
    opacity: 0.5;
    z-index: -1;
}

.hero-background::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, var(--primary) 0%, transparent 70%);
    opacity: 0.1;
    animation: pulse 20s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.1; }
    50% { transform: scale(1.1); opacity: 0.15; }
}

.hero-content {
    text-align: center;
    max-width: 800px;
    z-index: 1;
}

.hero-title {
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.1;
}

.gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 20px;
    color: var(--text-subtle);
    margin-bottom: 40px;
    line-height: 1.6;
}

.hero-subtitle .link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s;
}

.hero-subtitle .link:hover {
    opacity: 0.8;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 48px;
}

.hero-video {
    margin-top: 48px;
    width: 100%;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-xl);
    background: #000;
}

.hero-video iframe {
    width: 100%;
    height: 450px;
    display: block;
    border: none;
}

.btn {
    padding: 14px 32px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 16px;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    animation: bounce 2s infinite;
}

.scroll-arrow {
    width: 24px;
    height: 24px;
    border-right: 3px solid var(--primary);
    border-bottom: 3px solid var(--primary);
    transform: rotate(45deg);
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateX(-50%) translateY(0); }
    40% { transform: translateX(-50%) translateY(-10px); }
    60% { transform: translateX(-50%) translateY(-5px); }
}

/* Sections */
.section {
    padding: 100px 0;
    background-color: var(--background);
}

.section-alt {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.02) 0%, rgba(118, 75, 162, 0.02) 100%);
    background-color: var(--background-alt);
}

.section-header {
    text-align: center;
    margin-bottom: 64px;
}

.section-title {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
    color: var(--text);
}

.section-description {
    font-size: 18px;
    color: var(--text-subtle);
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
    margin-top: 48px;
}

/* Key Features Section - 3 cards per row */
#features .features-grid {
    grid-template-columns: repeat(3, 1fr);
}

.feature-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-xl);
}

.feature-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.feature-card p {
    color: var(--text-subtle);
    font-size: 14px;
}

/* Feature Categories */
.feature-category {
    margin-bottom: 64px;
}

.category-title {
    font-size: 28px;
    font-weight: 600;
    margin-bottom: 32px;
    color: var(--text);
}

.feature-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.feature-item {
    display: flex;
    gap: 16px;
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.feature-item:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
}

.feature-badge {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}

.feature-badge.security {
    background: rgba(239, 68, 68, 0.1);
}

.feature-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.feature-content p {
    font-size: 14px;
    color: var(--text-subtle);
}

/* Architecture */
.architecture-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

/* Technical Components - 3 cards per row */
#technical .architecture-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* Technical Stack Table */
#technical table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

#technical table thead tr {
    background: var(--background-alt);
}

#technical table th {
    padding: 12px;
    text-align: left;
    border-bottom: 2px solid var(--border);
    font-weight: 600;
    color: var(--text);
    font-size: 14px;
}

#technical table td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-size: 14px;
}

#technical table tbody tr:hover {
    background: var(--background-alt);
}

#technical table tbody tr:last-child td {
    border-bottom: none;
}

.arch-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.arch-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
}

.arch-list {
    list-style: none;
}

.arch-list li {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.arch-list li:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.arch-list code {
    display: block;
    background: var(--background-alt);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: var(--primary);
    margin: 8px 0;
    font-family: 'Courier New', monospace;
}

.arch-list span {
    display: block;
    color: var(--text-subtle);
    font-size: 14px;
    margin-top: 4px;
}

/* Code Block */
.code-block-wrapper {
    margin: 32px 0;
}

.code-block {
    background: #1f2937;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.code-title {
    color: var(--text-subtle);
    font-size: 14px;
    font-weight: 500;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--text-subtle);
    cursor: pointer;
    font-size: 16px;
    transition: color 0.2s;
}

.copy-btn:hover {
    color: white;
}

.code-block pre {
    margin: 0;
    padding: 20px;
    overflow-x: auto;
}

.code-block code {
    color: #10b981;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    line-height: 1.6;
}

/* Dependencies */
.dependencies {
    margin-top: 48px;
}

.dependencies h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
}

.dep-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.dep-item {
    background: white;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.dep-name {
    font-weight: 600;
    color: var(--text);
}

.dep-desc {
    font-size: 14px;
    color: var(--text-subtle);
}

/* API Grid */
.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

.api-card {
    background: white;
    padding: 24px;
    border-radius: 12px;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
}

.api-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.api-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 12px;
}

.api-badge.ws {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
}

.api-badge.rest {
    background: rgba(102, 126, 234, 0.1);
    color: var(--primary);
}

.api-badge.admin {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
}

.api-card h3 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text);
}

.api-endpoint {
    display: block;
    background: var(--background-alt);
    padding: 12px;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: var(--primary);
    margin-bottom: 12px;
    word-break: break-all;
}

.api-card p {
    font-size: 14px;
    color: var(--text-subtle);
}

/* Configuration */
.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 32px;
}

.config-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.config-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text);
}

.config-subtitle {
    color: var(--text-subtle);
    font-size: 14px;
    margin-bottom: 24px;
}

.env-list, .const-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.env-item, .const-item {
    padding: 16px;
    background: var(--background-alt);
    border-radius: 8px;
    border: 1px solid var(--border);
}

.env-key, .const-item code {
    display: block;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--primary);
    margin-bottom: 8px;
    font-weight: 600;
}

.env-required, .env-optional {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    margin-bottom: 8px;
}

.env-required {
    background: rgba(239, 68, 68, 0.1);
    color: #dc2626;
}

.env-optional {
    background: rgba(156, 163, 175, 0.1);
    color: var(--text-subtle);
}

.env-item p {
    font-size: 14px;
    color: var(--text-subtle);
    margin: 0;
}

.const-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.const-item span {
    color: var(--text-subtle);
    font-size: 14px;
    text-align: right;
}

/* Flow Diagram */
.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 12px;
    margin-top: 48px;
    overflow-x: auto;
    padding: 8px 0;
}

/* Vertical Flow Diagram */
.flow-diagram-vertical {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    margin-top: 48px;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.flow-arrow-down {
    font-size: 24px;
    color: var(--primary);
    font-weight: bold;
    margin: -4px 0;
}

.flow-branch {
    display: flex;
    justify-content: center;
    gap: 32px;
    width: 100%;
    margin: 16px 0;
}

.flow-branch-path {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    gap: 12px;
}

.flow-branch-label {
    font-weight: 600;
    color: var(--primary);
    font-size: 14px;
    margin-bottom: 4px;
}

.flow-step-small {
    padding: 16px 12px;
    min-width: 240px;
    height: auto;
    min-height: 100px;
}

.flow-step-decision {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.flow-step-agent {
    border-color: var(--primary);
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

.flow-step {
    background: white;
    padding: 20px 16px;
    border-radius: 12px;
    border: 2px solid var(--border);
    min-width: 140px;
    flex: 1;
    max-width: 180px;
    height: 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
}

/* Wider steps for vertical flow */
.flow-diagram-vertical .flow-step {
    width: 100%;
    max-width: 100%;
    min-width: 100%;
    padding: 24px 20px;
}

.flow-step:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-md);
    transform: translateY(-4px);
}

.flow-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin: 0 auto 8px;
    flex-shrink: 0;
}

.flow-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.flow-content h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: var(--text);
}

.flow-content p {
    font-size: 13px;
    color: var(--text-subtle);
    margin: 0;
    line-height: 1.4;
}

.flow-arrow {
    font-size: 24px;
    color: var(--primary);
    font-weight: bold;
}

/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.info-card {
    background: white;
    padding: 32px;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
}

.info-card h3 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 24px;
    color: var(--text);
}

.info-card ul {
    list-style: none;
}

.info-card li {
    margin-bottom: 16px;
    padding-left: 24px;
    position: relative;
    color: var(--text-subtle);
    font-size: 14px;
    line-height: 1.6;
}

.info-card li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.info-card strong {
    color: var(--text);
    font-weight: 600;
}

/* Footer */
.footer {
    background: var(--text);
    color: white;
    padding: 48px 0;
    text-align: center;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-left {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.footer a {
    color: var(--primary);
    text-decoration: none;
}

.footer a:hover {
    text-decoration: underline;
}

.footer-note {
    color: var(--text-subtle);
    font-size: 14px;
}

.footer-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.footer-links a {
    color: white;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--primary);
}

.footer-links span {
    color: var(--text-subtle);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero-video iframe {
        height: 400px;
    }
}

/* Fix for shorter screens (tablets in landscape, small laptops) */
@media (max-height: 900px) and (min-width: 768px) {
    .hero-video iframe {
        height: 350px;
    }

    .hero-video {
        margin-bottom: 50px;
    }

    .scroll-indicator {
        bottom: 20px;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: white;
        flex-direction: column;
        padding: 24px;
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border);
        gap: 16px;
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        padding: 12px;
        border-radius: 8px;
        transition: background 0.2s;
    }

    .nav-links a:not(.btn-demo):hover {
        background: var(--background-alt);
    }

    .nav-links a.btn-demo {
        background: var(--gradient) !important;
        color: white !important;
        -webkit-text-fill-color: white !important;
    }

    .nav-links li:nth-child(4) {
        margin-top: 12px;
    }

    .nav-links a.btn-demo:hover,
    .nav-links a.btn-demo:active,
    .nav-links a.btn-demo:focus {
        background: var(--gradient) !important;
        color: white !important;
        -webkit-text-fill-color: white !important;
        transform: translateY(-2px);
        box-shadow: var(--shadow-lg);
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .hero-actions {
        flex-direction: column;
    }

    .hero-video iframe {
        height: 300px;
    }

    .hero-video {
        margin-bottom: 60px;
    }

    .scroll-indicator {
        bottom: 20px;
    }

    .btn {
        width: 100%;
        text-align: center;
    }

    .features-grid,
    .feature-list,
    .architecture-grid,
    .api-grid,
    .config-grid,
    .info-grid {
        grid-template-columns: 1fr;
    }

    #features .features-grid {
        grid-template-columns: 1fr;
    }

    #technical .architecture-grid {
        grid-template-columns: 1fr;
    }

    .flow-diagram {
        flex-direction: column;
    }

    .flow-step {
        height: auto;
        min-height: 140px;
    }

    .flow-arrow {
        transform: rotate(90deg);
    }

    .flow-diagram-vertical {
        max-width: 100%;
    }

    .flow-branch {
        flex-direction: column;
        gap: 16px;
    }

    .flow-branch-path {
        width: 100%;
    }

    .section {
        padding: 60px 0;
    }

    .dep-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
    }

    .hero-title {
        font-size: 36px;
    }

    .hero-subtitle {
        font-size: 16px;
    }

    .hero-video {
        margin-top: 32px;
        margin-bottom: 60px;
    }

    .hero-video iframe {
        height: 250px;
    }

    .scroll-indicator {
        bottom: 20px;
    }

    .section-title {
        font-size: 28px;
    }
}
