/* Semantik ERP Documentation - Stylesheet */

:root {
    --primary-color: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-color: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-dark: #1e293b;
    --text-color: #334155;
    --text-light: #64748b;
    --text-dark: #0f172a;
    --border-color: #e2e8f0;
    --sidebar-width: 280px;
    --header-height: 64px;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: var(--text-color);
    background-color: var(--bg-color);
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 24px;
}

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

.header-logo img {
    height: 32px;
}

.header-nav {
    margin-left: auto;
    display: flex;
    gap: 24px;
}

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

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

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    margin-left: auto;
}

/* Mobile header nav - hidden on desktop */
.mobile-header-nav {
    display: none;
}

/* Layout */
.layout {
    display: flex;
    margin-top: var(--header-height);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: var(--sidebar-width);
    height: calc(100vh - var(--header-height));
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    padding: 24px 0;
    transition: transform 0.3s ease;
}

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

.sidebar-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-light);
    padding: 0 24px;
    margin-bottom: 8px;
}

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

.sidebar-nav a {
    display: block;
    padding: 10px 24px;
    color: var(--text-color);
    text-decoration: none;
    font-size: 14px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

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

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

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    min-height: calc(100vh - var(--header-height));
    padding: 48px;
    max-width: 900px;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    color: var(--text-dark);
    font-weight: 600;
    line-height: 1.3;
    margin-top: 2em;
    margin-bottom: 0.5em;
}

h1 {
    font-size: 2.5rem;
    margin-top: 0;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

h2 {
    font-size: 1.75rem;
    margin-top: 2.5em;
}

h3 {
    font-size: 1.35rem;
}

h4 {
    font-size: 1.15rem;
}

p {
    margin-bottom: 1em;
}

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

a:hover {
    text-decoration: underline;
}

/* Lists */
ul, ol {
    margin-bottom: 1em;
    padding-left: 2em;
}

li {
    margin-bottom: 0.5em;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 14px;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid var(--border-color);
}

th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-dark);
}

tr:hover {
    background: var(--bg-secondary);
}

/* Code */
code {
    background: var(--bg-secondary);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.9em;
    color: var(--primary-dark);
}

pre {
    background: var(--bg-dark);
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 1.5em 0;
}

pre code {
    background: none;
    padding: 0;
    color: inherit;
}

/* Blockquote */
blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-secondary);
    padding: 16px 20px;
    margin: 1.5em 0;
    border-radius: 0 8px 8px 0;
}

blockquote p:last-child {
    margin-bottom: 0;
}

/* Alerts/Callouts */
.alert {
    padding: 16px 20px;
    border-radius: 8px;
    margin: 1.5em 0;
    border-left: 4px solid;
}

.alert-info {
    background: #eff6ff;
    border-color: var(--primary-color);
    color: #1e40af;
}

.alert-success {
    background: #ecfdf5;
    border-color: var(--success-color);
    color: #065f46;
}

.alert-warning {
    background: #fffbeb;
    border-color: var(--warning-color);
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border-color: var(--danger-color);
    color: #991b1b;
}

/* Cards */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 1.5em 0;
}

.card {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 24px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.card h3 {
    margin-top: 0;
    font-size: 1.1rem;
}

.card p {
    color: var(--text-light);
    font-size: 14px;
    margin-bottom: 0;
}

/* Checklist */
.checklist {
    list-style: none;
    padding-left: 0;
}

.checklist li {
    position: relative;
    padding-left: 32px;
    margin-bottom: 12px;
}

.checklist li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
}

.checklist li.checked::before {
    background: var(--success-color);
    border-color: var(--success-color);
}

.checklist li.checked::after {
    content: '✓';
    position: absolute;
    left: 3px;
    top: 2px;
    color: white;
    font-size: 12px;
    font-weight: bold;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    text-decoration: none;
}

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

.btn-secondary:hover {
    background: var(--border-color);
    text-decoration: none;
}

/* Navigation between pages */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.page-nav a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: var(--bg-secondary);
    border-radius: 8px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.2s;
}

.page-nav a:hover {
    background: var(--border-color);
}

.page-nav .next {
    margin-left: auto;
}

/* Search */
.search-box {
    padding: 12px 24px;
    margin-bottom: 16px;
}

.search-input {
    width: 100%;
    padding: 10px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    background: var(--bg-color);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Footer */
.footer {
    margin-top: 48px;
    padding: 24px 0;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-light);
    font-size: 14px;
}

/* Home Page */
.hero {
    text-align: center;
    padding: 60px 0;
}

.hero h1 {
    border: none;
    font-size: 3rem;
    margin-bottom: 16px;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-light);
    max-width: 600px;
    margin: 0 auto 32px;
}

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

.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin: 48px 0;
}

.feature {
    text-align: center;
    padding: 32px 24px;
}

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

.feature h3 {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .main-content {
        padding: 32px;
    }
}

@media (max-width: 768px) {
    .header {
        padding: 0 12px;
    }

    .header-logo {
        font-size: 16px;
        gap: 6px;
        flex-shrink: 0;
    }

    .header-logo span:last-child {
        display: none;
    }

    .header-nav {
        display: none;
    }

    .lang-switcher {
        margin-left: auto;
        margin-right: 8px;
    }

    .lang-switcher a {
        padding: 5px 10px;
        font-size: 13px;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        padding: 0;
        flex-shrink: 0;
        border-radius: 8px;
        background: var(--bg-secondary);
    }

    .menu-toggle:hover {
        background: var(--border-color);
    }

    /* Mobile slide-out menu */
    .sidebar {
        transform: translateX(-100%);
        z-index: 999;
        width: 280px;
        max-width: 85%;
        background: var(--bg-color);
    }

    .sidebar.open {
        transform: translateX(0);
        box-shadow: 4px 0 12px rgba(0,0,0,0.15);
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0,0,0,0.5);
        z-index: 998;
    }

    .sidebar-overlay.open {
        display: block;
    }

    /* Mobile menu header nav section */
    .mobile-header-nav {
        display: block;
        padding: 16px;
        border-bottom: 1px solid var(--border-color);
        background: var(--bg-secondary);
    }

    .mobile-header-nav a {
        display: block;
        padding: 12px 16px;
        color: var(--text-color);
        text-decoration: none;
        font-weight: 500;
        border-radius: 8px;
        transition: all 0.2s;
    }

    .mobile-header-nav a:hover {
        background: var(--bg-color);
        color: var(--primary-color);
    }

    .main-content {
        margin-left: 0;
        padding: 20px 16px;
        max-width: 100%;
    }

    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 1.35rem;
        margin-top: 1.5em;
    }

    h3 {
        font-size: 1.15rem;
    }

    .hero {
        padding: 30px 0;
    }

    .hero h1 {
        font-size: 1.75rem;
    }

    .hero p {
        font-size: 1rem;
        margin-bottom: 24px;
    }

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

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

    .card {
        padding: 20px;
    }

    .card h3 {
        font-size: 1rem;
    }

    table {
        display: block;
        overflow-x: auto;
        font-size: 13px;
    }

    th, td {
        padding: 8px 12px;
    }

    pre {
        padding: 16px;
        font-size: 13px;
        margin: 1em 0;
    }

    .page-nav {
        flex-direction: column;
        gap: 12px;
        margin-top: 32px;
    }

    .page-nav a {
        justify-content: center;
    }

    .page-nav .next {
        margin-left: 0;
    }

    .footer {
        margin-top: 32px;
        padding: 16px 0;
    }

    .search-box {
        padding: 12px 16px;
    }

    .sidebar-title {
        padding: 0 16px;
    }

    .sidebar-nav a {
        padding: 12px 16px;
    }
}

/* Print Styles */
@media print {
    .header, .sidebar, .page-nav {
        display: none;
    }

    .main-content {
        margin: 0;
        padding: 0;
        max-width: 100%;
    }
}

/* RTL Support for Arabic */
[dir="rtl"] {
    direction: rtl;
    text-align: right;
}

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

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

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

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

[dir="rtl"] .page-nav .next {
    margin-left: 0;
    margin-right: auto;
}

[dir="rtl"] pre, [dir="rtl"] code {
    direction: ltr;
    text-align: left;
}

[dir="rtl"] table {
    text-align: right;
}

[dir="rtl"] .checklist li {
    padding-left: 0;
    padding-right: 32px;
}

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

[dir="rtl"] .checklist li.checked::after {
    left: auto;
    right: 3px;
}

[dir="rtl"] ul, [dir="rtl"] ol {
    padding-left: 0;
    padding-right: 2em;
}

[dir="rtl"] blockquote {
    border-left: none;
    border-right: 4px solid var(--primary-color);
    border-radius: 8px 0 0 8px;
}

[dir="rtl"] .alert {
    border-left: none;
    border-right: 4px solid;
}

@media (max-width: 768px) {
    [dir="rtl"] .sidebar {
        transform: translateX(100%);
        left: auto;
        right: 0;
    }

    [dir="rtl"] .sidebar.open {
        transform: translateX(0);
        box-shadow: -4px 0 12px rgba(0,0,0,0.15);
    }

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

    [dir="rtl"] .lang-switcher {
        margin-left: 8px;
        margin-right: auto;
    }

    [dir="rtl"] .mobile-header-nav a {
        text-align: right;
    }
}

/* Language Switcher */
.lang-switcher {
    display: flex;
    gap: 8px;
    margin-left: 16px;
}

.lang-switcher a {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--text-color);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    transition: all 0.2s;
}

.lang-switcher a:hover {
    background: var(--border-color);
}

.lang-switcher a.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

[dir="rtl"] .lang-switcher {
    margin-left: 0;
    margin-right: 16px;
}

[dir="rtl"] .header-nav {
    margin-left: 0;
    margin-right: auto;
}
