/* =========================================
   RTL Vision - Refactored Stylesheet
   =========================================
   Table of Contents:
   1. CSS Variables
   2. Base Styles
   3. Typography
   4. Layout & Containers
   5. Navigation & Header
   6. Content Sections
   7. Examples & Demonstrations
   8. Tables & Data Display
   9. Forms & Interactive Elements
   10. Tweet Section
   11. Footer
   12. Utility Classes
   13. Media Queries
   ========================================= */

/* ----------------------------------------
   1. CSS Variables
   ---------------------------------------- */
:root {
    /* Colors */
    --color-primary: #24935F;
    --color-primary-light: #80519F;
    --color-primary-dark: #344955;

    --color-accent: #F5BD02;
    --color-accent-light: #FFCC80;
    --color-accent-dark: #E09500;

    --color-background: #F5F5F5;
    --color-card: #FFFFFF;
    --color-text: #333333;
    --color-text-light: #666666;
    --color-text-muted: #777777;

    --color-border: #EEEEEE;
    --color-example-bg: #EEEEEE;
    --color-real-world-bg: #FFF3E0;

    --color-status-poor: #E74C3C;
    --color-status-partial: #F9AA33;
    --color-status-good: #2ECC71;
    --color-status-excellent: #3498DB;

    --color-twitter: #1DA1F2;
    --color-twitter-dark: #0c85d0;
    --color-linkedin: #0077B5;
    --color-linkedin-dark: #005e8c;

    /* Spacing */
    --spacing-xs: 0.5em;
    --spacing-sm: 0.8em;
    --spacing-md: 1em;
    --spacing-lg: 1.5em;
    --spacing-xl: 2em;
    --spacing-xxl: 2.5em;
    --spacing-xxxl: 3em;

    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 6px;
    --radius-lg: 8px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 8px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 16px rgba(0, 0, 0, 0.1);

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

/* ----------------------------------------
   2. Base Styles
   ---------------------------------------- */
html {
    direction: rtl; /* Sets the base direction for block elements and text */
    scroll-behavior: smooth;
}

body {
    font-family: 'IBM Plex Sans Arabic', sans-serif;
    text-align: right;
    line-height: 1.7;
    margin: 0;
    padding: 0;
    background-color: var(--color-background);
    color: var(--color-text);
    font-size: 1.1em;
}

* {
    box-sizing: border-box;
}

img {
    max-width: 100%;
    height: auto;
}

/* ----------------------------------------
   3. Typography
   ---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    line-height: 1.3;
    color: var(--color-primary);
}

h1 {
    font-size: 2em;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
}

h2 {
    font-size: 1.6em;
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
    padding-bottom: var(--spacing-xs);
}

h3 {
    font-size: 1.3em;
    font-weight: 600;
    margin-top: var(--spacing-xl);
    margin-bottom: var(--spacing-md);
}

p {
    margin-top: 0;
    margin-bottom: var(--spacing-lg);
    line-height: 1.8;
}

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

a:hover {
    color: var(--color-primary-dark);
}

strong {
    font-weight: 600;
}

/* ----------------------------------------
   4. Layout & Containers
   ---------------------------------------- */
main {
    max-width: 900px;
    margin: var(--spacing-xl) auto;
    padding: var(--spacing-lg);
    background-color: var(--color-card);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-lg);
}

section {
    margin-bottom: var(--spacing-xxl);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--color-border);
}

section:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

/* ----------------------------------------
   5. Navigation & Header
   ---------------------------------------- */
header {
    background-color: var(--color-primary);
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    text-align: center;
}

header h1 {
    color: white;
    margin: 0;
}

header p {
    margin-bottom: 0;
}

header a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    margin-top: var(--spacing-sm);
    display: inline-block;
    font-size: 0.9em;
    border-bottom: 1px solid transparent;
    transition: border-bottom var(--transition-normal);
}

header a:hover {
    border-bottom: 1px solid white;
    color: white;
}

/* ----------------------------------------
   6. Content Sections
   ---------------------------------------- */
.section-title {
    color: var(--color-primary);
    margin-bottom: var(--spacing-lg);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 0;
    width: 50px;
    height: 3px;
    background-color: var(--color-accent);
}

.section-content {
    margin-bottom: var(--spacing-xl);
}

/* ----------------------------------------
   7. Examples & Demonstrations
   ---------------------------------------- */
.example {
    background-color: var(--color-example-bg);
    border: 1px solid var(--color-border);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    border-right: 5px solid var(--color-accent);
    border-left: none;
    border-radius: var(--radius-sm);
}

.example p {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

.example strong {
    color: var(--color-text);
}

.real-world {
    margin: var(--spacing-xl) 0;
    padding: var(--spacing-lg);
    background-color: var(--color-real-world-bg);
    border: 1px solid var(--color-accent);
    border-right: 5px solid var(--color-accent);
    border-left: none;
    border-radius: var(--radius-sm);
}

.real-world h3 {
    margin-top: 0;
    margin-bottom: var(--spacing-md);
    color: var(--color-primary);
}

.real-world ul {
    margin: var(--spacing-md) 0;
    padding-right: var(--spacing-xl);
}

.real-world li {
    margin-bottom: var(--spacing-md);
    line-height: 1.6;
}

/* Code examples */
pre {
    background-color: var(--color-example-bg);
    padding: var(--spacing-md);
    border-radius: var(--radius-sm);
    font-family: Consolas, Monaco, monospace;
    direction: ltr;
    text-align: left;
    white-space: pre-wrap;
    word-break: break-all;
    margin: var(--spacing-md) 0;
    font-size: 0.95em;
    overflow-x: auto;
}

/* Lists */
ul {
    padding-right: var(--spacing-xl);
    padding-left: 0;
    list-style-position: outside;
    margin-bottom: var(--spacing-lg);
}

li {
    margin-bottom: var(--spacing-md);
}

/* ----------------------------------------
   8. Tables & Data Display
   ---------------------------------------- */
.product-table-container {
    margin: var(--spacing-xl) 0;
    overflow-x: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.product-status-table {
    width: 100%;
    border-collapse: collapse;
    text-align: right;
}

.product-status-table th,
.product-status-table td {
    padding: var(--spacing-md);
    border: 1px solid var(--color-border);
}

.product-status-table th {
    background-color: var(--color-primary);
    color: white;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.product-status-table tbody tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.product-status-table td {
    font-size: 0.95em;
    vertical-align: top;
}

/* Status indicators */
.status-poor {
    color: var(--color-status-poor);
    font-weight: 600;
}

.status-partial {
    color: var(--color-status-partial);
    font-weight: 600;
}

.status-good {
    color: var(--color-status-good);
    font-weight: 600;
}

.status-excellent {
    color: var(--color-status-excellent);
    font-weight: 600;
}

/* ----------------------------------------
   9. Forms & Interactive Elements
   ---------------------------------------- */
.action-buttons {
    text-align: center;
    margin-top: var(--spacing-xxxl);
    margin-bottom: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--color-border);
}

.button,
.action-buttons a.button {
    display: inline-block;
    background-color: var(--color-accent);
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    margin: 0 var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    border: none;
    cursor: pointer;
}

.button:hover,
.action-buttons a.button:hover {
    background-color: var(--color-accent-dark);
    color: white;
}

.button:active,
.action-buttons a.button:active {
    transform: scale(0.98);
}

.button.secondary,
.action-buttons a.button.secondary {
    background-color: #DDDDDD;
    color: var(--color-text);
}

.button.secondary:hover,
.action-buttons a.button.secondary:hover {
    background-color: #CCCCCC;
}

/* ----------------------------------------
   10. Tweet Section
   ---------------------------------------- */
.tweet-section {
    background-color: var(--color-primary-light);
    color: white;
    padding: var(--spacing-xl);
    border-radius: var(--radius-lg);
    margin: var(--spacing-xxxl) auto;
    max-width: 900px;
    position: relative;
    overflow: hidden;
    text-align: center;
    box-shadow: var(--shadow-md);
}

.tweet-section h2 {
    color: white;
    margin-top: 0;
    border-bottom: 3px solid var(--color-accent);
    display: inline-block;
    padding-bottom: var(--spacing-xs);
}

.tweet-box {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin: var(--spacing-lg) 0;
    text-align: right;
}

.tweet-text {
    font-size: 1.1em;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    color: rgba(255, 255, 255, 0.95);
}

/* Share buttons container */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
}

/* Base button styles */
.tweet-section .button {
    color: white;
    padding: var(--spacing-sm) var(--spacing-lg);
    margin: 0 var(--spacing-sm) var(--spacing-md) var(--spacing-sm);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-size: 1.1em;
    font-weight: 600;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    min-width: 160px;
    justify-content: center;
}

/* Twitter button specific styles */
.tweet-section .twitter-button {
    background-color: var(--color-twitter);
}

.tweet-section .twitter-button:hover {
    background-color: var(--color-twitter-dark);
}

/* LinkedIn button specific styles */
.tweet-section .linkedin-button {
    background-color: var(--color-linkedin);
}

.tweet-section .linkedin-button:hover {
    background-color: var(--color-linkedin-dark);
}

.tweet-section .button i {
    font-size: 1.2em;
}

/* ----------------------------------------
   11. Footer
   ---------------------------------------- */
footer {
    text-align: center;
    margin-top: var(--spacing-xxxl);
    padding: var(--spacing-lg);
    color: var(--color-text-light);
    font-size: 1em;
    background-color: var(--color-example-bg);
}

footer small {
    display: block;
    margin-top: var(--spacing-md);
    color: var(--color-text-muted);
    font-size: 0.85em;
}

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

footer a:hover {
    color: var(--color-primary-dark);
}

/* ----------------------------------------
   12. Utility Classes
   ---------------------------------------- */
.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-left {
    text-align: left;
}

.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.my-0 { margin-top: 0; margin-bottom: 0; }

.mt-1 { margin-top: var(--spacing-sm); }
.mb-1 { margin-bottom: var(--spacing-sm); }
.my-1 { margin-top: var(--spacing-sm); margin-bottom: var(--spacing-sm); }

.mt-2 { margin-top: var(--spacing-md); }
.mb-2 { margin-bottom: var(--spacing-md); }
.my-2 { margin-top: var(--spacing-md); margin-bottom: var(--spacing-md); }

.mt-3 { margin-top: var(--spacing-lg); }
.mb-3 { margin-bottom: var(--spacing-lg); }
.my-3 { margin-top: var(--spacing-lg); margin-bottom: var(--spacing-lg); }

.mt-4 { margin-top: var(--spacing-xl); }
.mb-4 { margin-bottom: var(--spacing-xl); }
.my-4 { margin-top: var(--spacing-xl); margin-bottom: var(--spacing-xl); }

.mt-5 { margin-top: var(--spacing-xxl); }
.mb-5 { margin-bottom: var(--spacing-xxl); }
.my-5 { margin-top: var(--spacing-xxl); margin-bottom: var(--spacing-xxl); }

/* ----------------------------------------
   13. Media Queries
   ---------------------------------------- */
@media (max-width: 768px) {
    main {
        margin: var(--spacing-md);
        padding: var(--spacing-md);
    }

    header {
        padding: var(--spacing-md) var(--spacing-lg);
    }

    h1 {
        font-size: 1.8em;
    }

    h2 {
        font-size: 1.4em;
    }

    h3 {
        font-size: 1.1em;
    }

    body {
        font-size: 1em;
    }

    .real-world, .example {
        padding: var(--spacing-md);
    }

    ul {
        padding-right: var(--spacing-lg);
    }

    .tweet-section {
        padding: var(--spacing-lg);
        margin: var(--spacing-xl) var(--spacing-md);
    }
}

@media (max-width: 600px) {
    h1 {
        font-size: 1.5em;
    }

    h2 {
        font-size: 1.3em;
    }

    main {
        margin: var(--spacing-sm);
        padding: var(--spacing-sm);
    }

    .example, .real-world {
        padding: var(--spacing-sm);
    }

    .product-status-table th,
    .product-status-table td {
        padding: var(--spacing-sm);
        font-size: 0.9em;
    }

    .button,
    .action-buttons a.button {
        display: block;
        margin: 0 auto var(--spacing-md) auto;
        max-width: 250px;
    }

    .share-section {
        padding: var(--spacing-md);
    }

    .share-box {
        padding: var(--spacing-md);
    }
}
