:root {
    --color-background: #121212;
    --color-surface: #1e1e1e;
    --color-text-primary: #ffffff;
    --color-text-secondary: #aaaaaa;
    --color-accent: #00bcd4;
    --color-shadow: rgba(0, 0, 0, 0.5);
    --color-border: #333333;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--color-background);
    color: var(--color-text-primary);
    line-height: 1.6;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
}

h1, h2, h3 {
    color: var(--color-accent);
    margin-bottom: 15px;
    font-weight: 600;
}

h2 {
    font-size: 1.8em;
}

p {
    margin-bottom: 10px;
}

.hero {
    background: linear-gradient(135deg, var(--color-surface), #0a0a0a);
    padding: 60px 0;
    text-align: center;
    border-bottom: 2px solid var(--color-accent);
    box-shadow: 0 4px 15px var(--color-shadow);
}

.hero h1 {
    font-size: 2.8em;
    margin-bottom: 10px;
    color: var(--color-text-primary);
    text-shadow: 0 0 10px rgba(0, 188, 212, 0.5);
}

.hero p {
    font-size: 1.2em;
    color: var(--color-text-secondary);
}

.card {
    background-color: var(--color-surface);
    padding: 30px;
    margin: 30px 0;
    border-radius: 8px;
    border-left: 5px solid var(--color-accent);
    box-shadow: 0 4px 8px var(--color-shadow);
    transition: transform 0.3s, box-shadow 0.3s;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px var(--color-shadow), 0 0 20px rgba(0, 188, 212, 0.2);
}

.card-icon {
    font-size: 2.5em;
    color: var(--color-accent);
    margin-bottom: 15px;
}

.note {
    background-color: #2a2a2a;
    border-left: 3px solid #f39c12;
    padding: 10px 15px;
    margin-top: 15px;
    font-style: italic;
    color: var(--color-text-secondary);
    border-radius: 4px;
}

.integration-flow {
    text-align: center;
}

.flow-chart {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    justify-content: center;
    align-items: center;
}

.flow-step {
    flex-basis: 18%;
    background-color: #333333;
    padding: 15px 10px;
    border-radius: 6px;
    color: var(--color-text-primary);
    font-weight: bold;
    font-size: 0.9em;
    position: relative;
    border: 1px solid var(--color-border);
}

.flow-step i {
    display: block;
    margin-top: 5px;
    color: var(--color-accent);
}

.flow-arrow {
    flex-basis: 5%;
    font-size: 1.5em;
    color: var(--color-accent);
}

.flow-step.step-return {
    background-color: #004d40;
    border-color: #00bcd4;
}

.examples-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

.example-card {
    background-color: var(--color-surface);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    transition: background-color 0.3s;
}

.example-card:hover {
    background-color: #252525;
}

.example-card h3 {
    font-size: 1.4em;
    color: var(--color-accent);
    margin-bottom: 10px;
}

.example-card i {
    margin-right: 10px;
}

footer {
    background-color: #0a0a0a;
    color: var(--color-text-secondary);
    text-align: center;
    padding: 15px 0;
    margin-top: 40px;
    border-top: 1px solid var(--color-border);
}

#theme-toggle {
    background-color: var(--color-accent);
    color: var(--color-background);
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1em;
    font-weight: bold;
    margin-top: 20px;
    transition: background-color 0.3s;
}

#theme-toggle:hover {
    background-color: #008c9e;
}

body.light-mode {
    --color-background: #f4f4f4;
    --color-surface: #ffffff;
    --color-text-primary: #333333;
    --color-text-secondary: #666666;
    --color-shadow: rgba(0, 0, 0, 0.1);
    --color-border: #cccccc;
    --color-accent: #1e88e5;
    --color-surface-darker: #e0e0e0;
}

body.light-mode .hero {
    border-bottom: 2px solid var(--color-accent);
}

body.light-mode .note {
    background-color: var(--color-surface-darker);
    color: var(--color-text-primary);
    border-left-color: #f39c12;
}

body.light-mode .flow-step {
    background-color: var(--color-surface-darker);
    color: var(--color-text-primary);
    border: 1px solid #b0b0b0;
}

body.light-mode .flow-step.step-return {
    background-color: #bbdefb;
    border-color: var(--color-accent);
}

body.light-mode .example-card h3 {
    color: var(--color-accent);
}

body.light-mode .flow-step i {
    color: var(--color-accent);
}

#back-to-top {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--color-accent);
    color: var(--color-background);
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.2em;
    cursor: pointer;
    box-shadow: 0 4px 8px var(--color-shadow);
    transition: opacity 0.3s, background-color 0.3s;
    z-index: 1000;
}

#back-to-top:hover {
    background-color: #008c9e;
}

@media (max-width: 768px) {
    .flow-chart {
        display: flex;
        flex-direction: column;
    }
    .flow-step, .flow-arrow {
        flex-basis: 100%;
        margin: 5px 0;
    }
    .flow-arrow i {
        transform: rotate(90deg);
    }
    .examples-grid {
        grid-template-columns: 1fr;
    }
    .hero h1 {
        font-size: 2em;
    }
}
