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

:root {
    --primary: #635BFF;
    --primary-dark: #4F46E5;
    --primary-light: #818CF8;
    --secondary: #0A2540;
    --text-primary: #0A2540;
    --text-secondary: #6B7280;
    --bg-light: #F9FAFB;
    --bg-white: #FFFFFF;
    --border: #E5E7EB;
    --success: #10B981;
    --error: #EF4444;
    --radius: 12px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica', 'Arial', sans-serif;
    color: var(--text-primary);
    background: var(--bg-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

/* Header */
.header {
    background: var(--bg-white);
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.9);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
}

.nav {
    display: flex;
    gap: 32px;
}

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

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

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    color: white;
    padding: 80px 0;
    text-align: center;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero .subtitle {
    font-size: 20px;
    opacity: 0.95;
    max-width: 700px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.hero-badges {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.badge {
    background: rgba(255, 255, 255, 0.2);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
}

/* Demo Section */
.demo-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.demo-header {
    text-align: center;
    margin-bottom: 48px;
}

.demo-header h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 12px;
}

.demo-header p {
    font-size: 18px;
    color: var(--text-secondary);
}

.demo-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 32px;
    align-items: start;
}

/* Widget Wrapper */
.widget-wrapper {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-lg);
}

.widget-frame {
    position: relative;
    width: 100%;
    height: 700px;
    border-radius: 8px;
    overflow: hidden;
    background: #F6F9FC;
}

.widget-frame iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    z-index: 10;
}

.loading-overlay.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Demo Controls */
.demo-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-card {
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow-md);
}

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

.control-hint {
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: 12px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.btn-secondary {
    background: var(--bg-light);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Credentials */
.credential-item {
    margin-bottom: 12px;
}

.credential-item:last-of-type {
    margin-bottom: 0;
}

.credential-item label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.credential-item code {
    display: block;
    background: var(--bg-light);
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    color: var(--text-primary);
    border: 1px solid var(--border);
}

/* Status */
.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--text-secondary);
    animation: pulse 2s infinite;
}

.status-dot.active {
    background: var(--success);
}

.status-dot.error {
    background: var(--error);
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.widget-url {
    font-size: 12px;
    color: var(--text-secondary);
    word-break: break-all;
    margin-top: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: var(--bg-white);
}

.features-section h2 {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.section-subtitle {
    text-align: center;
    font-size: 18px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

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

.feature-card {
    padding: 32px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    transition: all 0.2s;
}

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

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

.feature-card h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
}

.feature-card p {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Integration Section */
.integration-section {
    padding: 80px 0;
    background: var(--bg-light);
}

.integration-section h2 {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 12px;
}

.integration-tabs {
    max-width: 900px;
    margin: 0 auto;
    background: var(--bg-white);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow-md);
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
}

.tab-button {
    padding: 12px 24px;
    background: none;
    border: none;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.tab-button:hover {
    color: var(--primary);
}

.tab-button.active {
    color: var(--primary);
}

.tab-button.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.tab-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 16px;
}

.tab-content pre {
    background: #1E293B;
    color: #E2E8F0;
    padding: 24px;
    border-radius: 8px;
    overflow-x: auto;
    margin-bottom: 16px;
}

.tab-content code {
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 14px;
    line-height: 1.6;
}

.code-note {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

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

.code-note a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    background: var(--secondary);
    color: white;
    padding: 60px 0 24px;
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 48px;
    margin-bottom: 48px;
}

.footer-brand p {
    opacity: 0.8;
    margin-top: 12px;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
}

.footer-column h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    margin-bottom: 12px;
    transition: color 0.2s;
}

.footer-column a:hover {
    color: white;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0.8;
}

.footer-meta {
    display: flex;
    gap: 24px;
}

.footer-meta a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    font-size: 14px;
}

.footer-meta a:hover {
    color: white;
}

/* Responsive */
@media (max-width: 968px) {
    .demo-container {
        grid-template-columns: 1fr;
    }

    .demo-controls {
        order: -1;
    }

    .nav {
        display: none;
    }

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

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 16px;
        text-align: center;
    }
}

@media (max-width: 640px) {
    .hero {
        padding: 48px 0;
    }

    .hero h1 {
        font-size: 28px;
    }

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

    .demo-section {
        padding: 48px 0;
    }

    .widget-frame {
        height: 600px;
    }
}
