/* Import Cairo font */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;700;800;900&display=swap');

/* CSS Variables */
:root {
  --font-size: 14px;
  --background: #ffffff;
  --foreground: #1E1E1E;
  --card: #ffffff;
  --card-foreground: #1E1E1E;
  --primary: #F7CD4F;
  --primary-foreground: #1E1E1E;
  --primary-dark: #E0B842;
  --secondary: #F6F7FB;
  --secondary-foreground: #1E1E1E;
  --muted: #F6F7FB;
  --muted-foreground: #6B7280;
  --accent: #F7CD4F;
  --accent-foreground: #1E1E1E;
  --border: rgba(0, 0, 0, 0.1);
  --radius: 1rem;
  --plyr-color-main: #F7CD4F; 
}

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

html {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  font-size: var(--font-size);
}

body {
  background-color: var(--background);
  color: var(--foreground);
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Typography */
h1 {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 1rem;
}

h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 0.75rem;
}

h3 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 0.5rem;
}

p {
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 1rem;
}

button {
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.4;
  font-family: 'Cairo', sans-serif;
  cursor: pointer;
  border: none;
  outline: none;
}

/* Page system */
.page {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--background);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  overflow-y: auto;
}

.page.active {
  opacity: 1;
  visibility: visible;
}

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

@keyframes slideIn {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

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

.animate-fade-in {
  animation: fadeIn 0.5s ease-out;
}

.animate-slide-in {
  animation: slideIn 0.3s ease-out;
}

/* Loading Screen */
#loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--background);
}

.loader-container {
  text-align: center;
  animation: fadeIn 0.5s ease-out;
}

.company-logo {
  width: 96px;
  height: 96px;
  background: var(--primary);
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 10px 30px rgba(247, 205, 79, 0.3);
}

.company-logo span {
  color: var(--primary-foreground);
  font-weight: 900;
  font-size: 48px;
}

.loader-text h2 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--foreground);
  margin-bottom: 8px;
}

.loader-text p {
  color: var(--muted-foreground);
  margin-bottom: 24px;
}

.loading-bar-container {
  width: 256px;
  margin: 0 auto;
}

.loading-bar {
  width: 100%;
  height: 4px;
  background-color: var(--muted);
  border-radius: 2px;
  overflow: hidden;
  position: relative;
}

.loading-progress {
  height: 100%;
  background-color: var(--primary);
  width: 0%;
  border-radius: 2px;
  animation: progress 2s ease-in-out;
}

/* Landing Page */
#landing-page {
  background: linear-gradient(135deg, var(--background) 0%, var(--secondary) 50%, rgba(247, 205, 79, 0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.landing-container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}

.landing-header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeIn 0.5s ease-out;
}

.main-logo {
  width: 128px;
  height: 128px;
  border-radius: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

.main-logo span {
  color: var(--primary-foreground);
  font-weight: 900;
  font-size: 72px;
}

.landing-header h1 {
  font-size: 3rem;
  font-weight: 900;
  color: var(--foreground);
  margin-bottom: 8px;
}

.landing-header p {
  font-size: 1.25rem;
  color: var(--muted-foreground);
}

.menu-buttons {
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: slideIn 0.3s ease-out;
}

.menu-btn {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: all 0.3s ease;
  text-align: right;
}

.menu-btn:hover {
  background: rgba(247, 205, 79, 0.05);
  border-color: rgba(247, 205, 79, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.btn-icon {
  width: 64px;
  height: 64px;
  background: rgba(247, 205, 79, 0.1);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.menu-btn:hover .btn-icon {
  background: var(--primary);
}

.btn-icon svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  transition: all 0.3s ease;
}

.menu-btn:hover .btn-icon svg {
  color: var(--primary-foreground);
}

.btn-content {
  flex: 1;
}

.btn-content h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 4px;
  transition: all 0.3s ease;
}

.menu-btn:hover .btn-content h3 {
  color: var(--primary);
}

.btn-content p {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
}

.footer {
  text-align: center;
  margin-top: 48px;
  color: var(--muted-foreground);
}

.footer p {
  font-size: 0.875rem;
  margin: 0;
}

/* Topbar */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.topbar-content {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px;
  max-width: 1200px;
  margin: 0 auto;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-logo {
  width: 32px;
  height: 32px;
  background: var(--primary);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.topbar-logo span {
  color: var(--primary-foreground);
  font-weight: 900;
  font-size: 14px;
}

.topbar-title {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--foreground);
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  color: var(--foreground);
  background: rgba(246, 247, 251, 0.5);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.back-btn:hover {
  color: var(--primary);
  background: rgba(247, 205, 79, 0.1);
}

.back-btn svg {
  width: 20px;
  height: 20px;
}

.back-btn span {
  font-weight: 700;
}

/* Page Content */
.page-content {
  padding-top: 80px;
  padding-bottom: 32px;
  padding-left: 16px;
  padding-right: 16px;
  min-height: 100vh;
  align-content: center;
}

/* CHRO Page */
.chro-container {
  max-width: 1024px;
  margin: 0 auto;
  min-width: 70%;
    margin-right: 15%;
    margin-left: 15%;
}

.chro-header {
  text-align: center;
  margin-bottom: 48px;
  animation: fadeIn 0.5s ease-out;
}

.chro-avatar {
  width: 128px;
  height: 128px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 20px 40px rgba(247, 205, 79, 0.3);
    overflow: hidden;       /* <— crops the image to the circle */

}

.chro-avatar span {
  color: var(--primary-foreground);
  font-weight: 900;
  font-size: 48px;
}

.chro-header h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--foreground);
  margin-bottom: 8px;
}

.chro-title {
  color: var(--primary);
  font-weight: 700;
  font-size: 1.125rem;
}

.message-card {
  background: var(--card);
  border-radius: 32px;
  padding: 32px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  animation: slideIn 0.3s ease-out;
  margin-bottom: 2rem!important;
}

.message-header {
  text-align: center;
  margin-bottom: 32px;
}

.message-header h2 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--foreground);
}

.title-underline {
  width: 96px;
  height: 4px;
  background: var(--primary);
  margin: 16px auto 0;
  border-radius: 2px;
}

.message-content p {
  color: var(--foreground);
  line-height: 1.8;
  margin-bottom: 24px;
}

.signature {
  margin-top: 28px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
  text-align: center;
}

.signature-regards {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
    margin-bottom: 0rem !important;}

.signature-name {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
    margin-bottom: 0rem !important;}

.signature-position {
  color: var(--muted-foreground);
    margin-bottom: 0rem !important;}

.signature-date {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0;
}

/* Video Page */
.video-container {
  max-width: 1024px;
  margin-top: -30px;
  min-width: 70%;
    margin-right: 15%;
    margin-left: 15%;
}
.video-header {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeIn 0.5s ease-out;
}

.video-header h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--foreground);
  margin-bottom: 16px;
}

.video-header p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

.video-card {
  background: var(--card);
  border-radius: 32px;
  padding: 24px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  animation: slideIn 0.3s ease-out;
  width: 100%!important;
}

.video-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, rgba(247, 205, 79, 0.2) 0%, rgba(224, 184, 66, 0.3) 100%);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 24px;
}

.video-poster {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-poster:hover {
  transform: scale(1.02);
}

.poster-content {
  text-align: center;
}

.poster-logo {
  width: 96px;
  height: 96px;
  background: var(--primary);
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 10px 30px rgba(247, 205, 79, 0.4);
}

.poster-logo span {
  color: var(--primary-foreground);
  font-weight: 900;
  font-size: 36px;
}

.play-btn {
  width: 80px;
  height: 80px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
}

.play-btn:hover {
  background: white;
  transform: scale(1.1);
}

.play-btn svg {
  width: 32px;
  height: 32px;
  color: var(--primary);
  margin-left: 4px;
}

.poster-content p {
  color: var(--foreground);
  font-weight: 700;
  margin: 0;
}

.video-info {
  margin-top: 24px;
}

.video-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 24px;
}

.video-description h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 12px;
}

.video-description p {
  color: var(--foreground);
  line-height: 1.6;
  margin-bottom: 16px;
}

.video-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
  padding: 16px;
  background: rgba(246, 247, 251, 0.5);
  border-radius: 12px;
}

.stat {
  text-align: center;
}

.stat-number {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
}

.stat-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Analytics Page */
.analytics-container {
  max-width: 1400px;
  margin: 0 auto;
  min-width: 70%;
    margin-right: 15%;
    margin-left: 15%;
}

.analytics-header {
  text-align: center;
  margin-bottom: 32px;
  animation: fadeIn 0.5s ease-out;
}

.analytics-header h1 {
  font-size: 2rem;
  font-weight: 900;
  color: var(--foreground);
  margin-bottom: 16px;
}

.analytics-header p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
  animation: slideIn 0.3s ease-out;
}

.kpi-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  text-align: center;
  transition: all 0.2s ease;
}

.kpi-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
}

.kpi-value {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
}

.kpi-title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 4px;
}

.kpi-description {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin-bottom: 16px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--muted);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 1s ease-out;
  width: 0%;
}

.progress-text {
  display: flex;
  justify-content: space-between;
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

.progress-text::before {
  content: 'التقدم';
}

.progress-text::after {
  content: attr(data-percentage) '%';
  font-weight: 700;
  color: var(--primary);
}

.gauge-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
  margin-bottom: 32px;
}

.gauge-card {
  background: var(--card);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  text-align: center;
}

.gauge-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 16px;
}

.gauge-container {
  position: relative;
  display: inline-block;
}

.gauge-svg {
  transform: rotate(-90deg);
}

.gauge-progress {
  transition: stroke-dashoffset 1s ease-in-out;
}

.gauge-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
}

.monthly-chart {
  background: var(--card);
  border-radius: 32px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid var(--border);
  margin-bottom: 32px;
}

.monthly-chart h3 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--foreground);
  margin-bottom: 24px;
}

.chart-container {
  height: 128px;
  display: flex;
  align-items: end;
}

.chart-bars {
  display: flex;
  gap: 8px;
  width: 100%;
  height: 100%;
  align-items: end;
}

.chart-bar {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.bar-fill {
  width: 100%;
  background: var(--primary);
  border-radius: 4px 4px 0 0;
  transition: height 1s ease-out;
  height: 0%;
}

.bar-month {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  font-weight: 700;
  margin-top: 8px;
}

.bar-value {
  font-size: 0.75rem;
  color: var(--primary);
  font-weight: 900;
  margin-top: 4px;
}

.summary-card {
  background: linear-gradient(135deg, rgba(247, 205, 79, 0.1) 0%, rgba(224, 184, 66, 0.1) 100%);
  border: 1px solid rgba(247, 205, 79, 0.2);
  border-radius: 32px;
  padding: 32px;
  text-align: center;
}

.summary-card h3 {
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--foreground);
  margin-bottom: 16px;
}

.summary-card p {
  font-size: 1.125rem;
  color: var(--muted-foreground);
  margin-bottom: 24px;
  max-width: 768px;
  margin-left: auto;
  margin-right: auto;
}

.summary-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
}

.summary-stat {
  text-align: center;
}

.summary-number {
  font-size: 2rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 4px;
}

.summary-label {
  font-size: 0.875rem;
  color: var(--muted-foreground);
}

/* Responsive Design */
@media (max-width: 768px) {
  .landing-header h1 {
    font-size: 2rem;
  }
  
  .main-logo {
    width: 96px;
    height: 96px;
    border-radius: 32px;
  }
  
  .main-logo span {
    font-size: 48px;
  }
  
  .menu-btn {
    padding: 20px;
  }
  
  .btn-icon {
    width: 48px;
    height: 48px;
  }
  
  .btn-icon svg {
    width: 24px;
    height: 24px;
  }
  
  .btn-content h3 {
    font-size: 1rem;
  }
  
  .message-card {
    padding: 24px;
  }
  
  .video-card {
    padding: 16px;
  }
  
  .kpi-grid {
    grid-template-columns: 1fr;
  }
  
  .gauge-grid {
    grid-template-columns: 1fr;
  }
  
  .summary-stats {
    flex-direction: column;
    gap: 16px;
  }
  
  .chart-bars {
    gap: 4px;
  }
  
  .topbar-content {
    padding: 12px 16px;
  }
  
  .topbar-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .page-content {
    padding-left: 12px;
    padding-right: 12px;
  }
  
  .landing-container {
    padding: 0 12px;
  }
  
  .chro-avatar {
    width: 96px;
    height: 96px;
  }
  
  .chro-avatar span {
    font-size: 36px;
  }
  
  .poster-logo {
    width: 64px;
    height: 64px;
    border-radius: 20px;
  }
  
  .poster-logo span {
    font-size: 24px;
  }
  
  .play-btn {
    width: 60px;
    height: 60px;
  }
  
  .play-btn svg {
    width: 24px;
    height: 24px;
  }
}
     .container {
            max-width: 900px;
            margin: auto;
            background-color: #fff;
            padding: 20px;
            border-radius: 8px;
            box-shadow: 0 0 10px rgba(0,0,0,0.1);
        }
        .header-info {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 20px;
            padding-bottom: 10px;
            border-bottom: 1px solid #ddd;
            font-weight: bold;
            font-size: 1.1em;
        }
        .header-info .title {
            color: #005691;
        }
        .results-table {
            width: 100%;
            border-collapse: collapse;
        }
        .results-table th, .results-table td {
            padding: 12px 8px;
            vertical-align: middle;
        }
        .category-name {
            text-align: right;
            font-weight: bold;
            color: #000000;
            width: 25%;
        }
        .score {
             text-align: center;
             font-weight: bold;
             width: 5%;
        }
        .bar-cell {
            width: 70%;
        }
        .bar-container {
            display: flex;
            width: 100%;
            height: 30px;
            line-height: 30px;
            color: white;
            font-weight: bold;
            font-size: 0.9em;
            overflow: hidden;
            border-radius: 4px;
        }
        /* Bar segment styles */
        .bar-segment {
            display: flex;
            justify-content: center;
            align-items: center;
            height: 100%;
        }
        .green {
            background-color: #92d050; /* Light Green */
        }
        .yellow {
            background-color: #ffd966; /* Light Yellow */
            color: #333; /* Dark text for yellow bg */
        }
        .red {
            background-color: #ff5050; /* Light Red */
        }

.graph-legend {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 1rem;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.legend-color {
    width: 16px;
    height: 16px;
    border-radius: 4px;
}

.legend-color.green {
    background-color: #4CAF50;
}

.legend-color.yellow {
    background-color: #FFC107;
}

.legend-color.red {
    background-color: #F44336;
}

.legend-text {
    font-size: 0.875rem;
    color: var(--foreground);
}
/* Make the big overlaid Play button use your yellow and a crisp icon */
  .plyr__control--overlaid {
    background-color: #F7CD4F !important;
    color: #000 !important;              /* play icon color */
    width: auto; height: auto;
    border-radius: 1000%;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
  }
  .plyr__control--overlaid svg { transform: scale(1.15); }

  /* Hint text under the button (shown before playback) */
    .player-hint {
    position: absolute;
    left: 50%;
    top: 62%;                            /* a bit under the play button */
    transform: translateX(-50%);
    padding: .5rem .9rem;
    border-radius: 999px;
    background: rgba(0,0,0,.55);
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    pointer-events: none;                /* let clicks reach the play button */
    backdrop-filter: blur(2px);
    text-align: center;
    white-space: nowrap;                 /* prevents text from wrapping */
    overflow: hidden;                    /* hides any overflow */
    text-overflow: ellipsis;            /* shows ... if text overflows */
    max-width: 90%;                     /* prevents text from extending beyond screen edges */
  }
  .player-hint.is-hidden { display: none; }
  .video-card-container{
    display: flex;
    align-items: center;
    align-content: center;
  }
  
  @media screen and (max-width: 768px) {
  .chro-avatar img {
    margin-bottom: -30% !important;
  }
}