@import url('https://fonts.googleapis.com/css2?family=Droid+Arabic+Kufi&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Raleway:wght@400;600;700&display=swap');

:root {
    --primary-color: #2980b9;
    --secondary-color: :root#3498db;
    --accent-color: #e74c3c;
    --bg-color: #f5f6fa;
    --text-color: #2c3e50;
    --card-bg: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --gradient-1: linear-gradient(135deg, #857550, #dbcbbc);
    --gradient-2: linear-gradient(135deg, #e74c3c, #c0392b);
    --gold-color: #FFD700; /* Added gold color variable */
}

/* General Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Droid Arabic Kufi", sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--bg-color);
}

/* RTL/LTR Specific Styles */
[dir="rtl"] {
    text-align: right;
}

[dir="ltr"] {
    text-align: left;
    font-family: 'Raleway', sans-serif; /* Apply Raleway for LTR */
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    line-height: 1.2;
}

/* Navigation */
.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: #fdefe0; /* Dark blue background from the image */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2); /* Subtle shadow */
    padding: 1rem 3%;
    display: flex;
    align-items: center;
    z-index: 1000;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.language-switcher {
    display: flex;
    gap: 0.5rem;
    margin-inline-start: auto;
}

.lang-button {
    background-color: #9C7F5F;
    color: #ffffff; /* White text for dark background */
    border: 1px solid #3a4b62; /* Darker border */
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.lang-button:hover {
    background-color: #1a2b42; /* Darker hover background */
    border-color: #61dafb; /* Light blue hover border */
    color: #61dafb;
}

.lang-button.active {
    background-color: unset; /* Light blue active background */
    color: #0a192f; /* Dark text for active state */
    border-color: #615a47;
    box-shadow: 0 4px 10px rgba(97, 218, 251, 0.3);
}

.logo {
    font-size: 1.6rem; /* Slightly larger font size */
    font-weight: 700; /* Bold */
}

.logo a {
    text-decoration: none;
    color: var(--text-color); /* Use text color for logo text */
    display: flex;
    align-items: center;
    gap: 0.75rem; /* Increased gap */
}

.logo i {
    font-size: 2.2rem; /* Slightly larger icon */
    color: var(--primary-color); /* Keep primary color for icon */
}

.nav-links {
    display: flex;
    gap: 2.5rem; /* Increased gap for more breathing room */
    margin-inline-start: auto;
    margin-inline-end: auto;
    /* Removed position: relative; to allow dropdown-content to position relative to main-nav */
}

.nav-links a {
    position: relative; /* For underline effect */
    text-decoration: none;
    color:#344b61; /* White links for dark background */
    font-weight: 600;
    font-size: 14px;
    padding-bottom: 5px;
    transition: color 0.3s ease;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%; /* Start from center */
    transform: translateX(-50%); /* Center the underline */
    width: 0; /* Initially no width */
    height: 2px;
    background-color: var(--primary-color); /* Underline color */
    transition: width 0.3s ease; /* Smooth width transition */
}

.nav-links a:hover {
    color: #9c7f5f; /* Light blue on hover */
}

.nav-links a:hover::after {
    width: 100%; /* Expand to full width on hover */
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: #ffffff; /* Darker background for search bar */
    border-radius: 30px;
    padding: 8px 15px;
    margin-inline-start: 25px;
    margin-inline-end: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    flex-grow: 1;
    max-width: 350px;
    border: 1px solid #3a4b62; /* Darker border */
}

.search-bar input {
    border: none;
    background: transparent;
    outline: none;
    padding: 0;
    font-size: 1rem;
    color: rgb(54, 54, 54); /* White text for dark background */
    flex-grow: 1;
    width: 100%;
}

.search-bar input::placeholder {
    color: #8899aa; /* Lighter placeholder for dark background */
}

.search-bar button {
    background: transparent;
    border: none;
    color: #ab8563; /* Softer icon color for dark background */
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 5px;
    transition: color 0.3s ease;
}

.search-bar button:hover {
    color: #1d1d1d; /* Light blue on hover */
}

/* Adjust main-nav for search bar */
.main-nav {
    justify-content: space-between; /* Distribute items with space between */
    gap: 1rem; /* Add some gap between elements */
}

/* Responsive adjustments for search bar */
@media (max-width: 768px) {
    .main-nav {
        flex-wrap: wrap; /* Allow items to wrap on smaller screens */
        justify-content: center;
    }
    .search-bar {
        order: 3; /* Move search bar below nav links and logo */
        width: 90%; /* Take more width on small screens */
        margin-top: 1rem;
        margin-inline-start: 0;
        margin-inline-end: 0;
    }
    .nav-links {
        order: 2;
        margin-inline-start: 0;
        margin-inline-end: 0;
        width: 100%;
        justify-content: center;
        margin-top: 1rem;
    }
    .language-switcher {
        order: 1; /* Keep language switcher at the top right */
        margin-inline-start: auto;
        margin-inline-end: 0;
    }
    .logo {
        order: 0; /* Keep logo at the top left */
        margin-inline-end: auto;
        margin-inline-start: 0;
    }
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    background-image: url(header.png); /* Solid dark blue background */
    color: white;
    padding: 6rem 5% 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin-bottom: 3rem;
}

.hero-content h1 {
    font-family: "Droid Arabic Kufi", sans-serif;
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

[dir="ltr"] .hero-content h1 {
    font-family: 'Raleway', sans-serif; /* Apply Raleway for LTR hero h1 */
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.cta-button {
    display: inline-block;
    padding: 1rem 2rem;
    background: #9c7f5f;
    color: white;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: transform 0.3s;
}

.cta-button:hover {
    transform: translateY(-3px);
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    width: 100%;
    max-width: 1000px;
}

.stat-box {
    background: #fdefe0;
    padding: 1.5rem;
    border-radius: 10px;
    text-align: center;
    color: #344b61;
}

.stat-box i {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.stat-number {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    color:#344b61;
}

/* Tools Section */
.tools-section {
    padding: 4rem 5%;
    background: var(--bg-color);
}

.tools-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.tool-card {
    background: #f5ebe2;
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.3s;
}

.tool-card:hover {
    transform: translateY(-5px);
}

.tool-card i {
    font-size: 3rem;
    color: #344b61;
    margin-bottom: 1rem;
}

.tool-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

/* Analytics Section */
.analytics-section {
    padding: 6rem 5%; /* Increased padding for more vertical space */
    background: linear-gradient(to bottom, var(--bg-color), #f0f2f5); /* Subtle gradient background */
    position: relative;
    overflow: hidden; /* Hide overflow for any animations */
}

.analytics-section::before {
    content: '';
    position: absolute;
    top: -50px;
    left: -50px;
    width: 200px;
    height: 200px;
    background: rgba(171, 133, 99, 0.1); /* Light, subtle background element */
    border-radius: 50%;
    filter: blur(80px);
    z-index: 0;
}

.analytics-section::after {
    content: '';
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 250px;
    height: 250px;
    background: rgba(86, 71, 39, 0.1); /* Another subtle background element */
    border-radius: 50%;
    filter: blur(90px);
    z-index: 0;
}

.analytics-section h2 {
    text-align: center;
    font-size: 3rem; /* Larger heading */
    margin-bottom: 4rem; /* More space below heading */
    color: #333; /* Darker text for contrast */
    position: relative;
    z-index: 1;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.05);
}

.analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* Slightly larger min-width for cards */
    gap: 2.5rem; /* Increased gap between cards */
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.analytics-card {
    background: var(--card-bg);
    padding: 2.5rem; /* Increased padding */
    border-radius: 20px; /* More rounded corners */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15); /* Stronger, more diffused shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    border: 1px solid rgba(0, 0, 0, 0.05); /* Subtle border */
}

.analytics-card:hover {
    transform: translateY(-8px); /* Lift on hover */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2); /* More pronounced shadow on hover */
}

.analytics-card h3 {
    font-size: 1.8rem; /* Larger card titles */
    color: #344b61; /* Use a primary color for titles */
    margin-bottom: 1.5rem; /* More space below title */
    font-weight: 700;
}

.chart-container {
    width: 100%;
    height: 320px; /* Slightly increased height for charts */
    margin-top: 1rem;
}

/* About Section */
.about-section {
    padding: 4rem 5%;
    background: var(--bg-color);
}

.about-section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
}

.about-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
}

.about-text {
    padding: 2rem;
}

.about-text h3 {
    color: #614328;
    margin-top: 2rem;
}

.about-text ul {
    list-style: none;
    margin-top: 1rem;
}

.about-text li {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.about-text li::before {
    content: '•';
    color: var(--primary-color);
    font-size: 1.5rem;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: center;
}

.feature-card i {
    font-size: 2.5rem;
    color: #344b61;
    margin-bottom: 1rem;
}

/* Latest Cases Section */
.latest-cases-section {
    padding: 4rem 5%;
    background: var(--bg-color);
    text-align: center;
}

.latest-cases-section h2 {
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: var(--text-color);
}

.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.case-card {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    text-align: right; /* RTL support */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #eee;
}

.case-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.case-card h3 {
    font-size: 1.6rem;
    color: #344b61;
    margin-bottom: 0.8rem;
}

.case-date {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 1rem;
}

.case-description {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    flex-grow: 1; /* Allow description to take available space */
}

.ai-handling {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 1rem;
    margin-top: 1rem;
    border: 1px solid #f0f0f0;
}

.ai-handling h4 {
    font-size: 1.1rem;
    color: #84744f;
    margin-bottom: 0.8rem;
    text-align: right; /* RTL support */
}

.ai-handling ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.ai-handling li {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    text-align: right; /* RTL support */
}

.ai-handling li::before {
    content: '\2022'; /* Bullet point */
    color: #ab8563;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-inline-end: 0.5em;
    flex-shrink: 0;
}

.case-status {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: bold;
    font-size: 0.9rem;
    margin-top: 1.5rem;
    text-align: center;
    align-self: flex-start; /* Align to start for RTL */
}

.case-status.success {
    background-color: #e6ffe6; /* Light green */
    color: #28a745; /* Dark green */
    border: 1px solid #28a745;
}

.case-status.warning {
    background-color: #fffbe6; /* Light yellow */
    color: #ffc107; /* Dark yellow */
    border: 1px solid #ffc107;
}

.case-status.error {
    background-color: #ffe6e6; /* Light red */
    color: #dc3545; /* Dark red */
    border: 1px solid #dc3545;
}

/* Responsive adjustments for latest-cases-section */
@media (max-width: 768px) {
    .latest-cases-section {
        padding: 3rem 3%;
    }

    .latest-cases-section h2 {
        font-size: 2rem;
        margin-bottom: 2rem;
    }

    .cases-grid {
        grid-template-columns: 1fr; /* Stack cards vertically on small screens */
    }

    .case-card {
        padding: 1.5rem;
    }

    .case-card h3 {
        font-size: 1.4rem;
    }

    .ai-handling {
        padding: 0.8rem;
    }

    .ai-handling h4 {
        font-size: 1rem;
    }

    .ai-handling li {
        font-size: 0.9rem;
    }

    .case-status {
        padding: 0.4rem 0.8rem;
        font-size: 0.8rem;
    }
}

/* Footer */
footer {
    background: #84744f;
    color: white;
    padding: 3rem 5% 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.footer-section h4 {
    margin-bottom: 1rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.social-links a {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.social-links a:hover {
    background: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .main-nav {
        padding: 0.8rem 1rem; /* Slightly less padding on small screens */
        flex-direction: column; /* Stack items vertically */
        align-items: flex-start; /* Align items to the start */
    }

    .logo {
        margin-inline-end: auto; /* Push logo to the left */
        margin-bottom: 1rem; /* Space below logo */
    }

    .nav-links {
        flex-direction: column; /* Stack nav links vertically */
        width: 100%; /* Full width */
        gap: 0.8rem; /* Smaller gap */
        margin-inline-start: 0;
        margin-inline-end: 0;
        margin-bottom: 1rem;
    }

    .nav-links a {
        width: 100%; /* Full width links */
        text-align: center; /* Center text */
        padding: 0.5rem 0; /* Add vertical padding */
        border-radius: 5px; /* Slightly rounded corners */
        background-color: #f0f0f0; /* Light background for links */
    }

    .nav-links a:hover {
        background-color: #e0e0e0; /* Darker background on hover */
    }

    .search-bar {
        width: 100%; /* Full width search bar */
        margin-inline-start: 0;
        margin-inline-end: 0;
        margin-bottom: 1rem;
    }

    .language-switcher {
        width: 100%; /* Full width */
        justify-content: center; /* Center buttons */
        margin-inline-start: 0;
        margin-inline-end: 0;
        margin-bottom: 1rem;
    }

    .user-profile {
        width: 100%; /* Full width */
        justify-content: center; /* Center profile elements */
        margin-inline-start: 0;
        margin-inline-end: 0;
    }

    .hero-content h1 {
        font-size: 2.5rem; /* Adjusted for smaller screens */
    }

    .hero-content p {
        font-size: 1rem;
    }

    .hero-stats {
        grid-template-columns: 1fr; /* Stack stats vertically */
    }

    .tools-grid, .analytics-grid, .about-content {
        grid-template-columns: 1fr; /* Stack sections vertically */
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }
.mb-4 { margin-bottom: 4rem; }

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mt-4 { margin-top: 4rem; }

/* Login Page Styles */
.login-container {
    background: var(--card-bg);
    padding: 3rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    max-width: 400px;
    margin: 100px auto;
    display: flex; /* Use flexbox */
    flex-direction: column; /* Stack items vertically */
    align-items: center; /* Center items horizontally */
}

.login-container .logo {
    /* Removed margin: 0 auto to rely on parent flexbox centering */
    margin-bottom: 2rem; /* Keep the bottom margin */
}

.login-container h2 {
    margin-bottom: 2rem;
    color: var(--text-color);
}

.input-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
    color: var(--text-color);
}

.input-group input[type="text"],
.input-group input[type="password"] {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
}

.login-container button[type="submit"] {
    width: 100%;
    padding: 1rem;
    background: #9C7F5F;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-container button[type="submit"]:hover {
    background-color: #846223;
}

.error-message {
    color: var(--accent-color);
    margin-top: 1rem;
    font-weight: bold;
}

/* User Profile in Nav */
.user-profile {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-inline-start: 25px;
}

.profile-pic {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #a3a3a3; /* Light blue border */
    box-shadow: 0 0 0 2px rgba(97, 218, 251, 0.2);
    transition: transform 0.3s ease;
}

.profile-pic:hover {
    transform: scale(1.05);
}

/* Dropdown Styles */
.dropdown {
    /* Removed position: relative; to allow dropdown-content to position relative to main-nav */
    display: inline-block;
    z-index: 100; /* Ensure dropdown appears above other content */
}

.dropdown .dropbtn {
    position: relative;
    text-decoration: none;
    color:#1a2b42; /* White links for dark background */
    font-weight: 600;
    font-size: 0.95rem;
    padding-bottom: 5px;
    transition: color 0.3s ease;
    cursor: pointer;
}

.dropdown .dropbtn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%; /* Start from center */
    transform: translateX(-50%); /* Center the underline */
    width: 0; /* Initially no width */
    height: 2px;
    background-color: var(--primary-color); /* Underline color */
    transition: width 0.3s ease; /* Smooth width transition */
}

.dropdown .dropbtn:hover {
    color: #9c7f5f; /* Light blue on hover */
}

.dropdown .dropbtn:hover::after {
    width: 100%; /* Expand to full width on hover */
}

.dropdown-content {
    display: flex; /* Changed to flex by default, hidden by opacity/visibility */
    position: absolute;
    background-color: #ffffff; /* White background */
    box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
    z-index: 1000; /* Increased z-index */
    border-radius: 8px;
    padding: 30px 40px; /* Increased padding for more space */
    top: 100%; /* Position below the nav link */
    left: 3%; /* Align with main-nav padding */
    right: 3%; /* Align with main-nav padding */
    text-align: right; /* Align text to the right for RTL */
    gap: 50px; /* Increased gap between main columns */
    min-width: unset; /* Let left/right define width */
    flex-wrap: wrap; /* Allow wrapping if content is too wide */
    opacity: 0; /* Hidden by default */
    visibility: hidden; /* Hidden by default */
    transition: opacity 0.3s ease, visibility 0.3s ease; /* Transition for smooth appearance */
}

.dropdown-content a {
    color: #555; /* Darker grey for links */
    padding: 5px 0; /* Smaller padding */
    text-decoration: none;
    display: block;
    text-align: right;
    transition: color 0.2s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.dropdown-content a:hover {
    color: #84744f; /* Primary color on hover */
    background-color: transparent; /* No background change on hover */
}

.dropdown-column {
    flex: 1;
    min-width: 200px; /* Minimum width for each column */
    padding: 20px; /* Increased padding for columns */
    border-right: 1px solid #eee; /* Separator between columns */
}

.dropdown-column:last-child {
    border-right: none; /* No border on the last column */
}

.dropdown-heading {
    font-size: 1.5rem; /* Larger font size for headings */
    font-weight: 700;
    color: #344b61; /* Darker color for headings */
    margin-bottom: 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee; /* Underline for headings */
}

.dropdown-description {
    font-size: 0.9rem;
    color: #8c663c;
    margin-bottom: 15px;
    line-height: 1.5;
}

.dropdown-item-title {
    font-weight: 600;
    color: #333;
    margin-top: 10px;
    margin-bottom: 5px;
}

.dropdown-item-desc {
    font-size: 0.85rem;
    color: #777;
    margin-bottom: 10px;
}

.dropdown-view-all {
    color: #84744f !important; /* Primary color for "View all" links */
    font-weight: 600;
    margin-top: 15px;
    display: inline-block; /* To allow margin-top */
}

.dropdown-view-all:hover {
    text-decoration: underline;
}

.dropdown:hover .dropdown-content {
    opacity: 1; /* Show on hover */
    visibility: visible; /* Show on hover */
}

.username-display {
    font-weight: 600;
    color: black;
    font-size: 0.9rem;
}

.logout-button {
    background-color: #9c7f5f; /* Red accent for logout */
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease, transform 0.2s ease;
    font-size: 0.9rem;
}

.logout-button:hover {
    background-color: #c0392b;
    transform: translateY(-2px);
}

/* Settings Icon Styles */
.settings-icon {
    font-size: 1.3rem;
    color: #695c5c; /* White icon for dark background */
    transition: color 0.3s ease, transform 0.2s ease;
}

.settings-icon:hover {
    color: #61dafb; /* Light blue on hover */
    transform: rotate(30deg) scale(1.1);
}

/* Adjust main-nav for user profile */
.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

/* AI Chat Icon */
.ai-chat-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #9C7F5F;
    color: white;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.3s ease, background-color 0.3s ease;
    z-index: 1001;
}

.ai-chat-icon:hover {
    transform: translateY(-5px) scale(1.05);
    background-color: #846223;
}

/* Chat Popup */
.chat-popup {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 350px;
    height: 450px;
    background: var(--card-bg);
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    z-index: 1002;
    transform: scale(0.8);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
}

.chat-popup.show {
    transform: scale(1);
    opacity: 1;
    visibility: visible;
}

.chat-header {
    background-color: #af913f;
    color: white;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.chat-header h3 {
    margin: 0;
    font-size: 1.2rem;
}

.close-chat {
    background: none;
    border: none;
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.close-chat:hover {
    transform: rotate(90deg);
}

.chat-body {
    flex-grow: 1;
    padding: 1rem;
    overflow-y: auto;
    background-color: #f0f2f5;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-input {
    display: flex;
    padding: 1rem;
    border-top: 1px solid #eee;
    background-color: var(--card-bg);
}

.chat-input input {
    flex-grow: 1;
    padding: 0.8rem;
    border: 1px solid #ddd;
    border-radius: 25px;
    outline: none;
    font-size: 1rem;
    margin-inline-end: 10px;
}

.chat-input button {
    background-color: #af913f;
    color: white;
    border: none;
    border-radius: 50%;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.chat-input button:hover {
    background-color: #846223;
}

.message {
    max-width: 80%;
    padding: 0.7rem 1rem;
    border-radius: 15px;
    word-wrap: break-word;
}

.user-message {
    background-color: #dcf8c6;
    align-self: flex-end;
    border-bottom-right-radius: 5px;
}

.ai-message {
    background-color: #e2e2e2;
    align-self: flex-start;
    border-bottom-left-radius: 5px;
}

/* Case Details Page Styles */
.case-details-main {
    padding: 8rem 5% 4rem; /* Adjust padding for fixed nav */
    max-width: 1200px;
    margin: 0 auto;
}

.case-header-section {
    background: linear-gradient(135deg, #fdefe0, #f5ebe2);
    padding: 2.5rem;
    border-radius: 20px;
    text-align: center;
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.case-header-section h1 {
    font-size: 2.8rem;
    color: #564727;
    margin-bottom: 0.8rem;
}

.case-header-section .case-date {
    font-size: 1.1rem;
    color: #777;
    margin-bottom: 1.5rem;
}

.case-header-section .case-status {
    font-size: 1rem;
    padding: 0.6rem 1.5rem;
    border-radius: 25px;
    display: inline-block;
}

.case-info-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}

/* Specific adjustments for the section containing tables */
.case-details-main > .case-info-section:nth-of-type(2) {
    display: grid; /* Ensure it's a grid container */
    grid-template-columns: repeat(3, 1fr); /* Force three columns */
    gap: 2.5rem; /* Maintain gap between cards */
}

.case-details-main > .case-info-section:nth-of-type(2) .info-card {
    max-width: 100%; /* Ensure cards within this section expand */
    min-width: unset; /* Remove any minimum width that might prevent shrinking */
}

.info-card {
    background: var(--card-bg);
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    border: 1px solid #eee;
    text-align: right; /* RTL support */
}

.info-card h3 {
    font-size: 1.8rem;
    color: #614328;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.info-card p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--text-color);
}

.info-card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.info-card ul li {
    font-size: 1rem;
    color: #555;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
}

.info-card ul li::before {
    content: '\2022'; /* Bullet point */
    color: #ab8563;
    font-weight: bold;
    display: inline-block;
    width: 1em;
    margin-inline-end: 0.5em;
    flex-shrink: 0;
}

.info-card.full-details-card p {
    margin-bottom: 0.8rem;
}

.info-card.full-details-card strong {
    color: #614328;
    min-width: 120px; /* Align labels */
    display: inline-block;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    font-size: 0.95rem;
    /* Removed table-layout: fixed; to allow columns to auto-size based on content */
}

.data-table th, .data-table td {
    border: 1px solid #eee;
    padding: 0.8rem;
    text-align: right; /* RTL support */
    word-wrap: break-word; /* Break long words */
    overflow-wrap: break-word; /* Standard property for word wrapping */
    white-space: normal; /* Ensure text wraps in headers and cells */
    vertical-align: top; /* Align content to the top */
}

.data-table th {
    background-color: #f5f5f5;
    font-weight: 600;
    color: #555;
    white-space: nowrap; /* Prevent header text from wrapping */
    padding: 0.8rem 0.5rem; /* Adjust padding for headers */
}

/* Specific column widths for better layout */
/* Adjusting widths for 'الأطراف المعنية' table */
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(2) .data-table th:nth-child(1),
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(2) .data-table td:nth-child(1) { /* Name column */
    width: 50%;
}
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(2) .data-table th:nth-child(2),
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(2) .data-table td:nth-child(2) { /* ID column */
    width: 50%;
}

/* Adjusting widths for 'المستندات المرفقة' table */
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table th:nth-child(1),
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table td:nth-child(1) { /* Type column */
    width: 20%; /* Increased for better fit */
}
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table th:nth-child(2),
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table td:nth-child(2) { /* Name column */
    width: 30%; /* Adjusted for more space */
}
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table th:nth-child(3),
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table td:nth-child(3) { /* Size column */
    width: 15%; /* Increased for better fit */
}
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table th:nth-child(5),
.case-details-main > .case-info-section:nth-of-type(2) .info-card:nth-of-type(3) .data-table td:nth-child(5) { /* Download column */
    width: 20%;
}

.data-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.data-table a {
    color: #84744f;
    text-decoration: none;
    font-weight: 600;
}

.data-table a:hover {
    text-decoration: underline;
}

.ai-capabilities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.ai-capability-card {
    background-color: #f5f6fa;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 1rem;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.ai-capability-card:hover {
    background-color: #e0e2e6;
    transform: translateY(-3px);
}

.ai-capability-card i {
    font-size: 2rem;
    color: #af913f;
    margin-bottom: 0.5rem;
}

.ai-capability-card span {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #555;
}

.case-actions-section {
    padding: 3rem 0;
    text-align: center;
}

.case-actions-section h2 {
    font-size: 2.2rem;
    color: var(--text-color);
    margin-bottom: 2.5rem;
}

.actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    max-width: 1000px;
    margin: 0 auto;
}

.action-button {
    background-color: #9C7F5F;
    color: white;
    border: none;
    border-radius: 15px;
    padding: 1.5rem 1rem;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    text-align: center;
}

.action-button:hover {
    background-color: #af913f;
    transform: translateY(-5px);
}

.action-button i {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

/* Responsive adjustments for case-details.html */
@media (max-width: 768px) {
    .case-details-main {
        padding: 6rem 3% 2rem;
    }

    .case-header-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }

    .case-header-section h1 {
        font-size: 2rem;
    }

    .case-info-section {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .info-card {
        padding: 1.5rem;
    }

    .info-card h3 {
        font-size: 1.5rem;
    }

    .ai-capabilities-grid {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        gap: 0.8rem;
    }

    .ai-capability-card {
        padding: 0.8rem;
    }

    .ai-capability-card i {
        font-size: 1.5rem;
    }

    .ai-capability-card span {
        font-size: 0.8rem;
    }

    .case-actions-section {
        padding: 2rem 0;
    }

    .case-actions-section h2 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .actions-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }

    .action-button {
        padding: 1rem 0.8rem;
        font-size: 1rem;
    }

    .action-button i {
        font-size: 2rem;
    }
}
