:root {
    --bg-color: #ffffff;
    --text-primary: #111111;
    --text-secondary: #666666;
    --accent: #000000;
    --font-family: 'Inter', sans-serif;
    --page-width: 800px;
    --spacing: 1.5rem;
}


[data-theme="dark"] {
    --bg-color: #121212;
    /* Slightly darker for more depth */
    --text-primary: #e0e0e0;
    --text-secondary: #b0b0b0;
    /* Lighter for better readability */
    --accent: #ffffff;
}

/* Fix specific elements in dark mode */
[data-theme="dark"] .job-date,
[data-theme="dark"] .cert-year,
[data-theme="dark"] .edu-meta span:last-child {
    background: #2a2a2a;
    color: #d0d0d0;
}

[data-theme="dark"] .job-details li {
    color: #d0d0d0;
}

[data-theme="dark"] .job-details li::before {
    color: #e0e0e0;
}

[data-theme="dark"] .contact-info {
    color: #b0b0b0;
}

[data-theme="dark"] .contact-info a {
    color: #b0b0b0;
    /* Match text color exactly */
    border-bottom-color: #555;
}

[data-theme="dark"] .contact-info a:hover {
    color: #fff;
    border-bottom-color: #fff;
}

[data-theme="dark"] .job-entry,
[data-theme="dark"] .edu-entry {
    border-left-color: #333;
}

[data-theme="dark"] .job-entry:hover,
[data-theme="dark"] .edu-entry:hover {
    border-left-color: var(--text-primary);
}

[dir="rtl"][data-theme="dark"] .job-entry,
[dir="rtl"][data-theme="dark"] .edu-entry {
    border-left-color: transparent;
    border-right-color: #333;
}

[dir="rtl"][data-theme="dark"] .job-entry:hover,
[dir="rtl"][data-theme="dark"] .edu-entry:hover {
    border-right-color: var(--text-primary);
}

[data-theme="dark"] a {
    border-bottom-color: #444;
}

[data-theme="dark"] a:hover {
    border-bottom-color: #fff;
}

[data-theme="dark"] .tag {
    border-color: #333;
    color: #ccc;
}

[data-theme="dark"] .tag:hover {
    background: #222;
    border-color: #fff;
    color: #fff;
}

[data-theme="dark"] .cert-item {
    border-bottom-color: #222;
}

[data-theme="dark"] .cert-item:hover {
    background: linear-gradient(to right, #1f1f1f, transparent);
}

[data-theme="dark"] .ref-item {
    background: #1c1c1c;
    border-color: #333;
}

[data-theme="dark"] .ref-item:hover {
    background: #222;
    border-color: #555;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] #lang-toggle {
    background: #333;
    color: #fff;
}

[data-theme="dark"] .floating-btn {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    background: #333;
    color: #fff;
}

[data-theme="dark"] .floating-btn:hover {
    background: #444;
}

[data-theme="dark"] #cp-input {
    background: #1a1a1a;
    color: #fff;
    border-bottom-color: #333;
}

[data-theme="dark"] .cp-modal {
    background: #1a1a1a;
    border-color: #333;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

[data-theme="dark"] .cp-item {
    color: #ccc;
}

[data-theme="dark"] .cp-item:hover {
    background: #252525;
    color: #fff;
}

[dir="rtl"] {
    --font-family: 'Inter', system-ui, sans-serif;
    /* Add Arabic font if needed later */
    direction: rtl;
    text-align: right;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-family);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* Cursor Container */
#cursors-container {
    position: absolute;
    /* Relative to .cv-container now */
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9999;
    overflow: visible;
    /* Allow cursors to show in margins if needed */
}

.cursor {
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    pointer-events: none;
    transition: transform 0.1s linear;
    opacity: 0.6;
    display: flex;
    align-items: center;
    justify-content: center;
    top: 0;
    /* meaningful defaults */
    left: 0;
    margin-left: -2px;
    /* Slight offset adjustment for the arrow tip */
    margin-top: -2px;
}

.cursor-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 15px solid currentColor;
    /* Uses color from inline style */
    transform: rotate(-30deg);
}

/* Language Toggle */
#lang-toggle {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    z-index: 100;
    transition: transform 0.2s;
}

[dir="rtl"] #lang-toggle {
    right: auto;
    left: 20px;
}

#lang-toggle:hover {
    transform: scale(1.05);
}

/* Layout */
.cv-container {
    position: relative;
    /* Anchor for cursors */
    max-width: var(--page-width);
    margin: 0 auto;
    padding: 60px 20px;
}

/* Typography */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
    margin-top: 3rem;
}

h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

p,
li {
    font-size: 0.95rem;
    color: var(--text-primary);
}

a {
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: 1px solid #ccc;
    transition: border-color 0.2s;
}

a:hover {
    border-bottom-color: var(--text-primary);
}

.contact-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 3rem;
}

.justified {
    text-align: justify;
}

/* Experience - Minimalist Timeline */
.job-entry {
    margin-bottom: 2.5rem;
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}

.job-entry:hover {
    border-left-color: var(--text-primary);
}

.job-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 0.2rem;
}

.job-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
}

.job-company {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: block;
    /* Ensure it sits on its own line if needed */
}

.job-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-family: var(--font-family);
    font-feature-settings: "tnum";
    background: #f9f9f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.job-details {
    list-style-type: none;
    padding-left: 0;
    margin-top: 0.5rem;
}

.job-details li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.4rem;
    line-height: 1.6;
    color: #444;
    /* Slightly softer than pure black */
}

.job-details li::before {
    content: "›";
    /* More modern than a bullet */
    position: absolute;
    left: 0;
    color: var(--text-secondary);
    font-weight: bold;
}

/* Nested List Styling */
.job-details ul {
    list-style-type: none;
    /* Remove default circle/disc */
    padding-left: 0.5rem;
    /* Indent nested block */
    margin: 0.3rem 0;
}

.job-details ul li {
    padding-left: 1rem;
    font-size: 0.9em;
    /* Slightly smaller for hierarchy */
    color: var(--text-secondary);
}

.job-details ul li::before {
    content: "-";
    /* Different marker for nested */
    font-weight: normal;
}

/* RTL Support for Timeline */
[dir="rtl"] .job-entry {
    padding-left: 0;
    padding-right: 1.5rem;
    border-left: none;
    border-right: 2px solid #f0f0f0;
}

[dir="rtl"] .job-entry:hover {
    border-right-color: var(--text-primary);
}

[dir="rtl"] .job-details li {
    padding-left: 0;
    padding-right: 1rem;
}

[dir="rtl"] .job-details li::before {
    left: auto;
    right: 0;
    content: "‹";
    transform: rotate(180deg);
    /* Rotated to point right (outwards) as per user request */
}

[dir="rtl"] .job-details ul li::before {
    content: "-";
    /* Hyphen is neutral */
}

/* Education - Minimalist Timeline */
.edu-entry {
    margin-bottom: 2rem;
    position: relative;
    padding-left: 1.5rem;
    border-left: 2px solid #f0f0f0;
    transition: border-color 0.3s ease;
}

.edu-entry:hover {
    border-left-color: var(--text-primary);
}

.edu-entry h3 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    color: var(--text-primary);
}

.edu-meta {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Make the date look distinct like in job history */
.edu-meta span:last-child {
    background: #f9f9f9;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    margin-left: 0.5rem;
    color: var(--text-secondary);
}

[dir="rtl"] .edu-meta span:last-child {
    margin-left: 0;
    margin-right: 0.5rem;
}

/* RTL Support for Education */
[dir="rtl"] .edu-entry {
    padding-left: 0;
    padding-right: 1.5rem;
    border-left: none;
    border-right: 2px solid #f0f0f0;
}

[dir="rtl"] .edu-entry:hover {
    border-right-color: var(--text-primary);
}

/* Tags (Skills) - Clean Outlined Look */
.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-top: 0.5rem;
}

.tag {
    background: transparent;
    border: 1px solid #e0e0e0;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-weight: 500;
}

.tag:hover {
    border-color: var(--text-primary);
    background: #fdfdfd;
    transform: translateY(-1px);
}

/* Certificates - Clean List */
.cert-timeline-list {
    list-style: none;
    padding: 0;
    margin-top: 0.5rem;
}

.cert-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f5f5f5;
    transition: all 0.3s ease;
    /* Transition all properties for smooth RTL support */
}


/* ... existing code ... */

[dir="rtl"] .cert-item:hover {
    padding-left: 0;
    padding-right: 0.5rem;
    background: linear-gradient(to left, #fafafa, transparent);
}

.cert-item:hover {
    padding-left: 0.5rem;
    /* Subtle indent on hover */
    background: linear-gradient(to right, #fafafa, transparent);
}

.cert-name {
    font-weight: 500;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.cert-year {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-feature-settings: "tnum";
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 1rem;
}

[dir="rtl"] .cert-year {
    margin-left: 0;
    margin-right: 1rem;
}

[dir="rtl"] .cert-item:hover {
    padding-left: 0;
    padding-right: 0.5rem;
    background: linear-gradient(to left, #fafafa, transparent);
}

/* Languages - Clean List */
.lang-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-top: 0.5rem;
}

.lang-item {
    display: flex;
    flex-direction: column;
}

.lang-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.lang-level {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* References - Minimal Cards */
.ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.ref-item {
    padding: 1rem;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: all 0.2s ease;
    background: #fafafa;
}

.ref-item:hover {
    border-color: #ddd;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
    transform: translateY(-2px);
}

.ref-name {
    font-weight: 600;
    display: block;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.ref-role {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
    line-height: 1.4;
    min-height: 2.25rem;
    /* align heights roughly */
}

.ref-contact {
    font-size: 0.85rem;
    color: var(--text-secondary);
    border-bottom: 1px dotted #ccc;
    padding-bottom: 1px;
}

.ref-contact:hover {
    color: var(--text-primary);
    border-bottom-style: solid;
}

/* Command Palette */
.hidden {
    display: none;
}

.cp-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(2px);
    z-index: 200;
}

.cp-modal {
    position: fixed;
    top: 20%;
    left: 50%;
    width: 500px;
    transform: translateX(-50%);
    background: white;
    border: 1px solid #ddd;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    z-index: 201;
    overflow: hidden;
    padding: 10px;
}

/* Privacy Blur for Mobile Numbers */
.privacy-blur {
    filter: blur(4px);
    transition: filter 0.3s ease;
    user-select: none;
    /* Prevent easy copying without looking */
    cursor: pointer;
    display: inline-block;
    /* Ensure filter works correctly */
}

.privacy-blur:hover {
    filter: blur(0);
}



#cp-input {
    width: 100%;
    padding: 12px;
    font-size: 1.1rem;
    border: none;
    outline: none;
    font-family: inherit;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 10px;
}

.cp-item {
    padding: 10px 12px;
    cursor: pointer;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: background-color 0.2s;
}

.cp-item svg {
    color: var(--text-secondary);
}

.cp-item:hover {
    background: #f5f5f5;
}

.cp-item:hover svg {
    color: var(--text-primary);
}

/* Floating Command Button */
.floating-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--text-primary);
    color: var(--bg-color);
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.floating-btn:hover {
    transform: scale(1.1);
}

[dir="rtl"] .floating-btn {
    right: auto;
    left: 30px;
}

/* ==========================================
   RESPONSIVE DESIGN - MEDIA QUERIES
   ========================================== */

/* Tablet breakpoint */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    .cv-container {
        padding: 50px 15px;
    }

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

/* Mobile breakpoint */
@media (max-width: 480px) {
    h1 {
        font-size: 1.75rem;
    }

    .cv-container {
        padding: 40px 15px;
    }

    /* Command Palette - fit mobile screen */
    .cp-modal {
        width: calc(100% - 40px);
        top: 10%;
    }

    /* Job Header - stack vertically */
    .job-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
    }

    [dir="rtl"] .job-header {
        align-items: flex-end;
    }

    /* Certificate Items - stack vertically */
    .cert-item {
        gap: 0.25rem;
    }

    .cert-year {
        margin-left: 0;
    }
[dir="rtl"] .cert-item
    [dir="rtl"] .cert-year {
        margin-right: 0;
    }

    /* Contact Info - improve wrapping */
    .contact-info {
        line-height: 1.8;
    }

    /* Floating Button - adjust position and size */
    .floating-btn {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    [dir="rtl"] .floating-btn {
        right: auto;
        left: 20px;
    }

    /* Language Toggle - smaller on mobile */
    #lang-toggle {
        top: 15px;
        right: 15px;
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    [dir="rtl"] #lang-toggle {
        right: auto;
        left: 15px;
    }

    /* Skills tags - smaller on mobile */
    .tag {
        padding: 5px 10px;
        font-size: 0.8rem;
    }

    /* References grid - single column */
    .ref-grid {
        grid-template-columns: 1fr !important;
    }
}