/* ========== General Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    color: #333;
    line-height: 1.6;
}

    body.rtl {
        direction: rtl;
    }

    body.ltr {
        direction: ltr;
    }

/* ========== Logo Container ========== */
.logo-container {
    text-align: center;
    padding: 20px 0;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

    .logo-container img {
        max-width: 200px;
        height: auto;
    }

/* ========== Language Switcher ========== */
.lang-switcher {
    direction: rtl;
    position: fixed;
    top: 20px;
    z-index: 1000;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

    .lang-switcher.rtl {
        left: 20px;
    }

    .lang-switcher.ltr {
        right: 20px;
    }

    .lang-switcher a {
        text-decoration: none;
        color: #0066cc;
        font-weight: 500;
        padding: 5px 10px;
        border-radius: 4px;
        transition: all 0.2s;
    }

        .lang-switcher a:hover {
            background: #f0f0f0;
        }

        .lang-switcher a.active {
            background: #0066cc;
            color: white;
        }

/* ========== Main Container ========== */
.main-wrapper {
    max-width: 1400px;
    margin: 80px auto 40px;
    padding: 0 20px;
}

/* ========== Page Title ========== */
.page-title {
    font-size: 2em;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0e0e0;
}

/* ========== Tabs ========== */
.tabs-container {
    margin-bottom: 30px;
    border-bottom: 2px solid #e0e0e0;
}

.tabs {
    display: flex;
    gap: 5px;
}

.tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 1em;
    font-weight: 500;
    color: #666;
    transition: all 0.2s;
}

    .tab:hover {
        color: #0066cc;
        background: #f8f9fa;
    }

    .tab.active {
        color: #0066cc;
        border-bottom-color: #0066cc;
        background: #f8f9fa;
    }

/* ========== Tab Content ========== */
.tab-content {
    display: none;
}

    .tab-content.active {
        display: block;
    }

/* ========== Sections ========== */
.section {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 20px;
    overflow: hidden;
}

.section-header {
    background: #f8f9fa;
    padding: 15px 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
    transition: background 0.2s;
}

    .section-header:hover {
        background: #e9ecef;
    }

    .section-header h3 {
        font-size: 1.2em;
        font-weight: 600;
        color: #1a1a1a;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 10px;
    }

.section-content {
    padding: 20px;
}

/* ========== Toggle Icons ========== */
.toggle-icon {
    font-size: 0.8em;
    color: #666;
    transition: transform 0.2s;
}

.collapsible.collapsed .toggle-icon {
    transform: rotate(-90deg);
}

/* ========== Badges ========== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75em;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.required-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #dc3545;
    color: white;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 700;
}

.optional-badge {
    display: inline-block;
    padding: 2px 6px;
    background: #6c757d;
    color: white;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: 700;
}

/* ========== Copy Button ========== */
.copy-btn {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85em;
    color: #495057;
    margin-bottom: 10px;
    transition: all 0.2s;
}

    .copy-btn:hover {
        background: #e9ecef;
        border-color: #adb5bd;
    }

/* ========== Code Blocks ========== */
.code-block {
    background: #ffeb3b69;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    overflow-x: auto;
    font-family: 'Courier New', Consolas, Monaco, monospace;
    font-size: 0.9em;
    line-height: 1.5;
    text-align: left;
    direction: ltr;
}

    .code-block pre {
        margin: 0;
        color: #333;
        white-space: pre-wrap;
        word-wrap: break-word;
    }

/* ========== Parameters Table ========== */
.params-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    overflow: hidden;
}

    .params-table thead {
        background: #f8f9fa;
    }

    .params-table th {
        padding: 12px 15px;
        text-align: left;
        font-weight: 600;
        color: #495057;
        border-bottom: 2px solid #dee2e6;
        font-size: 0.9em;
    }

    .params-table td {
        padding: 12px 15px;
        border-bottom: 1px solid #e9ecef;
        color: #333;
        vertical-align: middle;
    }

    .params-table tbody tr:hover {
        background: #f8f9fa;
    }

    .params-table tbody tr:last-child td {
        border-bottom: none;
    }

.param-name {
    font-family: 'Courier New', monospace;
    font-weight: 600;
    color: #0066cc;
}

/* ========== Demo Section ========== */
.demo-section {
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.demo-form {
    margin-bottom: 20px;
}

    .demo-form label {
        display: block;
        margin-bottom: 5px;
        font-weight: 500;
        color: #495057;
    }

    .demo-form input[type="text"] {
        width: 100%;
        padding: 10px;
        border: 1px solid #dee2e6;
        border-radius: 4px;
        font-size: 1em;
        margin-bottom: 15px;
    }

    .demo-form input[type="submit"] {
        background: #0066cc;
        color: white;
        border: none;
        padding: 12px 24px;
        border-radius: 4px;
        font-size: 1em;
        font-weight: 500;
        cursor: pointer;
        transition: background 0.2s;
    }

        .demo-form input[type="submit"]:hover {
            background: #0052a3;
        }

.selected-station {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
}

    .selected-station .st-dt {
        color: #0066cc;
        font-weight: 600;
    }

.marked {
    background-color: yellow !important;
}
/* ========== RTL Support ========== */
body.rtl .params-table th,
body.rtl .params-table td {
    text-align: right;
}

body.ltr .params-table th,
body.ltr .params-table td {
    text-align: left;
}

/* ========== Modal Styles ========== */
@media (min-width: 768px) {
    .modal-dialog,
    .modal-content {
        width: 1050px;
        text-align: center;
    }
}

@media (max-width: 767px) {
    .modal-dialog,
    .modal-content {
        width: 98%;
        text-align: center;
    }
}

.modal-body {
    padding: 0;
    margin: 0;
}

    .modal-body p {
        margin: 0;
        padding: 0;
    }

button.close {
    float: left;
}

/* ========== Responsive Design ========== */
@media (max-width: 768px) {
    .main-wrapper {
        margin: 60px auto 20px;
        padding: 0 10px;
    }

    .page-title {
        font-size: 1.5em;
    }

    .tab {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .params-table {
        font-size: 0.85em;
    }

        .params-table th,
        .params-table td {
            padding: 8px 10px;
        }
}