/* Basic Reset */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    
    /* 🟢 V3.0 AESTHETIC: IT-themed patterned background */
    background-color: #1a1a2e; /* Dark fallback color */
    background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxMDAiIGhlaWdodD0iMTAwIiB2aWV3Qm94PSIwIDAgMTAwIDEwMCI+PHJlY3QgZmlsbD0iIzFhMTgyZSIgd2lkdGg9IjEwMCIgaGVpZ2h0PSIxMDAiLz48cGF0aCBkPSJNLTEwIDAgTDEwMCAxMTAgTDEwMCAtMTAgWiIgc3Ryb2tlPSIjMGIyODQ1IiBzdHJva2Utd2lkdGg9IjEiIG9wYWNpdHk9IjAuMSIvPjxwYXRoIGQ9Ik0tMjAgMCBMOTAgMTEwIEw5MCAtMTAgWiIgc3Ryb2tlPSIjMGIyODQ1IiBzdHJva2Utd2lkdGg9IjEiIG9wYWNpdHk9IjAuMSIvPjxwYXRoIGQ9Ik0wIC0xMCBMMTEwIDEwMCBMMTEwIC0yMCZaIiBzdHJva2U9IiMwYjI4NDUiIHN0cm9rZS13aWR0aD0iMSIgb3BhY2l0eT0iMC4xIi8+PC9zdmc+");
    background-attachment: fixed;
    background-size: 50px 50px; 
    
    color: #e4e4f0; /* Light text */
    line-height: 1.6;
}

header {
    background-color: #16213e;
    color: white;
    padding: 20px 0;
    text-align: center;
    border-bottom: 5px solid #0f3460;
}

/* 🟢 UPDATED: Default NAV links styling */
header nav a {
    color: #9ac8e8; /* Default blue for Project/About/Contact */
    margin: 0 15px;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

/* 🟢 NEW RULE: Target the language links (index.html, index-ar.html) and make them WHITE */
header nav a[href="index-ar.html"],
header nav a[href="index.html"] {
    color: white; /* Changed to White as requested */
    font-weight: normal; /* Less bold than main sections */
}


header nav a:hover {
    color: #e94560;
}

/* Ensure the hover works on the language links too */
header nav a[href="index-ar.html"]:hover,
header nav a[href="index.html"]:hover {
    color: #ffb86c; /* Yellow/orange hover */
}


main {
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

h2 {
    color: #e94560;
    text-align: center;
    margin-bottom: 40px;
    border-bottom: 2px solid #0f3460;
    padding-bottom: 10px;
}

/* Project Grid */
/* Update the default grid container */
.grid-container {
    display: grid;
    gap: 20px;

    /* 🟢 SOLUTION FOR AUTO-RESIZING AND FLEXIBILITY (New in V21.0) 
       This tells the browser to automatically fit columns:
       - min(100% / 4) ensures the column size shrinks down to 25% of the container 
         if there's enough space for 4 items.
       - It falls back to a minimum of 250px, ensuring readability on small screens 
         before dropping to a new row.
    */
    grid-template-columns: repeat(auto-fit, minmax(clamp(250px, 100% / 4, 1fr), 1fr));
}

/* ⚠️ IMPORTANT: Ensure you REMOVE the two @media query blocks from the previous step (V20.0) 
   to let this single rule manage all resizing. 
*/

.project-card {
    background-color: #0f3460;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.6);
}

.project-card h3 {
    color: #ffb86c;
    margin-top: 0;
}

.tech-stack {
    margin-top: 15px;
}

.tech-stack span {
    display: inline-block;
    background-color: #e94560;
    color: white;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8em;
    margin-right: 5px;
    margin-bottom: 5px;
}

.project-links a {
    color: #9ac8e8;
    text-decoration: none;
    margin-right: 15px;
    font-weight: bold;
}

footer {
    text-align: center;
    padding: 20px;
    background-color: #16213e;
    color: #e4e4f0;
    margin-top: 40px;
}

/* --- Contact Section Styling (V3.0/V12.0 style) --- */
#contact {
    text-align: center;
    padding: 60px 20px;
    background-color: #16213e; /* Dark header color for visual break */
    border-radius: 8px;
    margin-top: 40px;
}

.contact-details {
    max-width: 600px;
    margin: 20px auto;
    padding: 20px;
    background-color: #0f3460; /* Card color for details box */
    border-radius: 6px;
}

.contact-link {
    color: #ffb86c; /* Highlight link color */
    text-decoration: none;
    font-weight: bold;
    transition: color 0.2s;
}

.contact-link:hover {
    color: #e94560;
}

.note {
    font-size: 0.85em;
    color: #9ac8e8;
    margin-left: 10px;
}

/* --- RTL (Right-to-Left) Adjustments (Functional) --- */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] header nav {
    text-align: center;
}

[dir="rtl"] .tech-stack span {
    margin-left: 5px; 
    margin-right: 0;
}

[dir="rtl"] .project-links a {
    margin-left: 15px;
    margin-right: 0;
}
/* --- About Section Styling ---*/
#about .contact-details p {
    text-align: justify;
    margin-bottom: 15px;
}

[dir="rtl"] #about .contact-details p {
    text-align: right;
}