 :root {
      --primary: #2B4A6F;    /* أزرق داكن */
      --secondary: #5B8FB9;  /* أزرق متوسط */
      --accent: #FF7F50;     /* برتقالي مرجاني */
      --light: #F5F7FA;      /* رمادي فاتح */
      --dark: #1A2A3A;       /* أزرق فحمي */
    }

    * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
      font-family: 'Tajawal', sans-serif;
    }

    body {
      background: #f8f9fa;
      overflow-x: hidden;
    }

    .header {
      background: var(--primary);
      padding: 1rem;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
      position: sticky;
      top: 0;
      z-index: 100;
    }

    .nav-container {
      max-width: 1200px;
      margin: 0 auto;
      display: flex;
      justify-content: space-between;
      align-items: center;
      position: relative;
    }

    .logo {
      color: white;
      font-size: 1.5rem;
      text-decoration: none;
      font-weight: 700;
    }

    .nav-links {
      display: flex;
      gap: 2rem;
    }

    .nav-links a {
      color: white;
      text-decoration: none;
      transition: color 0.3s;
      font-weight: 500;
    }

    .nav-links a:hover {
      color: var(--accent);
    }

    .mobile-menu-btn {
      display: none;
      background: none;
      border: none;
      color: white;
      font-size: 1.5rem;
      cursor: pointer;
    }

    .hero {
      background: linear-gradient(rgba(43,74,111,0.9), rgba(43,74,111,0.9)),
                  url('https://images.unsplash.com/photo-1450101499163-c8848c66ca85');
      background-size: cover;
      background-position: center;
      padding: 4rem 1rem;
      text-align: center;
      color: white;
      min-height: 50vh;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    .hero h1 {
      font-size: 2.5rem;
      margin-bottom: 1rem;
      line-height: 1.3;
    }

    .hero p {
      font-size: 1.2rem;
      margin-bottom: 1.5rem;
      max-width: 700px;
      margin-left: auto;
      margin-right: auto;
    }

    .search-bar {
      max-width: 600px;
      margin: 2rem auto;
      position: relative;
    }

    .search-input {
      width: 100%;
      padding: 1rem;
      border-radius: 30px;
      border: none;
      padding-right: 50px;
      font-size: 1rem;
    }

    .search-button {
      position: absolute;
      right: 15px;
      top: 50%;
      transform: translateY(-50%);
      background: none;
      border: none;
      color: var(--primary);
      cursor: pointer;
      font-size: 1.2rem;
    }

    .filters {
      background: white;
      padding: 1rem;
      box-shadow: 0 2px 5px rgba(0,0,0,0.1);
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }

    .filters::-webkit-scrollbar {
      display: none;
    }

    .filter-buttons {
      max-width: 1200px;
      margin: 0 auto;
      display: flex;
      gap: 1rem;
      flex-wrap: nowrap;
      min-width: min-content;
      padding-bottom: 5px;
    }

    .filter-btn {
      padding: 0.5rem 1rem;
      border-radius: 20px;
      border: 1px solid #ddd;
      background: white;
      cursor: pointer;
      transition: all 0.3s;
      min-width: max-content;
      white-space: nowrap;
    }

    .filter-btn i {
      margin-left: 5px;
    }

    .filter-btn.active {
      background: var(--primary);
      color: white;
      border-color: var(--primary);
    }

    .tests-container {
      max-width: 1200px;
      margin: 2rem auto;
      padding: 0 1rem;
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
      gap: 2rem;
    }

    .test-card {
      background: white;
      border-radius: 10px;
      overflow: hidden;
      box-shadow: 0 3px 10px rgba(0,0,0,0.1);
      transition: transform 0.3s, box-shadow 0.3s;
      border: 1px solid rgba(43,74,111,0.1);
      display: block;
      text-decoration: none;
    }

    .test-card:hover {
      transform: translateY(-5px);
      box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    }

    .test-image {
      height: 200px;
      background-size: cover;
      background-position: center;
    }

    .test-content {
      padding: 1.5rem;
    }

    .test-category {
      color: var(--secondary);
      font-size: 0.9rem;
      margin-bottom: 0.5rem;
      font-weight: 700;
    }

    .test-title {
      color: var(--dark);
      margin-bottom: 1rem;
      min-height: 60px;
      line-height: 1.4;
      font-size: 1.25rem;
    }

    .test-meta {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 1rem;
    }

    .test-rating {
      color: #f1c40f;
      font-weight: 500;
    }

    .test-duration {
      background: var(--light);
      padding: 0.3rem 0.8rem;
      border-radius: 15px;
      font-size: 0.9rem;
      color: var(--dark);
    }

    footer {
      background: var(--dark);
      color: white;
      padding: 3rem 1rem;
      margin-top: 4rem;
    }

    .footer-content {
      max-width: 1200px;
      margin: 0 auto;
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
      gap: 2rem;
    }

    .footer-section h4 {
      margin-bottom: 1rem;
      color: var(--accent);
      font-size: 1.3rem;
    }

    .footer-section p {
      opacity: 0.8;
      line-height: 1.6;
    }

    .footer-links {
      list-style: none;
    }

    .footer-links li {
      margin-bottom: 0.8rem;
    }

    .footer-links a {
      color: white;
      text-decoration: none;
      opacity: 0.8;
      transition: opacity 0.3s;
      display: block;
      padding: 0.2rem 0;
    }

    .footer-links a:hover {
      opacity: 1;
      color: var(--accent);
    }

    .social-links {
      display: flex;
      gap: 1rem;
      margin-top: 1rem;
    }

    .social-links a {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 40px;
      height: 40px;
      background: rgba(255,255,255,0.1);
      border-radius: 50%;
      color: white;
      font-size: 1.2rem;
      transition: all 0.3s;
    }

    .social-links a:hover {
      background: var(--accent);
      transform: translateY(-3px);
    }

    .copyright {
      max-width: 1200px;
      margin: 2rem auto 0;
      padding-top: 1.5rem;
      border-top: 1px solid rgba(255,255,255,0.1);
      text-align: center;
      opacity: 0.7;
      font-size: 0.9rem;
    }

    /* تحسينات للشاشات الصغيرة */
    @media (max-width: 1200px) {
      .hero h1 {
        font-size: 2.2rem;
      }
    }

    @media (max-width: 992px) {
      .hero h1 {
        font-size: 2rem;
      }
      
      .test-title {
        min-height: 50px;
        font-size: 1.1rem;
      }
    }

    @media (max-width: 768px) {
      .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--primary);
        flex-direction: column;
        padding: 1rem;
        gap: 1rem;
        display: none;
        box-shadow: 0 5px 10px rgba(0,0,0,0.2);
      }
      
      .nav-links.show {
        display: flex;
      }
      
      .mobile-menu-btn {
        display: block;
      }
      
      .tests-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
      }
      
      .hero {
        padding: 3rem 1rem;
      }
      
      .hero h1 {
        font-size: 1.8rem;
      }
      
      .hero p {
        font-size: 1rem;
      }
      
      .footer-content {
        grid-template-columns: 1fr;
        gap: 2.5rem;
      }
      
      .test-image {
        height: 180px;
      }
    }

    @media (max-width: 576px) {
      .hero {
        padding: 2.5rem 1rem;
      }
      
      .hero h1 {
        font-size: 1.5rem;
      }
      
      .filter-buttons {
        gap: 0.7rem;
      }
      
      .filter-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.9rem;
      }
      
      .test-title {
        min-height: auto;
      }
      
      .test-image {
        height: 160px;
      }
    }

    @media (max-width: 480px) {
      .hero h1 {
        font-size: 1.4rem;
      }
      
      .logo {
        font-size: 1.3rem;
      }
      
      .search-input {
        padding: 0.8rem;
        font-size: 0.9rem;
      }
      
      .search-button {
        font-size: 1rem;
      }
      
      .test-card {
        border-radius: 8px;
      }
    }

    @media (max-width: 360px) {
      .hero h1 {
        font-size: 1.3rem;
      }
      
      .hero p {
        font-size: 0.9rem;
      }
      
      .filter-btn {
        padding: 0.35rem 0.7rem;
        font-size: 0.85rem;
      }
    }

    /* تحسينات للوضع الأفقي في الجوال */
    @media (max-height: 500px) and (orientation: landscape) {
      .hero {
        padding: 2rem 1rem;
        min-height: 40vh;
      }
      
      .hero h1 {
        font-size: 1.5rem;
        margin-bottom: 0.8rem;
      }
      
      .hero p {
        margin-bottom: 1rem;
      }
      
      .search-bar {
        margin: 1.5rem auto;
      }
    }