/* ==================== Variables ==================== */
:root {
    --primary-color: #4CAF50;
    --secondary-color: #2196F3;
    --accent-color: #FF9800;
    --dark-bg: #1a1a2e;
    --darker-bg: #16213e;
    --light-bg: #f5f7fa;
    --text-dark: #2c3e50;
    --text-light: #ffffff;
    --text-muted: #6c757d;
    --border-color: #e0e6ed;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
    --transition: all 0.3s ease;
}

/* ==================== Reset & Base ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--light-bg);
}

code, pre {
    font-family: 'Fira Code', 'Courier New', monospace;
}

/* ==================== Navigation ==================== */
.navbar {
    background: var(--dark-bg);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    height: 60px;
    width: auto;
}

.brand-name {
    color: var(--text-light);
    font-size: 1.5rem;
    font-weight: 700;
}

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

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: var(--text-light);
    transition: var(--transition);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.github-link {
    background: var(--primary-color);
    padding: 0.5rem 1.5rem !important;
    border-radius: 25px;
    border-bottom: none !important;
}

.github-link:hover {
    background: #45a049;
    transform: translateY(-2px);
}

/* ==================== Container ==================== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ==================== Sections ==================== */
.section {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-dark);
    font-weight: 700;
}

.section-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    margin: 1rem auto;
    border-radius: 2px;
}

/* ==================== Hero Section ==================== */
.hero {
    background: linear-gradient(135deg, var(--dark-bg) 0%, var(--darker-bg) 100%);
    color: var(--text-light);
    padding: 6rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    font-weight: 800;
}

.gradient-text {
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #e0e6ed;
}

.hero-description {
    font-size: 1.1rem;
    max-width: 700px;
    margin: 0 auto 2.5rem;
    color: #b8c5d6;
    line-height: 1.8;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
}

/* ==================== Buttons ==================== */
.btn {
    display: inline-block;
    padding: 0.875rem 2rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--text-light);
}

.btn-primary:hover {
    background: #45a049;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-light);
    border-color: var(--text-light);
}

.btn-secondary:hover {
    background: var(--text-light);
    color: var(--text-dark);
    transform: translateY(-3px);
}

/* ==================== Badges ==================== */
.badges {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.badges img {
    height: 22px;
}

/* ==================== About Section ==================== */
.about {
    background: var(--light-bg);
}

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

.about-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    text-align: center;
}

.about-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.about-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.about-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.about-card p {
    color: var(--text-muted);
    line-height: 1.8;
}

.about-card code {
    background: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: var(--primary-color);
    font-size: 0.9em;
}

/* ==================== Features Section ==================== */
.features {
    background: white;
}

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

.feature-card {
    padding: 2rem;
    border-radius: 12px;
    background: var(--light-bg);
    transition: var(--transition);
    border: 2px solid transparent;
}

.feature-card:hover {
    border-color: var(--primary-color);
    background: white;
    box-shadow: var(--shadow-lg);
}

.feature-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    display: block;
}

.feature-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

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

/* ==================== Use Cases Section ==================== */
.use-cases {
    background: var(--light-bg);
}

.use-cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.use-case {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.use-case:hover {
    transform: translateX(10px);
    box-shadow: var(--shadow-lg);
}

.use-case-icon {
    font-size: 2rem;
}

.use-case span:last-child {
    font-weight: 500;
    color: var(--text-dark);
}

/* ==================== Real-World Examples Section ==================== */
.examples {
    background: white;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
}

.example-card {
    background: var(--light-bg);
    border-radius: 16px;
    padding: 2rem;
    border: 2px solid var(--border-color);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

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

.example-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.example-card h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-bottom: 0.75rem;
}

.example-scenario {
    color: var(--text-muted);
    line-height: 1.7;
    padding: 1rem;
    background: white;
    border-radius: 8px;
    border-left: 4px solid var(--secondary-color);
}

.example-scenario strong {
    color: var(--secondary-color);
    display: block;
    margin-bottom: 0.5rem;
}

.example-challenge {
    padding: 1rem;
    background: #fff3cd;
    border-radius: 8px;
    border-left: 4px solid var(--accent-color);
}

.example-challenge strong {
    color: #856404;
    display: block;
    margin-bottom: 0.75rem;
}

.example-challenge ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.example-challenge li {
    padding: 0.4rem 0;
    padding-left: 1.5rem;
    position: relative;
    color: #856404;
    line-height: 1.6;
}

.example-challenge li:before {
    content: "⚠️";
    position: absolute;
    left: 0;
    font-size: 0.9rem;
}

.example-solution {
    padding: 1rem;
    background: #d4edda;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    color: #155724;
    line-height: 1.7;
}

.example-solution strong {
    color: #155724;
    display: block;
    margin-bottom: 0.5rem;
}

.example-solution code {
    background: rgba(76, 175, 80, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    color: #0d4420;
    font-size: 0.9em;
    font-weight: 600;
}

/* ==================== Usage Section ==================== */
.usage {
    background: white;
}

.usage-step {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    align-items: flex-start;
}

.step-number {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.step-content {
    flex: 1;
}

.step-content h3 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.step-content p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* ==================== Code Blocks ==================== */
.code-block {
    background: var(--dark-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.code-block pre {
    margin: 0;
    padding: 1.5rem;
    overflow-x: auto;
}

.code-block code {
    color: #e0e6ed;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ==================== Installation Section ==================== */
.installation {
    background: var(--light-bg);
}

.installation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.installation-card {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.installation-card h3 {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.package-logo {
    height: 30px;
    width: auto;
}

.installation-card p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.installation-card code {
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

.version-note {
    background: #fff3cd;
    border-left: 4px solid #ffc107;
    padding: 1.5rem;
    border-radius: 8px;
}

.version-note strong {
    color: #856404;
    display: block;
    margin-bottom: 0.5rem;
}

.version-note p {
    color: #856404;
    margin: 0;
}

.version-note code {
    background: rgba(255, 193, 7, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9em;
}

/* ==================== Documentation Section ==================== */
.documentation {
    background: white;
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.doc-card {
    background: var(--light-bg);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
    border: 2px solid transparent;
}

.doc-card:hover {
    border-color: var(--primary-color);
    background: white;
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
}

.doc-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.doc-card h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.doc-card p {
    color: var(--text-muted);
}

/* ==================== Code Example Section ==================== */
.code-example {
    background: var(--light-bg);
}

.example-tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-button {
    background: white;
    border: 2px solid var(--border-color);
    padding: 0.75rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

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

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

.tab-content {
    display: none;
}

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

/* ==================== Operations Tables ==================== */
.operations-tables {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.interface-operations {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
}

.interface-operations h3 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.interface-description {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    line-height: 1.6;
}

.operations-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.operations-table thead {
    background: linear-gradient(135deg, var(--primary-color), #45a049);
    color: white;
}

.operations-table thead th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.operations-table thead th:first-child {
    width: 35%;
}

.operations-table tbody tr {
    border-bottom: 1px solid var(--border-color);
    transition: var(--transition);
}

.operations-table tbody tr:last-child {
    border-bottom: none;
}

.operations-table tbody tr:hover {
    background: #f8f9fa;
    transform: scale(1.01);
}

.operations-table tbody td {
    padding: 1rem;
    color: var(--text-dark);
    vertical-align: top;
}

.operations-table tbody td:first-child {
    font-weight: 500;
}

.operations-table code {
    background: #f4f4f4;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    color: var(--primary-color);
    font-size: 0.9em;
    font-weight: 600;
    white-space: nowrap;
}

.operations-table tbody td:last-child {
    color: var(--text-muted);
    line-height: 1.6;
}

/* ==================== Stats Section ==================== */
.stats {
    background: var(--dark-bg);
    color: var(--text-light);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.stat-card {
    text-align: center;
    padding: 2rem;
}

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.stat-label {
    font-size: 1.1rem;
    color: #b8c5d6;
}

/* ==================== Contributing Section ==================== */
.contributing {
    background: white;
}

.contributing-content {
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.contributing-text {
    font-size: 1.2rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    line-height: 1.8;
}

.contributing-links {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.contributing-links .btn {
    background: var(--light-bg);
    color: var(--text-dark);
    border-color: var(--border-color);
}

.contributing-links .btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* ==================== Footer ==================== */
.footer {
    background: var(--darker-bg);
    color: var(--text-light);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.footer-section h4 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #e0e6ed;
}

.footer-section p {
    color: #b8c5d6;
    margin-bottom: 0.5rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: #b8c5d6;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section ul li a:hover {
    color: var(--primary-color);
}

.copyright {
    font-size: 0.9rem;
    margin-top: 1rem;
}

/* ==================== Responsive Design ==================== */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--dark-bg);
        flex-direction: column;
        padding: 1rem 0;
        box-shadow: var(--shadow);
    }

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

    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1.2rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .section-title {
        font-size: 2rem;
    }

    .usage-step {
        flex-direction: column;
    }

    .installation-grid {
        grid-template-columns: 1fr;
    }

    .code-block pre {
        font-size: 0.8rem;
    }

    /* Operations tables responsive */
    .operations-table {
        font-size: 0.9rem;
    }

    .operations-table thead th {
        padding: 0.75rem;
        font-size: 0.85rem;
    }

    .operations-table tbody td {
        padding: 0.75rem;
    }

    .operations-table code {
        font-size: 0.85em;
        padding: 0.2rem 0.4rem;
    }

    .interface-operations {
        padding: 1.5rem;
    }

    .interface-operations h3 {
        font-size: 1.5rem;
    }
}

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

    .hero-title {
        font-size: 2rem;
    }

    .section {
        padding: 3rem 0;
    }

    .about-grid,
    .features-grid,
    .use-cases-grid,
    .examples-grid {
        grid-template-columns: 1fr;
    }

    .stat-number {
        font-size: 2rem;
    }

    /* Operations tables mobile */
    .operations-table {
        display: block;
        overflow-x: auto;
        font-size: 0.85rem;
    }

    .operations-table thead th:first-child {
        width: auto;
        min-width: 150px;
    }

    .operations-table tbody td {
        padding: 0.6rem;
    }

    .operations-table code {
        font-size: 0.8em;
        word-break: break-word;
        white-space: normal;
    }

    .interface-operations {
        padding: 1rem;
    }

    .interface-operations h3 {
        font-size: 1.3rem;
    }

    .interface-description {
        font-size: 0.95rem;
    }
}

/* ==================== Animations ==================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-content,
.about-card,
.feature-card,
.doc-card {
    animation: fadeIn 0.6s ease-out;
}

/* ==================== Scrollbar Styling ==================== */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--light-bg);
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #45a049;
}
