/* src/static/css/style.css */

/* General Styles & Resets */
:root {
    --primary-color: #007bff;
    --primary-color-light: #e6f2ff;
    --secondary-color: #6c757d;
    --light-bg: #f8f9fa;
    --body-bg: #f4f6f9;
    --dark-text: #212529;
    --light-text-on-dark: #bdc3c7;
    --link-text-on-dark: #ecf0f1;
    --border-color: #dee2e6;
    --card-bg: #ffffff;
    --font-family-base: 'Cairo', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --border-radius: 0.3rem;
    --border-radius-lg: 8px;
    --shadow-sm: 0 .125rem .25rem rgba(0, 0, 0, .075);
    --shadow-md: 0 .5rem 1rem rgba(0, 0, 0, .15);
    --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.06);
    --header-height: 70px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    /* Apply border-box universally */
}

body {
    font-family: var(--font-family-base);
    margin: 0;
    background-color: var(--body-bg);
    color: var(--dark-text);
    line-height: 1.7;
    text-align: right;
    /* Default for RTL */
    padding-top: var(--header-height);
}

body.no-scroll {
    overflow: hidden;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

html,
body.site-container {
    height: 100%;
    margin: 0;
    /* تأكد من أن body ليس لديه margin */
}

body.site-container {
    display: flex;
    flex-direction: column;
    padding-top: var(--header-height);
    /* يبقى كما هو للهيدر الثابت */
}

main.site-content {
    flex-grow: 1;
    /* This makes it take available vertical space */
    /* Styles for main content area, should allow full width by default */
    padding: 2rem 1.5rem;
    /* From previous styles */
    max-width: 1200px;
    /* From previous styles - this is good for overall container */
    margin: 0 auto;
    /* From previous styles - for centering the 1200px block */
    width: 100%;
    /* ADD THIS: Ensure it tries to use available width */
    box-sizing: border-box;
    /* ADD THIS: Include padding in width calculation */
    /* هذا هو الجزء الأساسي لجعل المحتوى يدفع الفوتر للأسفل */
    /* باقي استايلات main تبقى كما هي */
}

/* Header & Navigation */
.site-header.sticky-header {
    background-color: #ffffff;
    color: var(--dark-text);
    padding: 0 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    height: var(--header-height);
    transition: box-shadow 0.3s ease;
}

.site-header .header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    /* Vertically center children */
    height: 100%;
}

.logo-container {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    /* Prevent logo container from shrinking */
}

.site-logo {
    height: 40px;
    margin-left: 0.5rem;
    /* For RTL, this is margin-right visually */
}

.site-header h1 a {
    color: var(--dark-text);
    font-size: 1.6rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    /* Prevent title from wrapping if space is tight */
}

/* Main Navigation Container */
.main-navbar {
    display: flex;
    /* This will contain either desktop-nav or nav-toggle */
    align-items: center;
    /* Vertically align its content (the toggle button on mobile) */
    /* No explicit width, let it size to content */
}

/* Desktop Navigation */
.main-navbar .desktop-nav {
    list-style: none;
    padding: 0;
    margin: 0;
    display: none;
    /* Controlled by media query */
    gap: 2rem;
    align-items: center;
}

.main-navbar .desktop-nav a {
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
}

.main-navbar .desktop-nav a:hover,
.main-navbar .desktop-nav a.active-nav-link {
    color: var(--primary-color);
}

.main-navbar .desktop-nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    right: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease-out;
}

.main-navbar .desktop-nav a:hover::after,
.main-navbar .desktop-nav a.active-nav-link::after {
    width: 100%;
    left: 0;
    right: auto;
}

.main-navbar .desktop-nav a,
.main-navbar .desktop-nav .nav-link-with-badge {
    /* Apply to both regular links and badged links */
    color: var(--dark-text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0;
    /* Vertical padding helps with alignment */
    position: relative;
    transition: color 0.2s;
    white-space: nowrap;
    display: flex;
    /* Added for internal alignment of text + badge */
    align-items: center;
    /* Vertically align text and badge */
}


/* Mobile Navigation Toggle (Hamburger) */
.nav-toggle {
    display: flex;
    /* Will be flex by default (mobile-first) */
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    /* Fixed width */
    height: 22px;
    /* Fixed height */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    /* Ensure no padding affects its size */
    z-index: 1010;
    flex-shrink: 0;
    /* Prevent it from shrinking */
    /* No margin needed if parent (.main-navbar) and grandparent (.header-content) align it */
}

.hamburger-icon {
    display: block;
    width: 100%;
    height: 3px;
    background-color: var(--dark-text);
    border-radius: 3px;
    transition: all 0.3s ease-in-out;
}

/* Mobile Sliding Menu */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1005;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease-in-out, visibility 0s 0.3s linear;
}

.mobile-nav-overlay.active {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.mobile-nav-menu {
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    right: 0;
    /* For RTL, edge of screen */
    width: 300px;
    max-width: 80%;
    height: 100%;
    background-color: #ffffff;
    box-shadow: -2px 0 15px rgba(0, 0, 0, 0.15);
    z-index: 1006;
    padding: 1.5rem;
    padding-top: 4rem;
    transform: translateX(100%);
    /* Start completely off-screen (RTL) */
    visibility: hidden;
    transition: transform 0.3s ease-in-out, visibility 0s 0.3s linear;
}

.mobile-nav-menu.active {
    transform: translateX(0);
    /* Slide into view (RTL) */
    visibility: visible;
    transition: transform 0.3s ease-in-out, visibility 0s 0s linear;
}

.close-nav-button {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    /* RTL */
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--secondary-color);
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
}

.close-nav-button:hover {
    color: var(--dark-text);
}

.mobile-nav-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

.mobile-nav-header .mobile-logo {
    height: 35px;
    margin-bottom: 0.5rem;
}

.mobile-nav-header span {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--dark-text);
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.mobile-nav-links a {
    display: block;
    padding: 0.8rem 1rem;
    color: var(--dark-text);
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
}

.mobile-nav-links a:hover,
.mobile-nav-links a.active-nav-link {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
}

/* Main Content Area */
main {
    padding: 2rem 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

.page-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--dark-text);
}


/* Footer */
.site-footer-main {
    flex-shrink: 0;
    background-color: #2c3e50;
    color: var(--light-text-on-dark);
    padding: 2.5rem 1.5rem;
    margin-top: 3rem;
    text-align: center;
}

.footer-content {
    max-width: 1000px;
    margin: 0 auto;
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: var(--link-text-on-dark);
    text-decoration: none;
    font-size: 0.95em;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #ffffff;
    text-decoration: underline;
}

.copyright-text {
    font-size: 0.9em;
    margin: 0;
}

/* Icon Listing Page Controls */
.page-controls-container {
    background-color: var(--card-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    margin-bottom: 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.filter-controls,
.appearance-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: flex-end;
}

.appearance-controls {
    justify-content: flex-start;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.control-group.tabs-group {
    flex-grow: 2;
}

.control-group label {
    font-weight: 600;
    font-size: 0.95em;
    margin-bottom: 0.1rem;
    color: var(--dark-text);
}

input[type="text"],
input[type="color"],
input[type="range"] {
    padding: 0.65rem 0.85rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    font-family: var(--font-family-base);
    font-size: 0.95rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

input[type="text"]:focus,
input[type="color"]:focus,
input[type="range"]:focus {
    border-color: var(--primary-color);
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

input[type="color"] {
    min-height: 42px;
    padding: 0.25rem;
    width: 60px;
}

.slider-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

input[type="range"] {
    flex-grow: 1;
    padding: 0;
}

#icon-size-value,
#detail-icon-size-value {
    font-size: 0.9em;
    color: var(--secondary-color);
    min-width: 40px;
    text-align: left;
}

.tabs {
    display: flex;
    gap: 0.5rem;
}

.tabs .tab-button {
    padding: 0.65rem 1.1rem;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: var(--font-family-base);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.tabs .tab-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tabs .tab-button:hover:not(.active) {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

/* Icon Grid (Index Page) */
.icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.5rem;
}

.icon-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    overflow: hidden;
}

.icon-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.icon-card .icon-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

.icon-preview {
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, transform 0.2s;
}

.icon-preview svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-name {
    font-size: 0.85em;
    color: var(--dark-text);
    word-break: break-word;
    margin: 0;
    font-weight: 400;
}

.no-results-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2rem;
    color: var(--secondary-color);
    font-style: italic;
}

/* Icon Detail Page */
.icon-detail-page-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.icon-main-viewer {
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    min-height: 200px;
}

#detail-icon-preview {
    transition: color 0.2s, width 0.2s, height 0.2s;
}

#detail-icon-preview svg {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.icon-sidebar-controls {
    flex-basis: 320px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.icon-info h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 700;
    font-size: 1.75rem;
}

.icon-info p {
    margin-top: 0;
    font-size: 1rem;
    color: var(--secondary-color);
}

.icon-actions h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-weight: 700;
    font-size: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.icon-actions .control-group {
    margin-bottom: 1rem;
}

.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.button {
    display: inline-block;
    font-weight: 600;
    color: #fff;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
    user-select: none;
    border: 1px solid transparent;
    padding: 0.6rem 1.2rem;
    font-size: 1rem;
    line-height: 1.5;
    border-radius: var(--border-radius);
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    font-family: var(--font-family-base);
}

.button.primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.button.primary:hover {
    background-color: #0069d9;
    border-color: #0062cc;
}

.button.secondary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
}

.button.secondary:hover {
    background-color: #5a6268;
    border-color: #545b62;
}

#svg-code-output {
    width: 100%;
    min-height: 100px;
    padding: 0.75rem;
    margin-top: 1rem;
    font-family: monospace;
    font-size: 0.85em;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    white-space: pre-wrap;
    word-break: break-all;
    direction: ltr;
    text-align: left;
}

#copy-status {
    margin-top: 0.5rem;
    font-size: 0.9em;
    font-weight: bold;
}

#copy-status.success {
    color: #28a745;
}

#copy-status.error {
    color: #dc3545;
}

/* Avatar Page Styles */
.avatar-page-container .page-title {
    font-size: 1.8rem;
}

.page-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.background-selector {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.background-selector .selector-label {
    font-weight: 600;
    font-size: 0.9em;
}

.color-options {
    display: flex;
    gap: 0.5rem;
}

.color-options input[type="radio"] {
    display: none;
}

.color-options label.color-option {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: border-color 0.2s, transform 0.2s;
    display: inline-block;
    box-shadow: var(--shadow-sm);
}

.color-options label.color-option:hover {
    transform: scale(1.1);
}

.color-options input[type="radio"]:checked+label.color-option {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px var(--primary-color);
}

.color-options label.color-option.transparent,
.avatar-preview-transparent,
.avatar-preview-colored.checkerboard-bg {
    background-image: repeating-linear-gradient(45deg, #ccc 25%, transparent 25%, transparent 75%, #ccc 75%, #ccc), repeating-linear-gradient(45deg, #ccc 25%, #fff 25%, #fff 75%, #ccc 75%, #ccc);
    background-position: 0 0, 5px 5px;
    background-size: 10px 10px;
}

.avatar-preview-transparent,
.avatar-preview-colored.checkerboard-bg {
    background-position: 0 0, 8px 8px;
    background-size: 16px 16px;
}

.avatar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.avatar-item {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.avatar-pair {
    display: flex;
    gap: 1rem;
    justify-content: space-around;
}

.avatar-preview-wrapper {
    text-align: center;
}

.preview-label {
    display: block;
    font-size: 0.8em;
    color: var(--secondary-color);
    margin-bottom: 0.5rem;
}

.avatar-preview {
    width: 110px;
    height: 110px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

.avatar-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.avatar-info {
    text-align: center;
}

.avatar-attribution {
    font-size: 0.85em;
    color: var(--secondary-color);
    margin-bottom: 0.75rem;
}

.avatar-attribution a {
    color: var(--primary-color);
    font-weight: bold;
}

.avatar-downloads {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
}

.avatar-downloads .button {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

/* Responsiveness */
@media (min-width: 992px) {

    /* Larger screens - Desktop Nav */
    .main-navbar .desktop-nav {
        display: flex;
    }

    .nav-toggle {
        display: none !important;
        /* Ensure it's hidden */
    }

    .mobile-nav-menu,
    .mobile-nav-overlay {
        display: none !important;
        visibility: hidden !important;
    }
}

/* From 991px down, .nav-toggle is 'flex' by default, .desktop-nav is 'none' */

@media (min-width: 768px) {

    /* Medium devices (tablets) */
    .page-controls-container {
        flex-direction: row;
        align-items: flex-end;
    }

    .filter-controls {
        flex-grow: 1;
    }

    .appearance-controls {
        flex-shrink: 0;
        justify-content: flex-end;
    }

    .icon-detail-page-container {
        flex-direction: row;
    }

    .icon-main-viewer {
        min-height: 300px;
    }

    .action-buttons {
        flex-direction: row;
        flex-wrap: wrap;
    }
}

@media (max-width: 991px) {

    /* Tablet and Mobile specific for Hamburger animation */
    .nav-toggle[aria-expanded="true"] .hamburger-icon:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
        /* For RTL, X might need to be negative if pivot is off */
    }

    .nav-toggle[aria-expanded="true"] .hamburger-icon:nth-child(2) {
        opacity: 0;
    }

    .nav-toggle[aria-expanded="true"] .hamburger-icon:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
        /* For RTL, X might need to be negative */
    }
}

@media (max-width: 768px) {

    /* Smaller Tablets and below */
    .page-header-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 576px) {

    /* Small devices (phones) */
    body {
        padding-top: 60px;
    }

    .site-header.sticky-header {
        height: 60px;
        padding: 0 1rem;
        /* Give a bit more side padding */
    }

    .site-header h1 a {
        font-size: 1.3rem;
        margin-right: auto;
        /* Push title to the start, making space for nav toggle at the end */
    }


    .icon-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 1rem;
    }

    .page-controls-container .control-group {
        width: 100%;
    }

    .tabs .tab-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.85rem;
    }

    .page-controls-container,
    .icon-detail-page-container {
        padding: 1rem;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .avatar-grid {
        grid-template-columns: 1fr;
    }

    .avatar-pair {
        flex-direction: column;
        align-items: center;
    }

    .avatar-preview {
        width: 100px;
        height: 100px;
    }
}

/* ... (Keep all existing CSS from the previous complete version) ... */

/* Navigation Badge Styles */
.nav-link-with-badge {
    position: relative;
    /* Necessary for absolute child */
    display: inline-flex;
    align-items: center;
    /* Add padding on the side where the badge will sit to make space for it */
    /* For RTL, badge is on the left of text */
    padding-left: 15px;
}

.badge.featured-badge {
    position: absolute;
    /* Absolute positioning */
    background-color: #e74c3c;
    color: white;
    padding: 2px 6px;
    font-size: 0.65em;
    font-weight: 700;
    border-radius: 8px;
    line-height: 1.2;
    white-space: nowrap;
    z-index: 1;

    /* Positioning for RTL: Top-Left of the <a> tag's padded area */
    top: -5px;
    /* Adjust to position vertically (negative lifts it up) */
    left: -8px;
    /* Adjust to position horizontally (negative moves it left into padding/overlap) */
    /* This 'left' is relative to the padding edge of .nav-link-with-badge */

    transform: rotate(-5deg);
    /* Keep the rotation */
}

.mobile-nav-links .nav-link-with-badge {
    /* Ensure parent <a> still has relative positioning if not inherited */
    position: relative;
    padding-left: 18px;
    /* Might need slightly more padding on mobile */
}

.mobile-nav-links .nav-link-with-badge .badge.featured-badge {
    top: -6px;
    /* Mobile specific vertical */
    left: -10px;
    /* Mobile specific horizontal */
    font-size: 0.6em;
    transform: rotate(-5deg);
}

.badge.featured-badge.mobile-badge {
    top: 50%;
    left: -5px;
    /* Adjust for mobile list item context */
    transform: translateY(-50%) rotate(-5deg);
    font-size: 0.6em;
}


/* Illustrations Page Specific Styles */
.illustrations-page-container .page-title {
    margin-bottom: 1.5rem;
}

.page-section-header {
    margin-bottom: 1.5rem;
    /* Add styling if you have more elements in this header */
}

.tabs-container.illustrations-tabs {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
    /* Center tabs */
    flex-wrap: wrap;
    gap: 0.75rem;
    /* Added gap between tab buttons */
}

.illustrations-tabs .tab-button {
    /* Add selector for illustration tabs */
    padding: 0.65rem 1.1rem;
    background-color: var(--light-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: var(--font-family-base);
    font-size: 0.95rem;
    font-weight: 600;
    transition: background-color 0.2s, border-color 0.2s, color 0.2s;
    /* ... other styles like :hover, .active ... */
}

.tabs .tab-button.active,
.illustrations-tabs .tab-button.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.tabs .tab-button:hover:not(.active),
.illustrations-tabs .tab-button:hover:not(.active) {
    background-color: #e2e6ea;
    border-color: #dae0e5;
}

/* Re-use .tabs .tab-button from icon listing page or define separately if different */
/* If reusing, they will inherit the styles */

.illustration-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    /* Adjust minmax for desired card size */
    gap: 1.5rem;
    /* Or var(--grid-gap) if you define one */
}

.illustration-card {
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
    display: flex;
    /* Use flex for card layout */
    flex-direction: column;
}

.illustration-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.illustration-card .illustration-link {
    text-decoration: none;
    color: var(--dark-text);
    display: flex;
    flex-direction: column;
    height: 100%;
    /* Make link fill card */
}

.illustration-preview {
    width: 100%;
    padding-top: 75%;
    /* Aspect ratio for preview (e.g., 4:3). Adjust as needed. */
    position: relative;
    background-color: #f0f0f0;
    /* Fallback bg for preview area */
    overflow: hidden;
    /* Clip image */
}

.illustration-preview img,
.illustration-preview .placeholder-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    /* Or 'contain' if you prefer */
}

.illustration-preview .placeholder-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 0.9em;
}

.illustration-card .illustration-name {
    font-size: 1.1em;
    font-weight: 600;
    margin: 0.75rem 1rem 0.25rem;
    line-height: 1.3;
}

.illustration-card .illustration-category-label {
    font-size: 0.8em;
    color: var(--secondary-color);
    margin: 0 1rem 0.75rem;
}

/* Illustration Detail Page */
.illustration-detail-page {
    background-color: var(--card-bg);
    padding: 2rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.illustration-detail-page .detail-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.illustration-detail-page .detail-header h1 {
    font-size: 2.2rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.illustration-detail-page .category-tag {
    font-size: 0.9em;
    color: var(--secondary-color);
    background-color: var(--light-bg);
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius);
    display: inline-block;
}

.detail-preview-area {
    margin-bottom: 2.5rem;
    text-align: center;
    /* Center the preview */
    background-color: #f9f9f9;
    /* Light bg for preview area */
    padding: 1rem;
    border-radius: var(--border-radius);
}

.main-illustration-preview {
    max-width: 100%;
    max-height: 60vh;
    /* Limit height of preview */
    height: auto;
    display: block;
    /* For centering with margin auto if needed */
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.placeholder-preview.large {
    min-height: 200px;
    /* Ensure placeholder has some size */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1em;
    color: var(--secondary-color);
    border: 1px dashed var(--border-color);
    border-radius: var(--border-radius);
}


.detail-actions h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
}

.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.download-button.svg-button {
    background-color: #2ecc71;
    border-color: #2ecc71;
}

/* Greenish */
.download-button.svg-button:hover {
    background-color: #27ae60;
    border-color: #27ae60;
}

.download-button.png-button {
    background-color: #3498db;
    border-color: #3498db;
}

/* Blueish */
.download-button.png-button:hover {
    background-color: #2980b9;
    border-color: #2980b9;
}

.download-button.psd-button {
    background-color: #9b59b6;
    border-color: #9b59b6;
}

/* Purplish */
.download-button.psd-button:hover {
    background-color: #8e44ad;
    border-color: #8e44ad;
}


@media (max-width: 768px) {
    .illustration-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .badge.featured-badge {
        /* Ensure it doesn't cause overflow on very small nav items */
        left: -10px;
        font-size: 0.6em;
    }
}

@media (max-width: 576px) {
    .illustration-grid {
        grid-template-columns: 1fr;
        /* Single column on very small screens */
    }

    .illustration-detail-page .detail-header h1 {
        font-size: 1.8rem;
    }
}

/* Styles for generic text content pages like contact, privacy, about */
.page-container.text-content-page {
    max-width: 800px;
    /* Limit width for better readability */
    margin: 2rem auto;
    /* Center content with some top/bottom margin */
    padding: 2rem;
    background-color: var(--card-bg);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-sm);
}

.text-content-page .page-section-header {
    text-align: center;
    margin-bottom: 2rem;
}

.text-content-page .page-title {
    /* Overrides general .page-title if needed for centering */
    font-size: 2.2rem;
    /* Larger title for static pages */
}

.text-content-page .content-section p {
    line-height: 1.8;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    /* Slightly larger font for readability */
    color: #444;
    /* Softer black for text */
}

.text-content-page .content-section h2 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border-color);
}

.contact-info-box {
    background-color: var(--light-bg);
    padding: 1.5rem;
    border-radius: var(--border-radius);
    margin: 2rem 0;
    border-left: 4px solid var(--primary-color);
    /* RTL: border-right */
}

.contact-info-box h2 {
    margin-top: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.email-address {
    font-size: 1.2rem;
    font-weight: 600;
    word-break: break-all;
    /* Ensure long email doesn't break layout */
}

.email-address a {
    color: var(--primary-color);
}

.hero-section {
    background-color: var(--card-bg);
    /* لون خلفية فاتح ومريح */
    /* يمكنك إضافة صورة خلفية أو تدرج لوني هنا إذا أردت */
    /* background-image: linear-gradient(to bottom right, var(--primary-color-light), #f0f2f5); */
    padding: 4rem 1.5rem;
    /* مساحة داخلية واسعة */
    text-align: center;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 2.5rem;
    /* مسافة قبل قسم الفلاتر */
}

.hero-content {
    max-width: 800px;
    /* تحديد عرض المحتوى لسهولة القراءة */
    margin: 0 auto;
    /* توسيط المحتوى */
}

.hero-title {
    font-size: 2.8rem;
    /* حجم خط كبير للعنوان الرئيسي */
    font-weight: 700;
    color: var(--dark-text);
    margin-top: 0;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.15rem;
    /* حجم خط مناسب للنص الفرعي */
    color: var(--secondary-color);
    /* لون أغمق قليلاً من النص العادي */
    line-height: 1.7;
    margin-bottom: 2rem;
    max-width: 700px;
    /* تحديد عرض النص الفرعي لتركيز أفضل */
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle strong {
    color: var(--primary-color);
    /* إبراز الكلمات المفتاحية بلون مميز */
    font-weight: 600;
}

.hero-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    /* مسافة بين الأزرار */
    flex-wrap: wrap;
    /* للسماح بالتفاف الأزرار على الشاشات الصغيرة */
}

.hero-button {
    padding: 0.8rem 2rem;
    /* حجم أكبر لأزرار الـ Hero */
    font-size: 1.05rem;
    font-weight: 600;
    text-transform: uppercase;
    /* اختياري، لجعل النص أكبر */
    letter-spacing: 0.5px;
    /* اختياري، لتباعد الأحرف قليلاً */
    border-radius: var(--border-radius);
    /* يمكن استخدام نصف قطر أكبر قليلاً */
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s ease-out, box-shadow 0.2s ease-out;
}

.hero-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
    /* إزالة الخط السفلي عند المرور */
}

.hero-button.secondary {
    /* تستخدم نفس استايلات .button.secondary الحالية، أو يمكنك تخصيصها */
    background-color: var(--card-bg);
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.hero-button.secondary:hover {
    background-color: var(--primary-color-light);
    color: var(--primary-color);
    border-color: var(--primary-color);
}


/* Media Queries for Hero Section Responsiveness */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 1rem;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.8rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .hero-actions {
        flex-direction: column;
        /* جعل الأزرار تحت بعضها على الشاشات الصغيرة جدًا */
        align-items: center;
        gap: 0.75rem;
    }

    .hero-button {
        width: 100%;
        /* جعل الأزرار بعرض كامل */
        max-width: 280px;
        /* مع تحديد أقصى عرض لها */
    }
}

/* ===== Family Sites Section ===== */
.family-sites-section {
    /*background-color: #f0f2f5;  لون خلفية فاتح ومختلف قليلاً عن باقي الصفحة */
    /*padding: 3rem 1.5rem;  مساحة جيدة حول القسم */
    /*  margin-top: 3rem; مسافة من المحتوى الأعلى */
    margin-bottom: 3rem;
    /*مسافة من المحتوى الأعلى */
    /* border-top: 1px solid var(--border-color, #dee2e6);*/
}

.family-sites-section .container {
    /* افترض أن لديك كلاس .container لتوسيط المحتوى */
    max-width: 1100px;
    /* أو العرض المناسب لموقعك */
    margin: 0 auto;
}

.family-sites-title {
    text-align: center;
    font-size: 2rem;
    /* حجم خط جذاب للعنوان */
    font-weight: 700;
    color: var(--dark-text, #212529);
    margin-bottom: 2.5rem;
    /* مسافة قبل شبكة البطاقات */
    position: relative;
}

/* خط زخرفي تحت العنوان (اختياري) */
.family-sites-title::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: var(--primary-color, #007bff);
    margin: 0.5rem auto 0;
    border-radius: 2px;
}

.family-sites-grid {
    display: grid;
    /* استخدم أعمدة أقل على الشاشات الأصغر، وأكثر على الأكبر */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    /* بطاقات متجاوبة */
    gap: 2rem;
    /* مسافة بين البطاقات */
}

.family-site-card {
    display: flex;
    /* استخدام flex لتنسيق الشعار بجانب النص */
    align-items: center;
    /* توسيط العناصر عمودياً */
    background-color: var(--card-bg, #ffffff);
    border-radius: var(--border-radius-lg, 8px);
    padding: 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: var(--dark-text, #212529);
    transition: transform 0.25s ease-out, box-shadow 0.25s ease-out;
    overflow: hidden;
    /* لمنع أي تجاوزات من العناصر الداخلية */
}

.family-site-card:hover {
    transform: translateY(-6px) scale(1.02);
    /* تأثير رفع وتكبير طفيف */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    text-decoration: none;
    /* تأكيد إزالة الخط السفلي */
}

.family-site-logo-wrapper {
    flex-shrink: 0;
    /* يمنع الشعار من التقلص */
    width: 70px;
    /* عرض ثابت لحاوية الشعار */
    height: 70px;
    margin-left: 1.5rem;
    /* مسافة بين الشعار والنص (لـ RTL) */
    /* لـ LTR: margin-right: 1.5rem; */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    /* خلفية فاتحة للشعار إذا كان شفافًا */
    border-radius: 50%;
    /* جعل حاوية الشعار دائرية */
    overflow: hidden;
}

.family-site-logo {
    max-width: 80%;
    /* اجعل الشعار أصغر قليلاً من الحاوية الدائرية */
    max-height: 80%;
    height: auto;
    object-fit: contain;
}

.family-site-logo.placeholder-logo {
    opacity: 0.5;
    /* إذا كان شعارًا مؤقتًا */
}

.family-site-info {
    flex-grow: 1;
    /* لجعل النص يأخذ المساحة المتبقية */
    text-align: right;
    /* RTL */
    /* لـ LTR: text-align: left; */
}

.family-site-name {
    font-size: 1.25rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 0.3rem;
    display: flex;
    /* لتنسيق الشارة بجانب الاسم */
    align-items: center;
    /* توسيط الشارة مع الاسم */
    gap: 0.5rem;
    /* مسافة بين الاسم والشارة */
}

/* Site Badge Styles (داخل البطاقة) */
.site-badge {
    display: inline-block;
    padding: 3px 8px;
    font-size: 0.65rem;
    font-weight: 700;
    border-radius: 10px;
    /* أكثر استدارة */
    color: white;
    line-height: 1.1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.new-badge {
    background-color: #2ecc71;
    /* أخضر */
}

.fonts-badge {
    background-color: #3498db;
    /* أزرق */
}

.icons-badge {
    background-color: #e74c3c;
    /* أحمر (كما استخدمناه في الهيدر) */
}

.soon-badge {
    background-color: #f39c12;
    /* برتقالي */
}

/* يمكنك إضافة المزيد من ألوان الشارات هنا */

.family-site-description {
    font-size: 0.85rem;
    color: var(--secondary-color, #6c757d);
    line-height: 1.5;
    margin-bottom: 0;
    /* يمكنك تحديد ارتفاع ثابت للوصف إذا أردت توحيد ارتفاع البطاقات أكثر */
    /* min-height: 40px; */
}

.coming-soon-card {
    opacity: 0.7;
    /* جعل البطاقات القادمة أقل بروزًا */
    cursor: default;
    /* لا يوجد رابط بعد */
}



.coming-soon-card:hover {
    transform: none;
    /* إزالة تأثير الـ hover للبطاقات غير النشطة */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    /* الظل الافتراضي */
}


/* Responsive Adjustments for Family Sites Grid */
@media (max-width: 768px) {
    .family-sites-grid {
        grid-template-columns: 1fr;
        /* عمود واحد على الشاشات الأصغر */
    }

    .family-site-card {
        padding: 1.25rem;
    }

    .family-site-logo-wrapper {
        width: 60px;
        height: 60px;
        margin-left: 1rem;
        /* RTL */
    }

    .family-site-name {
        font-size: 1.1rem;
    }
}