:root {
  --primary-color: #0b4d4d;
  --secondary-color: #1c1c1e;
  --accent-color: #ffc107;
  --card-bg: #2c2c2e;
  --video-bg: #0a3a3a;
  --text-color: #ffffff;
  --danger-color: #ff5252;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: 'Cairo', sans-serif;
}

body {
  background-color: var(--secondary-color);
  color: var(--text-color);
  padding-bottom: 60px;
  overflow-x: hidden;
  background-image: radial-gradient(circle at 10% 20%, rgba(11, 77, 77, 0.2) 0%, rgba(28, 28, 30, 0.8) 90%);
}

/* حاوية الاشتراك الإجباري */
#subscription-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.subscription-container {
  background: linear-gradient(135deg, #0b4d4d, #1c1c1e);
  border-radius: 15px;
  padding: 20px;
  width: 90%;
  max-width: 500px;
  text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.7);
  border: 2px solid var(--accent-color);
  position: relative;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0.4); }
  70% { box-shadow: 0 0 0 15px rgba(255, 193, 7, 0); }
  100% { box-shadow: 0 0 0 0 rgba(255, 193, 7, 0); }
}

.subscription-header {
  margin-bottom: 15px;
}

.subscription-header i {
  font-size: 50px;
  color: var(--accent-color);
  margin-bottom: 10px;
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
  40% {transform: translateY(-15px);}
  60% {transform: translateY(-7px);}
}

.subscription-header h2 {
  font-size: 24px;
  margin-bottom: 10px;
  color: var(--accent-color);
  text-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
}

.subscription-content p {
  font-size: 16px;
  line-height: 1.5;
  margin-bottom: 15px;
}

.channel-link {
  display: inline-block;
  background-color: var(--accent-color);
  color: #000;
  padding: 10px 20px;
  border-radius: 30px;
  font-weight: bold;
  text-decoration: none;
  font-size: 16px;
  margin: 10px 0;
  transition: all 0.3s ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
}

.channel-link:hover {
  background-color: #ffd54f;
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
}

.channel-link:after {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  transition: 0.5s;
}

.channel-link:hover:after {
  left: 100%;
}

.channel-link i {
  margin-left: 8px;
}

.telegram-input {
  width: 100%;
  padding: 12px;
  margin: 10px 0;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: rgba(255, 255, 255, 0.1);
  color: white;
  font-size: 16px;
  transition: all 0.3s;
}

.telegram-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 10px rgba(255, 193, 7, 0.5);
  background: rgba(255, 255, 255, 0.15);
}

.telegram-input::placeholder {
  color: rgba(255, 255, 255, 0.6);
}

#verify-btn {
  background: linear-gradient(135deg, #00c9ff, #92fe9d);
  color: #000;
  border: none;
  padding: 12px 25px;
  font-size: 16px;
  font-weight: bold;
  border-radius: 30px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  position: relative;
  overflow: hidden;
  width: 100%;
}

#verify-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
  background: linear-gradient(135deg, #00d2ff, #a8ff78);
}

.subscription-footer {
  margin-top: 15px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.top-bar {
  display: flex;
  justify-content: space-between;
  background-color: var(--primary-color);
  padding: 10px 15px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.top-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-left .logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 50%;
  background: linear-gradient(135deg, #00c9ff, #92fe9d);
  padding: 3px;
  animation: rotate 8s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.top-left span {
  font-weight: bold;
  font-size: 16px;
  text-shadow: 0 0 5px rgba(255,255,255,0.3);
}

.top-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-right .balance {
  background: rgba(255,255,255,0.1);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 12px;
}

.top-right .flag {
  width: 25px;
  border-radius: 50%;
  box-shadow: 0 0 5px rgba(0,0,0,0.5);
}

.auth-warning {
  background-color: var(--danger-color);
  color: black;
  padding: 10px;
  text-align: center;
  font-weight: bold;
  font-size: 12px;
  position: relative;
  overflow: hidden;
}

.auth-warning:before {
  content: "⚠";
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 16px;
  animation: blink 1.5s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.slider {
  text-align: center;
  padding: 10px;
  background: var(--video-bg);
  margin: 10px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  position: relative;
  overflow: hidden;
}

.video-container {
  position: relative;
  width: 100%;
  margin: 0 auto;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0,0,0,0.6);
  background: #000;
  min-height: 200px;
  aspect-ratio: 16/9;
}

.video-container video {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 10px;
  object-fit: cover;
}

.video-poster {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, #0a3a3a, #1c1c1e);
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  color: white;
  z-index: 2;
}

.video-poster i {
  font-size: 40px;
  margin-bottom: 10px;
  color: var(--accent-color);
}

.video-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  padding: 8px;
  opacity: 0.8;
  transition: opacity 0.3s;
  z-index: 3;
}

.video-container:hover .video-controls {
  opacity: 1;
}

.video-controls button {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  font-size: 16px;
  margin: 0 5px;
  outline: none;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  transition: all 0.3s;
}

.video-controls button:hover {
  background: rgba(255,255,255,0.2);
}

.video-controls .progress {
  flex-grow: 1;
  height: 5px;
  background: rgba(255,255,255,0.3);
  margin: 0 10px;
  border-radius: 5px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.video-controls .progress-filled {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 0%;
  background: var(--accent-color);
  border-radius: 5px;
  transition: width 0.1s;
}

.section-search {
  padding: 15px 15px 5px;
}

.section-search input {
  width: 100%;
  padding: 12px 20px;
  border-radius: 30px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 16px;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
  transition: all 0.3s;
}

.section-search input:focus {
  outline: none;
  background: rgba(255,255,255,0.15);
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.5), 0 0 0 2px var(--accent-color);
}

.section-search input::placeholder {
  color: rgba(255,255,255,0.6);
}

.sections {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  padding: 10px;
  gap: 10px;
}

.card {
  width: calc(50% - 10px);
  background-color: var(--card-bg);
  padding: 15px;
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  color: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 0.3s ease;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  position: relative;
  overflow: hidden;
  min-height: 120px;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 15px rgba(0,0,0,0.3);
  background: #3a3a3e;
}

.card:hover:before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to right, #00c9ff, #92fe9d);
  animation: progress 2s linear;
}

@keyframes progress {
  from { width: 0; }
  to { width: 100%; }
}

.card img {
  width: 50px;
  height: 50px;
  object-fit: contain;
  margin-bottom: 10px;
  background: rgba(255,255,255,0.05);
  padding: 8px;
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(0,0,0,0.2);
  z-index: 1;
}

.card span {
  font-weight: bold;
  font-size: 14px;
  margin-top: 5px;
  text-shadow: 0 0 5px rgba(255,255,255,0.1);
  z-index: 1;
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  width: 100%;
  background-color: var(--primary-color);
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.3);
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  color: white;
  text-decoration: none;
  font-size: 11px;
  gap: 4px;
  transition: all 0.2s ease;
  position: relative;
}

.nav-item:hover {
  transform: translateY(-3px);
  color: var(--accent-color);
}

.nav-item.active {
  color: var(--accent-color);
}

.nav-item.active:after {
  content: "";
  position: absolute;
  bottom: -6px;
  width: 5px;
  height: 5px;
  background: var(--accent-color);
  border-radius: 50%;
}

.nav-item i {
  font-size: 18px;
}

.ad-info {
  margin-top: 8px;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  text-align: center;
}

.subscribed-users {
  max-width: 800px;
  margin: 20px auto;
  background: var(--card-bg);
  padding: 15px;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  display: none;
}

.subscribed-users h3 {
  text-align: center;
  margin-bottom: 15px;
  color: var(--accent-color);
  border-bottom: 2px solid var(--accent-color);
  padding-bottom: 10px;
}

.subscribed-users-list {
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid rgba(255,255,255,0.1);
  padding: 10px;
  border-radius: 8px;
}

.user-item {
  padding: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.user-item:last-child {
  border-bottom: none;
}

.admin-panel-btn {
  position: fixed;
  top: 70px;
  right: 15px;
  background: var(--accent-color);
  color: #000;
  border: none;
  padding: 8px 12px;
  border-radius: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 200;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: all 0.3s;
  font-size: 12px;
}

.admin-panel-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 12px rgba(0,0,0,0.4);
}

.loading {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.7);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  display: none;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 5px solid rgba(255,255,255,0.1);
  border-top: 5px solid var(--accent-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.ad-status {
  text-align: center;
  padding: 10px;
  color: var(--accent-color);
  font-weight: bold;
  font-size: 14px;
}

/* تحسينات للشاشات الصغيرة */
@media (max-width: 480px) {
  .subscription-container {
    padding: 15px;
  }
  
  .subscription-header i {
    font-size: 40px;
  }
  
  .subscription-header h2 {
    font-size: 20px;
  }
  
  .subscription-content p {
    font-size: 14px;
  }
  
  .channel-link {
    font-size: 14px;
    padding: 8px 16px;
  }
  
  .card {
    width: calc(50% - 5px);
    padding: 10px;
    min-height: 100px;
  }
  
  .card img {
    width: 40px;
    height: 40px;
  }
  
  .card span {
    font-size: 12px;
  }
  
  .video-container {
    min-height: 180px;
  }
  
  .video-poster i {
    font-size: 30px;
  }
  
  .video-poster p {
    font-size: 14px;
  }
  
  .admin-panel-btn {
    top: 60px;
    right: 10px;
    padding: 6px 10px;
    font-size: 11px;
  }
  
  .top-left span {
    font-size: 14px;
  }
}

@media (min-width: 768px) {
  .card {
    width: calc(33.333% - 15px);
  }
  
  .video-container {
    max-width: 800px;
  }
}

/* منع التكبير عند النقر على input في iOS */
@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* تحسينات للشاشات الكبيرة */
@media (min-width: 1024px) {
  .card {
    width: calc(25% - 15px);
  }
}