:root {
    --primary-color: #0066cc;
    --text-dark: #1a1a1a;
    --text-gray: #666666;
    --border-color: #e0e0e0;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

html {
    -webkit-text-size-adjust: 100%;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

body.rtl {
    direction: rtl;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background-color: var(--white);
    min-height: 100vh;
}

header {
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: all 0.3s ease;
}

.back-button:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.lang-switcher {
    display: flex;
    gap: 10px;
}

.lang-btn {
    padding: 8px 16px;
    min-height: 44px;
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-dark);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
}

.lang-btn:hover,
.lang-btn.active {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.subtitle {
    font-size: 16px;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.last-updated {
    font-size: 14px;
    color: var(--text-gray);
    font-style: italic;
}

.content {
    padding: 20px 0;
}

.section {
    margin-bottom: 40px;
}

.section h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color);
}

.section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin-top: 20px;
    margin-bottom: 10px;
}

.section p {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}

.section ul,
.section ol {
    margin: 15px 0;
    padding-left: 30px;
}

body.rtl .section ul,
body.rtl .section ol {
    padding-left: 0;
    padding-right: 30px;
}

.section li {
    font-size: 16px;
    color: var(--text-dark);
    line-height: 1.8;
    margin-bottom: 10px;
}

.highlight-box {
    background-color: var(--bg-light);
    border-left: 4px solid var(--primary-color);
    padding: 20px;
    margin: 20px 0;
    border-radius: 4px;
}

body.rtl .highlight-box {
    border-left: none;
    border-right: 4px solid var(--primary-color);
}

.contact-info {
    background-color: var(--bg-light);
    padding: 20px;
    border-radius: 8px;
    margin-top: 40px;
}

.contact-info h3 {
    margin-top: 0;
}

.contact-info p {
    margin-bottom: 8px;
}

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

.contact-info a:hover {
    text-decoration: underline;
}

footer {
    margin-top: 60px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
    text-align: center;
    color: var(--text-gray);
    font-size: 14px;
}

.home-container {
    max-width: 600px;
    margin: 0 auto;
    padding: max(16px, env(safe-area-inset-top)) 16px max(32px, env(safe-area-inset-bottom));
    background-color: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
    min-height: 100vh;
}

.home-container h1 {
    margin-bottom: 30px;
}

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

.link-card {
    padding: 20px;
    background-color: var(--bg-light);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.link-card:hover {
    background-color: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 204, 0.2);
}

.link-card .icon {
    font-size: 32px;
}

.link-card .title {
    font-size: 16px;
    font-weight: 600;
}

.link-card .lang-label {
    font-size: 12px;
    color: var(--text-gray);
}

.link-card:hover .lang-label {
    color: inherit;
}

.link-card-wide {
    grid-column: 1 / -1;
}

@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 24px;
    }

    .section h2 {
        font-size: 20px;
    }

    .section h3 {
        font-size: 16px;
    }

    .section p,
    .section li {
        font-size: 14px;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

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

    .home-container {
        margin: 0 auto;
        padding: 24px 16px;
        border-radius: 0;
        box-shadow: none;
    }
}

@media (max-width: 480px) {
    .container,
    .home-container {
        padding: 12px;
    }

    h1 {
        font-size: 22px;
    }

    .link-card {
        padding: 16px;
    }

    .back-button {
        width: 100%;
        justify-content: center;
    }
}
