:root {
    --primary-blue: #1a3a8f;
    --primary-red: #e63946;
    --primary-white: #ffffff;
    --light-blue: #457b9d;
    --light-gray: #f8f9fa;
    --dark-gray: #333333;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-gray);
    color: var(--dark-gray);
    line-height: 1.6;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styles */
header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #0d2b6c 100%);
    color: var(--primary-white);
    padding: 15px 0;
    position: relative;
    overflow: hidden;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.logo-img {
    background-color: var(--primary-white);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
    overflow: hidden;
    border: 3px solid var(--primary-red);
    position: relative;
}

.logo-image {
    width: 80%;
    height: 80%;
    object-fit: contain;
    transition: var(--transition);
}

.logo-text h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--primary-white);
}

.logo-text .tagline {
    font-size: 13px;
    opacity: 0.9;
    font-style: italic;
    unicode-bidi: plaintext;
    color: var(--primary-white);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 6px;
    background: rgba(255, 255, 255, 0.9);
    padding: 5px;
    border-radius: 30px;
    box-shadow: var(--shadow);
    border: 2px solid var(--primary-blue);
    margin-left: auto;
}

.lang-btn {
    padding: 5px 10px;
    border: none;
    border-radius: 20px;
    background: transparent;
    color: var(--primary-blue);
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: var(--transition);
    font-size: 13px;
}

.lang-btn.active {
    background-color: var(--primary-blue);
    color: white;
}

.lang-btn:hover:not(.active) {
    background-color: rgba(26, 58, 143, 0.1);
}

.lang-btn .fi {
    font-size: 13px;
}

.lang-text {
    white-space: nowrap;
}

/* Hero Section */
.hero {
    padding: 60px 0;
    background: linear-gradient(to bottom, var(--primary-blue) 0%, #0d2b6c 100%);
    color: var(--primary-white);
    text-align: center;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.03' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 700px;
    margin: 0 auto;
}

.hero h2 {
    font-size: 36px;
    margin-bottom: 15px;
    font-weight: 700;
}

.hero p {
    font-size: 18px;
    margin-bottom: 20px;
    opacity: 0.9;
}

.highlight {
    color: var(--primary-red);
    font-weight: bold;
}

/* Cards Section */
.cards-section {
    padding: 60px 0;
    background-color: var(--light-gray);
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
}

.section-title h2 {
    font-size: 32px;
    color: var(--primary-blue);
    margin-bottom: 12px;
    position: relative;
    display: inline-block;
}

.section-title h2::after {
    content: '';
    position: absolute;
    width: 70%;
    height: 4px;
    background-color: var(--primary-red);
    bottom: -8px;
    left: 15%;
    border-radius: 2px;
}

.section-title p {
    font-size: 16px;
    color: var(--dark-gray);
    max-width: 500px;
    margin: 0 auto;
}

/* Cards Container */
.cards-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin: 0 auto;
}

/* Card Styles */
.card {
    background-color: var(--primary-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-width: 0;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.15);
}

/* Card Header */
.card-header {
    height: 130px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* ألوان خلفية الكروت */
.card-1 .card-header {
    background: linear-gradient(135deg, var(--primary-blue) 0%, #2a4a9f 100%);
}

.card-2 .card-header {
    background: linear-gradient(135deg, var(--primary-red) 0%, #ff5252 100%);
}

.card-3 .card-header {
    background: linear-gradient(135deg, #2a9d8f 0%, #21867a 100%);
}

.card-4 .card-header {
    background: linear-gradient(135deg, #f39c12 0%, #e67e22 100%);
}

/* Image Container */
.image-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Card Images */
.card-image {
    width: 85px;
    height: 85px;
    object-fit: contain;
    transition: var(--transition);
    z-index: 1;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.2));
}

.card:hover .card-image {
    transform: scale(1.08);
}

/* Text Overlay */
.image-text-overlay {
    position: absolute;
    background-color: rgba(26, 58, 143, 0.95);
    color: white;
    padding: 5px 12px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 2;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--primary-red);
}

.card-header .image-container:hover .image-text-overlay {
    opacity: 1;
    visibility: visible;
}

/* Dual Text Overlay */
.dual-text-overlay {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 6px;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    z-index: 2;
}

.card-2 .image-container:hover .dual-text-overlay {
    opacity: 1;
    visibility: visible;
}

.text-item {
    background-color: rgba(255, 255, 255, 0.98);
    color: var(--primary-blue);
    padding: 6px 12px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--primary-red);
    min-width: 160px;
}

.text-item:hover {
    background-color: var(--primary-red);
    color: white;
}

.text-item i {
    color: var(--primary-red);
    font-size: 10px;
    transition: var(--transition);
}

.text-item:hover i {
    color: white;
}

/* Arrow visibility */
.en-arrow {
    display: none;
}

.ar-arrow {
    display: inline-block;
}

[dir="ltr"] .en-arrow {
    display: inline-block;
}

[dir="ltr"] .ar-arrow {
    display: none;
}

/* Card Body */
.card-body {
    padding: 15px 12px;
    text-align: center;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-body h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--primary-blue);
    font-weight: 700;
}

.card-body p {
    color: var(--dark-gray);
    margin-bottom: 12px;
    font-size: 12px;
    line-height: 1.4;
    flex: 1;
    word-wrap: break-word;
}

/* إذا كنت تريد الحفاظ على بقية النص كما هو */
.card-4 .card-body p {
    font-size: 20px;
    font-weight: bold;
    background-color: #ffeb3b;  /* خلفية صفراء */
    display: inline-block; 
    color: var(--primary-red);   /* إذا أردت كل النص أحمر */
    /* قم بإزالة background-color من هنا */
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 7px 12px;
    background-color: var(--primary-blue);
    color: var(--primary-white);
    border-radius: 40px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid var(--primary-blue);
    cursor: pointer;
    font-size: 12px;
    min-width: 110px;
    margin: 0 auto;
}

.btn:hover {
    background-color: transparent;
    color: var(--primary-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.btn i {
    font-size: 10px;
}

.btn-red {
    background-color: var(--primary-red);
    border-color: var(--primary-red);
}

.btn-red:hover {
    color: var(--primary-red);
    background-color: transparent;
}

.btn-blue {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}

.btn-blue:hover {
    color: var(--primary-blue);
    background-color: transparent;
}

/* Egypt Buttons */
.egypt-buttons {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 8px 0 0;
}

.egypt-buttons .btn {
    width: 100%;
    margin: 0;
    padding: 6px 10px;
    font-size: 11px;
    min-width: unset;
}

/* Footer */
footer {
    background-color: var(--primary-blue);
    color: var(--primary-white);
    padding: 40px 0 20px;
    margin-top: 40px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 25px;
    align-items: center;
    margin-bottom: 25px;
}

.footer-logo-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-image-container {
    position: relative;
    margin-bottom: 12px;
}

.footer-logo-img {
    width: 60px;
    height: 60px;
    object-fit: contain;
    filter: brightness(0) invert(1);
    transition: var(--transition);
}

.footer-image-container .image-text-overlay {
    background-color: rgba(230, 57, 70, 0.95);
    font-size: 10px;
    padding: 4px 8px;
    min-width: 100px;
}

.footer-image-container:hover .image-text-overlay {
    opacity: 1;
    visibility: visible;
    transform: translateY(30px);
}

.footer-logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--primary-white);
}

.footer-logo span {
    color: var(--primary-red);
}

.footer-contact {
    text-align: center;
}

.footer-contact p {
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 13px;
}

.footer-contact i {
    color: var(--primary-red);
    width: 16px;
}

.social-icons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--primary-white);
    transition: var(--transition);
    font-size: 14px;
}

.social-icons a:hover {
    background-color: var(--primary-red);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    padding-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 12px;
    opacity: 0.8;
}

/* Animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeInUp 0.6s ease forwards;
}

/* RTL/LTR Specific */
[dir="rtl"] .language-switcher {
    margin-left: auto;
    margin-right: 0;
}

[dir="rtl"] .card-header .image-container:hover .image-text-overlay {
    right: 90px;
    left: auto;
}

[dir="ltr"] .card-header .image-container:hover .image-text-overlay {
    left: 90px;
    right: auto;
}

[dir="rtl"] .card-2 .image-container:hover .dual-text-overlay {
    right: 15px;
    left: auto;
}

[dir="ltr"] .card-2 .image-container:hover .dual-text-overlay {
    left: 15px;
    right: auto;
}

/* Responsive Design */
@media screen and (max-width: 1000px) {
    .cards-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
        max-width: 700px;
        margin: 0 auto;
    }
    
    .container {
        max-width: 900px;
    }
    
    .hero h2 {
        font-size: 32px;
    }
}

@media screen and (max-width: 768px) {
    .container {
        max-width: 540px;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        flex-direction: column;
        text-align: center;
    }
    
    .language-switcher {
        margin: 10px auto;
    }
    
    .cards-container {
        grid-template-columns: 1fr;
        gap: 20px;
        max-width: 400px;
    }
    
    .card-header {
        height: 120px;
    }
    
    .card-image {
        width: 75px;
        height: 75px;
    }
    
    .hero {
        padding: 50px 0;
    }
    
    .hero h2 {
        font-size: 28px;
    }
    
    .hero p {
        font-size: 16px;
    }
    
    .cards-section {
        padding: 50px 0;
    }
    
    .section-title h2 {
        font-size: 28px;
    }
    
    .lang-text {
        display: none;
    }
    
    .lang-btn {
        padding: 6px;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

@media screen and (max-width: 480px) {
    .hero h2 {
        font-size: 24px;
    }
    
    .hero p {
        font-size: 14px;
    }
    
    .card-header {
        height: 110px;
    }
    
    .card-image {
        width: 70px;
        height: 70px;
    }
    
    .card-body h3 {
        font-size: 16px;
    }
    
    .card-body p {
        font-size: 11px;
    }
    
    .btn {
        padding: 6px 10px;
        font-size: 11px;
        min-width: 100px;
    }
    
    .text-item {
        min-width: 140px;
        padding: 5px 10px;
        font-size: 11px;
    }
}