/* HELY Documentation Styles */
:root {
    --hely-primary: #13AFAC;
    --hely-primary-dark: #0d8a88;
    --hely-primary-light: #e6f7f7;
    --hely-secondary: #6c757d;
    --hely-success: #28a745;
    --hely-warning: #ffc107;
    --hely-danger: #dc3545;
    --hely-dark: #1a1a2e;
    --hely-light: #f8f9fa;
    --hely-white: #ffffff;
    --hely-text: #333333;
    --hely-text-muted: #6c757d;
    --hely-border: #e0e0e0;
    --hely-shadow: 0 2px 8px rgba(0,0,0,0.1);
    --sidebar-width: 280px;
    --header-height: 70px;
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    --hely-dark: #1a1a2e;
    --hely-light: #16213e;
    --hely-white: #0f0f23;
    --hely-text: #e0e0e0;
    --hely-text-muted: #a0a0a0;
    --hely-border: #2a2a4a;
    --hely-primary-light: rgba(19, 175, 172, 0.15);
}

/* RTL Support for Arabic */
[dir="rtl"] {
    --sidebar-position: right;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    background-color: var(--hely-light);
    color: var(--hely-text);
    line-height: 1.6;
    min-height: 100vh;
}

/* ============================================
   HEADER
   ============================================ */
.docs-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--hely-white);
    border-bottom: 1px solid var(--hely-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    box-shadow: var(--hely-shadow);
}

.docs-header-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--hely-primary);
    font-weight: 700;
    font-size: 24px;
}

.docs-header-logo img {
    height: 40px;
}

.docs-header-title {
    font-size: 14px;
    color: var(--hely-text-muted);
    font-weight: 400;
}

.docs-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

/* Language Selector */
.lang-selector {
    position: relative;
}

.lang-selector-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--hely-light);
    border: 1px solid var(--hely-border);
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--hely-text);
    transition: all 0.2s;
}

.lang-selector-btn:hover {
    border-color: var(--hely-primary);
}

.lang-selector-btn .flag {
    font-size: 18px;
}

.lang-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--hely-white);
    border: 1px solid var(--hely-border);
    border-radius: 8px;
    box-shadow: var(--hely-shadow);
    min-width: 160px;
    display: none;
    z-index: 1001;
}

.lang-dropdown.show {
    display: block;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
}

.lang-option:hover {
    background: var(--hely-primary-light);
}

.lang-option.active {
    background: var(--hely-primary-light);
    color: var(--hely-primary);
}

/* Theme Toggle */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid var(--hely-border);
    background: var(--hely-light);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--hely-primary);
    color: var(--hely-primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 24px;
}

/* ============================================
   SIDEBAR
   ============================================ */
.docs-sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--hely-white);
    border-right: 1px solid var(--hely-border);
    overflow-y: auto;
    padding: 24px 0;
    z-index: 900;
    transition: transform 0.3s;
}

[dir="rtl"] .docs-sidebar {
    left: auto;
    right: 0;
    border-right: none;
    border-left: 1px solid var(--hely-border);
}

.sidebar-section {
    margin-bottom: 24px;
}

.sidebar-section-title {
    padding: 8px 24px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--hely-text-muted);
}

.sidebar-nav {
    list-style: none;
}

.sidebar-nav-item {
    display: block;
}

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 24px;
    color: var(--hely-text);
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
    border-left: 3px solid transparent;
}

[dir="rtl"] .sidebar-nav-link {
    border-left: none;
    border-right: 3px solid transparent;
}

.sidebar-nav-link:hover {
    background: var(--hely-primary-light);
    color: var(--hely-primary);
}

.sidebar-nav-link.active {
    background: var(--hely-primary-light);
    color: var(--hely-primary);
    border-left-color: var(--hely-primary);
    font-weight: 600;
}

[dir="rtl"] .sidebar-nav-link.active {
    border-left-color: transparent;
    border-right-color: var(--hely-primary);
}

.sidebar-nav-link .icon {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

/* Sidebar Sub-navigation */
.sidebar-subnav {
    list-style: none;
    padding-left: 48px;
    display: none;
}

[dir="rtl"] .sidebar-subnav {
    padding-left: 0;
    padding-right: 48px;
}

.sidebar-nav-item.expanded .sidebar-subnav {
    display: block;
}

.sidebar-subnav-link {
    display: block;
    padding: 8px 16px;
    color: var(--hely-text-muted);
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s;
}

.sidebar-subnav-link:hover,
.sidebar-subnav-link.active {
    color: var(--hely-primary);
}

/* ============================================
   MAIN CONTENT
   ============================================ */
.docs-main {
    margin-left: var(--sidebar-width);
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    padding: 32px 48px;
}

[dir="rtl"] .docs-main {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

.docs-content {
    max-width: 900px;
    margin: 0 auto;
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    font-size: 14px;
}

.breadcrumbs a {
    color: var(--hely-text-muted);
    text-decoration: none;
    transition: color 0.2s;
}

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

.breadcrumbs .separator {
    color: var(--hely-text-muted);
}

.breadcrumbs .current {
    color: var(--hely-text);
    font-weight: 500;
}

/* Page Title */
.page-title {
    font-size: 32px;
    font-weight: 700;
    color: var(--hely-text);
    margin-bottom: 8px;
}

.page-subtitle {
    font-size: 16px;
    color: var(--hely-text-muted);
    margin-bottom: 32px;
}

/* ============================================
   CARDS
   ============================================ */
.card {
    background: var(--hely-white);
    border-radius: 12px;
    border: 1px solid var(--hely-border);
    padding: 24px;
    margin-bottom: 24px;
    transition: box-shadow 0.2s;
}

.card:hover {
    box-shadow: var(--hely-shadow);
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: var(--hely-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--hely-primary);
    margin-bottom: 16px;
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--hely-text);
}

.card-description {
    font-size: 14px;
    color: var(--hely-text-muted);
    line-height: 1.6;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 16px;
    color: var(--hely-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: gap 0.2s;
}

.card-link:hover {
    gap: 10px;
}

/* Card Grid */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

/* User Type Cards (Home) */
.user-type-card {
    background: var(--hely-white);
    border-radius: 16px;
    border: 1px solid var(--hely-border);
    padding: 32px;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s;
}

.user-type-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(19, 175, 172, 0.15);
    border-color: var(--hely-primary);
}

.user-type-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--hely-primary-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    color: var(--hely-primary);
}

.user-type-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--hely-text);
    margin-bottom: 8px;
}

.user-type-desc {
    font-size: 14px;
    color: var(--hely-text-muted);
}

/* ============================================
   FEATURE SECTIONS
   ============================================ */
.feature-section {
    margin-bottom: 48px;
}

.feature-section-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--hely-primary-light);
}

.feature-section-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--hely-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
}

.feature-section-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--hely-text);
}

.feature-section-number {
    font-size: 14px;
    color: var(--hely-text-muted);
}

/* Feature Item */
.feature-item {
    background: var(--hely-white);
    border-radius: 12px;
    border: 1px solid var(--hely-border);
    margin-bottom: 16px;
    overflow: hidden;
}

.feature-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    transition: background 0.2s;
}

.feature-item-header:hover {
    background: var(--hely-primary-light);
}

.feature-item-title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 16px;
    font-weight: 600;
    color: var(--hely-text);
}

.feature-item-title .number {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--hely-primary-light);
    color: var(--hely-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

.feature-item-toggle {
    font-size: 18px;
    color: var(--hely-text-muted);
    transition: transform 0.3s;
}

.feature-item.expanded .feature-item-toggle {
    transform: rotate(180deg);
}

.feature-item-content {
    padding: 0 20px 20px 60px;
    display: none;
}

[dir="rtl"] .feature-item-content {
    padding: 0 60px 20px 20px;
}

.feature-item.expanded .feature-item-content {
    display: block;
}

.feature-description {
    font-size: 14px;
    color: var(--hely-text-muted);
    margin-bottom: 16px;
    line-height: 1.7;
}

.feature-details {
    list-style: none;
}

.feature-details li {
    position: relative;
    padding-left: 20px;
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--hely-text);
}

[dir="rtl"] .feature-details li {
    padding-left: 0;
    padding-right: 20px;
}

.feature-details li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--hely-primary);
}

[dir="rtl"] .feature-details li::before {
    left: auto;
    right: 0;
}

/* Platform Badges */
.platform-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.platform-badge.web {
    background: #e3f2fd;
    color: #1976d2;
}

.platform-badge.mobile {
    background: #fce4ec;
    color: #c2185b;
}

/* ============================================
   TABLES
   ============================================ */
.table-wrapper {
    overflow-x: auto;
    margin: 24px 0;
}

.docs-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.docs-table th,
.docs-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--hely-border);
}

[dir="rtl"] .docs-table th,
[dir="rtl"] .docs-table td {
    text-align: right;
}

.docs-table th {
    background: var(--hely-primary-light);
    font-weight: 600;
    color: var(--hely-text);
}

.docs-table tr:hover td {
    background: var(--hely-light);
}

/* ============================================
   TABS
   ============================================ */
.tabs {
    margin-bottom: 24px;
}

.tabs-header {
    display: flex;
    border-bottom: 2px solid var(--hely-border);
}

.tab-btn {
    padding: 12px 24px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--hely-text-muted);
    position: relative;
    transition: color 0.2s;
}

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

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

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

.tab-content {
    display: none;
    padding: 24px 0;
}

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

/* ============================================
   SEARCH
   ============================================ */
.search-box {
    position: relative;
    margin-bottom: 24px;
}

.search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    border: 1px solid var(--hely-border);
    border-radius: 10px;
    font-size: 15px;
    background: var(--hely-white);
    color: var(--hely-text);
    transition: border-color 0.2s, box-shadow 0.2s;
}

[dir="rtl"] .search-input {
    padding: 14px 48px 14px 20px;
}

.search-input:focus {
    outline: none;
    border-color: var(--hely-primary);
    box-shadow: 0 0 0 3px var(--hely-primary-light);
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--hely-text-muted);
    font-size: 18px;
}

[dir="rtl"] .search-icon {
    left: auto;
    right: 16px;
}

/* ============================================
   ALERTS / NOTES
   ============================================ */
.alert {
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.alert-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.alert-info {
    background: #e3f2fd;
    border: 1px solid #90caf9;
    color: #1565c0;
}

.alert-success {
    background: #e8f5e9;
    border: 1px solid #a5d6a7;
    color: #2e7d32;
}

.alert-warning {
    background: #fff3e0;
    border: 1px solid #ffcc80;
    color: #e65100;
}

.alert-tip {
    background: var(--hely-primary-light);
    border: 1px solid var(--hely-primary);
    color: var(--hely-primary-dark);
}

/* ============================================
   FOOTER
   ============================================ */
.docs-footer {
    margin-left: var(--sidebar-width);
    padding: 32px 48px;
    background: var(--hely-white);
    border-top: 1px solid var(--hely-border);
    text-align: center;
}

[dir="rtl"] .docs-footer {
    margin-left: 0;
    margin-right: var(--sidebar-width);
}

.docs-footer-text {
    font-size: 14px;
    color: var(--hely-text-muted);
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .docs-main {
        padding: 24px 32px;
    }
}

@media (max-width: 768px) {
    .mobile-menu-toggle {
        display: block;
    }

    .docs-sidebar {
        transform: translateX(-100%);
    }

    [dir="rtl"] .docs-sidebar {
        transform: translateX(100%);
    }

    .docs-sidebar.open {
        transform: translateX(0);
    }

    .docs-main {
        margin-left: 0;
        padding: 20px 16px;
    }

    [dir="rtl"] .docs-main {
        margin-right: 0;
    }

    .docs-footer {
        margin-left: 0;
    }

    [dir="rtl"] .docs-footer {
        margin-right: 0;
    }

    .page-title {
        font-size: 24px;
    }

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

    .tabs-header {
        overflow-x: auto;
    }

    .feature-item-content {
        padding-left: 20px;
    }

    [dir="rtl"] .feature-item-content {
        padding-left: 20px;
        padding-right: 20px;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* ============================================
   SCROLLBAR
   ============================================ */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--hely-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--hely-text-muted);
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .docs-header,
    .docs-sidebar,
    .lang-selector,
    .theme-toggle,
    .mobile-menu-toggle {
        display: none !important;
    }

    .docs-main {
        margin: 0;
        padding: 20px;
    }

    .card {
        break-inside: avoid;
    }
}
