body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f5f5f7;
  color: #333;
  direction: rtl;
}

.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

header {
  background-color: #1e222d;
  color: #fff;
  padding: 20px 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

header h1 {
  text-align: center;
  margin: 0;
  font-size: 2.5em;
}

.card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  padding: 20px;
  margin: 20px 0;
}

.card h2 {
  color: #1e222d;
  margin-top: 0;
  border-bottom: 2px solid #f0f0f0;
  padding-bottom: 10px;
}

form {
  display: flex;
  flex-direction: column;
}

label {
  margin-bottom: 5px;
  font-weight: bold;
}

input, select {
  padding: 10px;
  margin-bottom: 15px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 16px;
}

button {
  padding: 12px 20px;
  background-color: #2962ff;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 16px;
  transition: background-color 0.3s;
}

button:hover {
  background-color: #1e45e8;
}

.error {
  color: #d32f2f;
  background-color: #ffebee;
  padding: 10px;
  border-radius: 4px;
  margin-bottom: 20px;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
}

.result-table th, .result-table td {
  padding: 12px;
  text-align: right;
  border-bottom: 1px solid #ddd;
}

.result-table th {
  background-color: #f5f5f7;
  font-weight: bold;
}

.result-table tr:hover {
  background-color: #f5f5f7;
}

.data-card {
  margin-bottom: 30px;
}

.back-link {
  display: inline-block;
  margin-top: 20px;
  color: #2962ff;
  text-decoration: none;
  font-weight: bold;
}

.back-link:hover {
  text-decoration: underline;
}

/* معلومات السهم */
.stock-info-title {
  color: #333;
  border-bottom: 2px solid #eaeaea;
  padding-bottom: 15px;
  margin-bottom: 20px;
}

.stock-info-container {
  background-color: #fff;
  border-radius: 8px;
  padding: 20px;
}

.stock-info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
}

.stock-info-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #f8f9fa;
  border-radius: 6px;
  border-right: 3px solid #0088cc;
}

.info-label {
  color: #666;
  font-weight: 500;
}

.info-value {
  font-weight: bold;
  color: #333;
}

.info-value.positive {
  color: #22ab94;
}

.info-value.negative {
  color: #f23645;
}

.stock-additional-info {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #eaeaea;
}

.price-range-info {
  margin-top: 15px;
}

.range-label {
  color: #666;
  margin-bottom: 8px;
}

.price-range-bar {
  position: relative;
  height: 6px;
  background: linear-gradient(to right, #f23645, #22ab94);
  border-radius: 3px;
  margin: 15px 0;
}

.range-low,
.range-high {
  position: absolute;
  bottom: -25px;
  font-size: 0.9em;
  color: #666;
}

.range-low {
  right: 0;
}

.range-high {
  left: 0;
}

.range-current {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
  height: 12px;
  background-color: #fff;
  border: 2px solid #0088cc;
  border-radius: 50%;
  z-index: 1;
}

/* تحسينات للعرض على الأجهزة المحمولة */
@media (max-width: 768px) {
  header h1 {
    font-size: 2em;
  }
  
  .container {
    width: 95%;
  }
  
  .card {
    padding: 15px;
  }
  
  .stock-info-grid {
    grid-template-columns: 1fr;
    gap: 15px;
  }
  
  .stock-info-item {
    padding: 8px 12px;
  }
}

.advanced-chart-box {
  background-color: #f2f8ff;
  border-left: 4px solid #0088cc;
  padding: 15px;
  margin: 20px 0;
  border-radius: 4px;
}

.advanced-chart-box h3 {
  color: #0088cc;
  margin-top: 0;
}

.advanced-chart-link {
  display: inline-block;
  background-color: #0088cc;
  color: white;
  padding: 10px 18px;
  text-decoration: none;
  font-weight: bold;
  border-radius: 4px;
  margin: 15px 0;
  transition: background-color 0.3s ease;
}

.advanced-chart-link:hover {
  background-color: #006699;
}

.chart-container {
  margin-top: 30px;
  margin-bottom: 30px;
}

.chart-container canvas {
  width: 100%;
  height: 400px;
}

.text-center {
  text-align: center;
}

.note {
  font-size: 0.9em;
  margin-bottom: 0;
  color: #666;
}

.chart-wrapper {
  position: relative;
  height: 400px;
  width: 100%;
}
