/* 
   فريق عبد الرحمن - تطبيقات المكفوفين
   تصميم CSS متجاوب مع دعم إمكانية الوصول
*/

:root {
  --primary-color: #2c3e50;
  --secondary-color: #3498db;
  --accent-color: #e74c3c;
  --light-color: #ecf0f1;
  --dark-color: #2c3e50;
  --text-color: #333;
  --link-color: #2980b9;
  --success-color: #27ae60;
  --warning-color: #f39c12;
  --font-main: 'Cairo', 'Tajawal', sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-main);
  line-height: 1.6;
  color: var(--text-color);
  background-color: var(--light-color);
  direction: rtl;
}

/* تحسينات إمكانية الوصول */
:focus {
  outline: 3px solid var(--secondary-color);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--accent-color);
  color: white;
  padding: 8px;
  z-index: 100;
  transition: top 0.3s;
}

.skip-link:focus {
  top: 0;
}

/* الهيدر والتنقل */
header {
  background-color: var(--primary-color);
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

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

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

.logo {
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.logo span {
  color: var(--secondary-color);
}

nav ul {
  display: flex;
  list-style: none;
}

nav ul li {
  margin-right: 20px;
}

nav ul li:last-child {
  margin-right: 0;
}

nav ul li a {
  color: white;
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s;
  padding: 5px 10px;
  border-radius: 4px;
}

nav ul li a:hover,
nav ul li a:focus {
  color: var(--secondary-color);
  background-color: rgba(255, 255, 255, 0.1);
}

.mobile-menu-btn {
  display: none;
  background: none;
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
}

/* القسم الرئيسي */
.hero {
  background: linear-gradient(to bottom, var(--primary-color), var(--secondary-color));
  color: white;
  text-align: center;
  padding: 4rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.btn {
  display: inline-block;
  background-color: var(--accent-color);
  color: white;
  padding: 12px 24px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  transition: background-color 0.3s;
}

.btn:hover,
.btn:focus {
  background-color: #c0392b;
}

/* أقسام التطبيقات */
.section {
  padding: 4rem 0;
}

.section-title {
  text-align: center;
  margin-bottom: 3rem;
  color: var(--primary-color);
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 80px;
  height: 4px;
  background-color: var(--secondary-color);
  margin: 0.5rem auto 0;
}

.app-categories {
  margin-bottom: 2rem;
}

.category-tabs {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.category-tab {
  padding: 10px 20px;
  margin: 5px;
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.category-tab:hover,
.category-tab:focus {
  background-color: var(--secondary-color);
  color: white;
}

.category-tab.active {
  background-color: var(--secondary-color);
  color: white;
}

.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

.app-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s, box-shadow 0.3s;
}

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

.app-card-header {
  padding: 1.5rem;
  background-color: var(--primary-color);
  color: white;
}

.app-card-header h3 {
  margin-bottom: 0.5rem;
}

.app-rating {
  display: flex;
  align-items: center;
}

.stars {
  color: var(--warning-color);
  margin-left: 5px;
}

.app-card-body {
  padding: 1.5rem;
}

.app-description {
  margin-bottom: 1rem;
}

.app-features {
  margin-bottom: 1rem;
}

.app-features h4 {
  margin-bottom: 0.5rem;
  color: var(--primary-color);
}

.features-list {
  list-style-position: inside;
  padding-right: 1rem;
}

.app-card-footer {
  padding: 1rem 1.5rem;
  background-color: #f8f9fa;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.app-link {
  display: inline-block;
  padding: 8px 16px;
  background-color: var(--secondary-color);
  color: white;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.3s;
}

.app-link:hover,
.app-link:focus {
  background-color: #2471a3;
}

.app-price {
  font-weight: 600;
  color: var(--success-color);
}

/* قسم التواصل */
.contact-section {
  background-color: var(--primary-color);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.contact-info {
  max-width: 600px;
  margin: 0 auto;
}

.contact-info h2 {
  margin-bottom: 1.5rem;
}

.contact-info p {
  margin-bottom: 1rem;
}

.contact-method {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.contact-method i {
  margin-left: 10px;
  font-size: 1.2rem;
  color: var(--secondary-color);
}

/* الفوتر */
footer {
  background-color: var(--dark-color);
  color: white;
  padding: 2rem 0;
  text-align: center;
}

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

.footer-logo {
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 700;
}

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

.footer-links {
  margin-bottom: 1rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  margin: 0 10px;
  transition: color 0.3s;
}

.footer-links a:hover,
.footer-links a:focus {
  color: var(--secondary-color);
}

.footer-copyright {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* تصميم متجاوب */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: block;
  }

  nav ul {
    display: none;
    position: absolute;
    top: 70px;
    left: 0;
    right: 0;
    background-color: var(--primary-color);
    flex-direction: column;
    padding: 1rem 0;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
  }

  nav ul.show {
    display: flex;
  }

  nav ul li {
    margin-right: 0;
    margin-bottom: 10px;
    text-align: center;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .section-title {
    font-size: 1.5rem;
  }

  .apps-grid {
    grid-template-columns: 1fr;
  }

  .category-tabs {
    flex-direction: column;
  }

  .category-tab {
    width: 100%;
    margin: 5px 0;
  }
}

/* تحسينات إضافية لإمكانية الوصول */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
