/* ============================================
   أوشن الطبية - الملف الرئيسي للتصميم (الكامل)
   Ocean Medical - Main Stylesheet
   شامل سطح المكتب، التابلت، الموبايل
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@300;400;500;600;700;800&display=swap');

/* ============================================
   إعدادات عامة (Reset)
   ============================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
  color: #1e293b;
  line-height: 1.6;
}

/* لوجو أوشن كخلفية مائية */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('../images/ocean_logo-removebg-preview.png');
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 400px;
  opacity: 0.05;
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  position: relative;
  z-index: 1;
}

/* ============================================
   الهيدر (الشريط العلوي الثابت)
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: #185ba8;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.logo-area {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  height: 50px;
  width: auto;
}

.logo-text {
  color: white;
  font-size: 1.3rem;
  font-weight: 700;
}

.nav {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}

.nav a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
}

.nav a:hover {
  color: #60a5fa;
}

/* ============================================
   قائمة اختيار اللغة (Dropdown)
   ============================================ */
.language-selector {
  position: relative;
  display: inline-block;
}

.selected-lang {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 30px;
  padding: 6px 12px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  color: white;
  font-size: 14px;
  transition: all 0.3s;
}

.selected-lang:hover {
  background: rgba(255,255,255,0.25);
}

.flag-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  object-fit: cover;
}

.arrow {
  font-size: 10px;
  transition: transform 0.3s;
}

.language-selector.open .arrow {
  transform: rotate(180deg);
}

.lang-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border-radius: 12px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
  min-width: 140px;
  margin-top: 8px;
  overflow: hidden;
  display: none;
  z-index: 200;
}

.language-selector.open .lang-dropdown {
  display: block;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  text-decoration: none;
  color: #1e293b;
  transition: background 0.2s;
}

.lang-option:hover {
  background: #f1f5f9;
}

.lang-option .flag-icon {
  width: 20px;
  height: 20px;
}

/* ============================================
   القسم الرئيسي (Hero Section)
   ============================================ */
.hero {
  padding: 60px 24px;
}

.hero-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 48px;
  flex-wrap: wrap;
}

.hero-content {
  flex: 1;
  min-width: 280px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 800;
  color: #002147;
  margin-bottom: 16px;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: #334155;
  margin-bottom: 24px;
}

.hero-image {
  flex: 1;
  min-width: 280px;
  text-align: center;
}

.hero-image img {
  max-width: 100%;
  border-radius: 24px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.company-text {
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 24px;
  background: white;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
  text-align: center;
}

/* ============================================
   قسم "لماذا أوشن؟"
   ============================================ */
.why-ocean {
  padding: 80px 24px;
  background: white;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  font-weight: 700;
  color: #002147;
  margin-bottom: 48px;
}

.cards-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
}

.card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 10px 25px -5px rgba(0,0,0,0.1);
  width: 320px;
  padding: 24px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.3s;
}

.card:hover {
  transform: translateY(-5px);
}

.card-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: #eef2ff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card-icon svg {
  width: 32px;
  height: 32px;
  stroke: #002147;
}

.card h3 {
  font-size: 1.3rem;
  color: #002147;
  margin-bottom: 12px;
}

.card-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease-out;
}

.card.active .card-content {
  max-height: 200px;
  margin-top: 16px;
}

/* ============================================
   السلايدر (قسم كياناتنا في الصفحة الرئيسية)
   ============================================ */
.entities-slider {
    padding: 60px 0;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
}

.slider-wrapper {
    position: relative;
    max-width: 1280px;
    margin: 0 auto;
}

.slider-container {
    overflow-x: auto;
    scroll-behavior: smooth;
    cursor: grab;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
    padding: 20px;
}

.slider-container:active {
    cursor: grabbing;
}

.slider-track {
    display: flex;
    gap: 24px;
    width: max-content;
}

/* بطاقات السلايدر */
.entity-card {
    flex: 0 0 280px;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.3s;
}

.entity-card:hover {
    transform: scale(1.02);
}

.entity-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
    background: #e2e8f0;
}

.entity-card h4 {
    padding: 16px;
    text-align: center;
    color: #002147;
    font-size: 1rem;
}

/* أزرار التنقل */
.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.slider-btn:hover {
    background: #002147;
    color: white;
}

.slider-btn.prev {
    left: 10px;
}

.slider-btn.next {
    right: 10px;
}

/* ============================================
   بطاقات شبكة الكيانات (صفحة entities)
   ============================================ */
.entity-grid-card {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    cursor: pointer;
    transition: transform 0.3s;
}

.entity-grid-card:hover {
    transform: scale(1.02);
}

.entity-grid-card img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.entity-grid-card h4 {
    padding: 16px;
    text-align: center;
    font-size: 1.3rem;
    color: #002147;
}

/* ============================================
   الفوتر (Footer)
   ============================================ */
.footer {
  background: #144c8c;
  color: white;
  padding: 48px 24px 24px;
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.footer-col h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  border-right: 3px solid #0A5C8E;
  padding-right: 12px;
}

.footer-col p, .footer-col a {
  color: #cbd5e1;
  text-decoration: none;
  display: block;
  margin-bottom: 12px;
}

.footer-col a:hover {
  color: white;
}

.social-icons {
  display: flex;
  gap: 16px;
  margin-top: 20px;
  flex-wrap: wrap;
}

.social-icons a {
  width: 40px;
  height: 40px;
  background: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.3s;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.social-icons a:hover {
  background: #0d62c4;
  transform: translateY(-3px);
}

.social-icons img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.map-placeholder {
  margin-top: 16px;
  border-radius: 12px;
  overflow: hidden;
}

.map-placeholder iframe {
  width: 100%;
  height: 180px;
  border: none;
}

.footer-bottom {
  max-width: 1280px;
  margin: 40px auto 0;
  padding-top: 24px;
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============================================
   نافذة منبثقة (Modal)
   ============================================ */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  max-width: 500px;
  width: 90%;
  border-radius: 24px;
  overflow: hidden;
}

.modal-content img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.modal-body {
  padding: 24px;
}

.modal-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.modal-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  font-weight: 600;
}

.modal-btn.call {
  background: #002147;
  color: white;
}

.modal-btn.map {
  background: #e2e8f0;
  color: #002147;
}

/* ============================================
   صفحة "من نحن"
   ============================================ */
.about-hero {
  background: linear-gradient(rgba(0,33,71,0.7), rgba(0,33,71,0.7)), url('../images/ocean_medical_company_panner.jpeg');
  background-size: cover;
  padding: 100px 24px;
  text-align: center;
  color: white;
}

.about-hero h1 {
  font-size: 2.5rem;
}

.values-grid, .vm-container {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 1280px;
  margin: 0 auto;
}

.value-card, .vm-card {
  background: white;
  border-radius: 24px;
  padding: 32px;
  flex: 1;
  min-width: 250px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* ============================================
   صفحة "اتصل بنا" (سطح المكتب)
   ============================================ */
.contact-page {
  padding: 60px 24px;
  max-width: 1280px;
  margin: 0 auto;
}

.contact-grid {
  display: flex;
  gap: 48px;
  flex-wrap: wrap;
}

.contact-form {
  flex: 1;
  background: white;
  padding: 32px;
  border-radius: 24px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 12px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  font-family: inherit;
}

.submit-btn {
  background: #002147;
  color: white;
  padding: 14px 28px;
  border: none;
  border-radius: 30px;
  cursor: pointer;
  width: 100%;
  transition: 0.3s;
}

.submit-btn:hover {
  background: #0A5C8E;
}

.contact-info {
  flex: 1;
}

.info-card {
  background: white;
  padding: 32px;
  border-radius: 24px;
  margin-bottom: 32px;
}

.info-item {
  margin-bottom: 16px;
}

.info-item a {
  color: #334155;
  text-decoration: none;
}

.info-item a:hover {
  color: #002147;
}

.map-card iframe {
  width: 100%;
  height: 280px;
  border: none;
  border-radius: 24px;
}

/* ============================================
   صفحة الكيانات (entities.html) - سطح المكتب
   ============================================ */
#entitiesGrid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    padding: 40px 24px;
    max-width: 1280px;
    margin: 0 auto;
}

#entitiesGrid .entity-grid-card {
    width: calc(25% - 24px);
    min-width: 240px;
}

/* ============================================
   التجاوب مع التابلت (عرض بين 768px و 1024px)
   ============================================ */
@media (min-width: 768px) and (max-width: 1023px) {
    .entity-card {
        flex: 0 0 calc(33.33% - 16px);
    }
    #entitiesGrid .entity-grid-card {
        width: calc(33.33% - 16px);
    }
}

/* ============================================
   التجاوب مع شاشات الموبايل (عرض أقل من 768px)
   ============================================ */
@media (max-width: 768px) {

    /* ---------- الهيدر ---------- */
    .header-inner {
        flex-direction: column;
        align-items: center;
        padding: 12px 16px;
        gap: 12px;
    }

    .logo-area {
        flex-direction: column;
        align-items: center;
        gap: 6px;
    }

    .logo-img {
        height: 50px;
    }

    .logo-text {
        font-size: 1.1rem;
        text-align: center;
    }

    .nav {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
        gap: 12px;
        width: 100%;
    }

    .nav a {
        font-size: 0.85rem;
        white-space: nowrap;
    }

    /* ---------- قائمة اللغة (تظهر تحت الزر) ---------- */
    .language-selector {
        position: relative;
        display: inline-block;
    }

    .selected-lang {
        background: rgba(255, 255, 255, 0.15);
        border-radius: 30px;
        padding: 4px 10px;
        display: inline-flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
    }

    .selected-lang .lang-text {
        display: inline-block;
        font-size: 0.8rem;
    }

    .selected-lang .arrow {
        display: inline-block;
        font-size: 10px;
    }

    .selected-lang .flag-icon {
        width: 22px;
        height: 22px;
    }

    .lang-dropdown {
        position: absolute !important;
        top: 100% !important;
        right: 0 !important;
        left: auto !important;
        transform: none !important;
        width: auto;
        min-width: 100px;
        background: white;
        border-radius: 12px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
        z-index: 9999;
        margin-top: 8px;
        display: none;
    }

    .language-selector.open .lang-dropdown {
        display: block;
    }

    .lang-option {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        padding: 8px 12px;
        text-decoration: none;
        border-bottom: 1px solid #eef2ff;
    }

    .lang-option:last-child {
        border-bottom: none;
    }

    .lang-option .flag-icon {
        width: 28px;
        height: 28px;
        margin: 0;
    }

    /* ---------- الهيرو ---------- */
    .hero {
        padding: 30px 16px;
    }

    .hero-content {
        text-align: center;
    }

    .hero-title {
        font-size: 1.6rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .company-text {
        padding: 16px;
        margin-top: 20px;
    }

    .company-text p {
        font-size: 0.9rem;
    }

    /* ---------- السلايدر (بطاقتين) ---------- */
    .slider-container {
        overflow-x: auto;
        padding: 10px;
    }
    .slider-track {
        display: flex;
        gap: 16px;
        width: max-content;
    }
    .entity-card {
        width: calc(50vw - 30px) !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        min-width: unset;
    }
    .entity-card img {
        width: 100% !important;
        height: 130px !important;
        object-fit: cover !important;
    }

    /* إخفاء أزرار التنقل في الموبايل */
    .slider-btn {
        display: none;
    }

    /* ---------- صفحة الكيانات (عمود واحد - بطاقة كبيرة) ---------- */
    #entitiesGrid {
        display: flex !important;
        flex-direction: column !important;
        align-items: center;
        gap: 24px;
        padding: 20px 16px;
    }
    #entitiesGrid .entity-grid-card {
        width: 100% !important;
        max-width: 350px;
    }
    #entitiesGrid .entity-grid-card img {
        height: 200px;
    }
    #entitiesGrid .entity-grid-card h4 {
        font-size: 1.2rem;
        padding: 14px;
    }

    /* ---------- لماذا أوشن ---------- */
    .why-ocean {
        padding: 40px 16px;
    }

    .section-title {
        font-size: 1.4rem;
        margin-bottom: 30px;
    }

    .cards-grid {
        gap: 20px;
    }

    .card {
        width: 100%;
        max-width: 280px;
        padding: 16px;
    }

    .card-icon {
        width: 50px;
        height: 50px;
    }

    .card-icon svg {
        width: 24px;
        height: 24px;
    }

    .card h3 {
        font-size: 1.1rem;
    }

    /* ---------- الفوتر ---------- */
    .footer {
        padding: 30px 16px 20px;
    }

    .footer-grid {
        gap: 24px;
    }

    .footer-col h4 {
        font-size: 1rem;
    }

    .footer-col p,
    .footer-col a {
        font-size: 0.8rem;
    }

    .social-icons {
        gap: 10px;
    }

    .social-icons a {
        width: 32px;
        height: 32px;
    }

    .social-icons img {
        width: 16px;
        height: 16px;
    }

    .map-placeholder iframe {
        height: 150px;
    }

    /* ---------- من نحن ---------- */
    .about-hero {
        padding: 60px 16px;
    }

    .about-hero h1 {
        font-size: 1.6rem;
    }

    .values-grid,
    .vm-container {
        gap: 20px;
        padding: 0 16px;
    }

    .value-card,
    .vm-card {
        padding: 20px;
    }

    /* ---------- اتصل بنا (تنسيق عمودي) ---------- */
    .contact-page {
        padding: 20px 16px 40px;
    }

    .contact-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 25px !important;
    }

    .contact-form {
        order: 1;
        width: 100% !important;
        padding: 24px 20px;
        border-radius: 24px;
        background: white;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    }

    .contact-info {
        order: 2;
        width: 100% !important;
        display: flex;
        flex-direction: column;
        gap: 25px;
    }

    .info-card {
        padding: 24px 20px;
        margin-bottom: 0;
        border-radius: 24px;
    }

    .map-card {
        border-radius: 24px;
        overflow: hidden;
    }

    .map-card iframe {
        height: 220px;
        border-radius: 0;
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        padding: 12px;
        font-size: 1rem;
    }

    .submit-btn {
        padding: 14px;
        font-size: 1rem;
    }
}