body {
  font-family: 'Cairo', sans-serif;
  direction: rtl;
  background: #f0f7ff;
  margin: 0;
  padding: 20px;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.login-container {
  max-width: 400px;
  margin-top: 100px;
}

h1 {
  color: #2c3e50;
  text-align: center;
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  margin-bottom: 5px;
  color: #34495e;
}

input {
  width: 100%;
  padding: 8px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  direction: rtl;
}

button {
  background: #3498db;
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 4px;
  cursor: pointer;
  width: 100%;
  font-size: 16px;
}

button:hover {
  background: #2980b9;
}

.summary {
  margin-top: 30px;
  padding: 20px;
  background: #ecf0f1;
  border-radius: 4px;
}

.progress-bar {
  height: 20px;
  background: #e0e0e0;
  border-radius: 10px;
  margin: 10px 0;
  overflow: hidden;
}

.progress {
  height: 100%;
  background: #27ae60;
  width: 0%;
  transition: width 0.3s ease;
}

.error-message {
  color: #e74c3c;
  margin: 10px 0;
  text-align: center;
}

.header-bar {
  text-align: center;
  margin-bottom: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
}

.header-bar h1 {
  margin: 0;
}

.profile-nav-btn {
  position: absolute;
  left: 0;
  background: #3498db;
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  width: auto;
  transition: all 0.3s ease;
}

.profile-nav-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

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

.logout-btn {
  width: auto;
  background: #e74c3c;
}

.logout-btn:hover {
  background: #c0392b;
}

.auth-links {
  text-align: center;
  margin-top: 20px;
}

.auth-links a {
  color: #3498db;
  text-decoration: none;
}

.auth-links a:hover {
  text-decoration: underline;
}

.wallet-container {
  padding: 20px;
}

.wallet-balance {
  text-align: center;
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 30px;
  border-radius: 10px;
  margin-bottom: 30px;
  position: relative;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.balance {
  font-size: 48px;
  font-weight: bold;
  margin: 10px 0;
}

.coins-label {
  font-size: 18px;
  opacity: 0.9;
}

.transactions-section {
  background: white;
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.transaction-item {
  padding: 15px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.transaction-details {
  display: flex;
  align-items: center;
  gap: 10px;
}

.transaction-type {
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 14px;
}

.transaction-type.credit {
  background: #27ae60;
  color: white;
}

.transaction-type.debit {
  background: #e74c3c;
  color: white;
}

.transaction-info {
  text-align: left;
  font-size: 14px;
  color: #666;
}

.tasks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.task-card {
  background: white;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
  text-align: center;
}

.reward-btn {
  background: #f1c40f;
  color: #2c3e50;
  margin-top: 15px;
}

.reward-btn:hover {
  background: #f39c12;
}

.secondary-btn {
  background: #95a5a6;
  color: white;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
}

.secondary-btn:hover {
  background: #7f8c8d;
}

.coin-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 15px;
}

.profile-container {
  padding: 20px;
}

.profile-header {
  text-align: center;
  margin-bottom: 30px;
}

.profile-frame {
  position: relative;
  display: inline-block;
}

.frame-overlay {
  position: absolute;
  top: -10px;
  left: -10px;
  right: -10px;
  bottom: -10px;
  border-radius: 50%;
  pointer-events: none;
}

.frame-overlay.beginner {
  border: 4px solid #95a5a6;
  box-shadow: 0 0 10px rgba(149, 165, 166, 0.5);
}

.frame-overlay.amateur {
  border: 4px solid #3498db;
  background: linear-gradient(45deg, transparent, rgba(52, 152, 219, 0.1));
  box-shadow: 0 0 15px rgba(52, 152, 219, 0.5);
}

.frame-overlay.professional {
  border: 4px solid #2ecc71;
  background: linear-gradient(45deg, transparent, rgba(46, 204, 113, 0.1));
  box-shadow: 0 0 20px rgba(46, 204, 113, 0.5);
}

.frame-overlay.expert {
  border: 4px solid #f1c40f;
  background: linear-gradient(45deg, transparent, rgba(241, 196, 15, 0.1));
  box-shadow: 0 0 25px rgba(241, 196, 15, 0.5);
  animation: frameGlow 2s infinite alternate;
}

.frame-overlay.legend {
  border: 4px solid #e74c3c;
  background: linear-gradient(45deg, transparent, rgba(231, 76, 60, 0.1));
  box-shadow: 0 0 30px rgba(231, 76, 60, 0.5);
  animation: legendFrameGlow 3s infinite alternate;
}

@keyframes frameGlow {
  from {
    box-shadow: 0 0 25px rgba(241, 196, 15, 0.5);
  }
  to {
    box-shadow: 0 0 35px rgba(241, 196, 15, 0.8);
  }
}

@keyframes legendFrameGlow {
  0% {
    box-shadow: 0 0 30px rgba(231, 76, 60, 0.5);
    border-color: #e74c3c;
  }
  50% {
    box-shadow: 0 0 40px rgba(241, 196, 15, 0.8);
    border-color: #f1c40f;
  }
  100% {
    box-shadow: 0 0 30px rgba(231, 76, 60, 0.5);
    border-color: #e74c3c;
  }
}

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

.profile-picture-container img {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  z-index: 1;
  position: relative;
}

.change-picture-btn {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: #3498db;
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}

.change-picture-btn:hover {
  background: #2980b9;
}

.profile-form {
  max-width: 600px;
  margin: 0 auto;
}

textarea {
  width: 100%;
  padding: 8px;
  border: 1px solid #bdc3c7;
  border-radius: 4px;
  resize: vertical;
  direction: rtl;
  font-family: 'Cairo', sans-serif;
}

.save-btn {
  background: #27ae60;
  margin-top: 20px;
}

.save-btn:hover {
  background: #219a52;
}

.success-message {
  color: #27ae60;
  margin: 10px 0;
  text-align: center;
}

.menu-toggle {
  display: block;
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 1000;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
  padding: 0;
  transition: all 0.3s ease;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 3px;
  background: #2c3e50;
  margin: 5px 0;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.mobile-nav {
  display: block;
  position: fixed;
  top: 0;
  right: -300px;
  width: 300px;
  height: 100vh;
  background: white;
  box-shadow: -2px 0 5px rgba(0,0,0,0.1);
  padding: 60px 20px 20px;
  transition: 0.3s ease;
  z-index: 999;
  overflow-y: auto;
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav button {
  margin-bottom: 10px;
}

.user-bio-preview {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-style: italic;
  color: #666;
}

.wallet-preview {
  background: linear-gradient(135deg, #3498db, #2980b9);
  color: white;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  text-align: center;
}

.wallet-preview h4 {
  margin: 0 0 10px 0;
}

.coin-balance {
  font-size: 24px;
  font-weight: bold;
  margin: 0;
}

.bio-preview {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-style: italic;
  color: #666;
}

.invite-code-section {
  margin-top: 20px;
  text-align: center;
}

.invite-code {
  background: #f8f9fa;
  padding: 10px 20px;
  border-radius: 20px;
  display: inline-block;
  margin: 10px 0;
  font-family: monospace;
  font-size: 18px;
  letter-spacing: 2px;
  color: #2c3e50;
  border: 2px dashed #3498db;
}

.copy-btn {
  background: #3498db;
  color: white;
  padding: 5px 15px;
  border-radius: 15px;
  font-size: 14px;
  width: auto;
  margin-top: 5px;
}

.copy-btn:hover {
  background: #2980b9;
}

.back-btn {
  background: #95a5a6;
  color: white;
  padding: 8px 15px;
  border-radius: 4px;
  cursor: pointer;
  border: none;
  position: fixed;
  top: 20px;
  left: 20px;
  width: auto;
  z-index: 1000;
}

.back-btn:hover {
  background: #7f8c8d;
}

.wallet-customize {
  position: absolute;
  top: 10px;
  right: 10px;
}

.customize-btn {
  background: rgba(255, 255, 255, 0.2);
  border: none;
  padding: 5px 10px;
  border-radius: 15px;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  transition: 0.3s;
}

.customize-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
}

.modal-content {
  background: white;
  width: 90%;
  max-width: 500px;
  margin: 50px auto;
  padding: 20px;
  border-radius: 10px;
  position: relative;
}

.customize-options {
  margin: 20px 0;
}

.color-pickers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
  margin: 15px 0;
}

.color-picker {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.color-picker input[type="color"] {
  width: 50px;
  height: 50px;
  padding: 0;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.gradient-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 15px 0;
}

.gradient-buttons button {
  padding: 10px;
  border: none;
  border-radius: 5px;
  background: #f0f0f0;
  color: #333;
  cursor: pointer;
  transition: 0.3s;
}

.gradient-buttons button:hover {
  background: #e0e0e0;
}

.theme-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.theme-btn {
  padding: 10px;
  border: none;
  border-radius: 5px;
  color: white;
  cursor: pointer;
  transition: 0.3s;
}

.theme-btn:hover {
  opacity: 0.9;
}

.theme-btn.blue {
  background: linear-gradient(135deg, #3498db, #2980b9);
}

.theme-btn.purple {
  background: linear-gradient(135deg, #9b59b6, #8e44ad);
}

.theme-btn.green {
  background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.theme-btn.gold {
  background: linear-gradient(135deg, #f1c40f, #f39c12);
}

.close-modal {
  width: 100%;
  padding: 10px;
  margin-top: 20px;
  background: #3498db;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  transition: 0.3s;
}

.close-modal:hover {
  background: #2980b9;
}

.wallet-picture-container {
  position: relative;
  display: inline-block;
  margin-bottom: 20px;
}

.wallet-picture-container img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.wallet-picture-container .change-picture-btn {
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(255, 255, 255, 0.2);
  color: white;
  padding: 5px 10px;
  border-radius: 15px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
  backdrop-filter: blur(5px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 0.3s ease;
}

.wallet-picture-container .change-picture-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.user-level-section {
  text-align: center;
  margin: 20px 0;
  padding: 15px;
  background: white;
  border-radius: 10px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.level-progress-container {
  margin-top: 10px;
}

.level-progress-bar {
  width: 100%;
  height: 20px;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  margin: 10px 0;
}

.level-progress {
  height: 100%;
  width: 0%;
  background: linear-gradient(45deg, #3498db, #2ecc71);
  transition: width 0.3s ease;
}

#levelInfo {
  color: #2c3e50;
  margin: 0;
  font-size: 1.2em;
}

#progressText {
  color: #7f8c8d;
  margin: 5px 0;
  font-size: 0.9em;
}

.daily-reward-section {
  background: linear-gradient(135deg, #2c3e50, #34495e);
  padding: 20px;
  border-radius: 10px;
  margin-bottom: 30px;
  text-align: center;
  color: white;
  position: relative;
}

.royal-timer {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 20px;
}

.timer-circle {
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: conic-gradient(#f1c40f 0%, #2c3e50 0%);
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  transition: background 0.3s linear;
}

.timer-inner {
  width: 180px;
  height: 180px;
  background: #2c3e50;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  position: relative;
}

.crown-icon {
  font-size: 32px;
  margin-bottom: 10px;
  animation: float 2s ease-in-out infinite;
}

.timer-text {
  font-size: 24px;
  font-weight: bold;
  font-family: monospace;
  margin: 5px 0;
}

.royal-reward-btn {
  background: #f1c40f;
  color: #2c3e50;
  padding: 10px 20px;
  border-radius: 20px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 10px;
  font-size: 14px;
}

.royal-reward-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  background: #f39c12;
}

.royal-reward-btn:disabled {
  background: #95a5a6;
  cursor: not-allowed;
  transform: none;
}

@keyframes float {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

.bio-btn {
  background: #3498db;
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  margin: 10px 0;
  font-size: 14px;
  transition: all 0.3s ease;
  width: auto;
  display: block;
}

.bio-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.bio-modal-content {
  max-width: 400px;
}

.bio-content {
  background: #f8f9fa;
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  min-height: 100px;
  color: #2c3e50;
  line-height: 1.5;
  text-align: right;
}

.user-bio-section {
  text-align: center;
  margin-bottom: 15px;
}

.new-story-btn {
  position: absolute;
  right: 0;
  background: #3498db;
  color: white;
  padding: 8px 15px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  width: auto;
  transition: all 0.3s ease;
}

.new-story-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
}

.story-card {
  background: white;
  border-radius: 10px;
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.story-header {
  display: flex;
  align-items: center;
  margin-bottom: 15px;
}

.user-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  margin-left: 10px;
}

.story-info {
  flex: 1;
}

.user-name {
  font-weight: bold;
  color: #2c3e50;
}

.story-date {
  font-size: 0.9em;
  color: #7f8c8d;
}

.story-content {
  margin-bottom: 15px;
}

.story-image {
  width: 100%;
  max-height: 400px;
  object-fit: cover;
  border-radius: 8px;
  margin-top: 10px;
}

.story-actions {
  display: flex;
  gap: 15px;
}

.like-btn, .comment-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  color: #7f8c8d;
  cursor: pointer;
  padding: 5px 10px;
  border-radius: 15px;
  transition: all 0.3s ease;
}

.like-btn:hover, .comment-btn:hover {
  background: #f0f0f0;
}

.like-btn.liked {
  color: #e74c3c;
}

.like-btn.liked svg {
  fill: #e74c3c;
}

.image-preview {
  margin: 10px 0;
  text-align: center;
}

.preview-image {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
}

.publish-btn {
  background: #27ae60;
  color: white;
  margin-top: 10px;
}

.publish-btn:hover {
  background: #219a52;
}

.cancel-btn {
  background: #95a5a6;
  color: white;
  margin-top: 10px;
}

.cancel-btn:hover {
  background: #7f8c8d;
}

.comments-list {
  max-height: 400px;
  overflow-y: auto;
  margin-bottom: 20px;
}

.comment-item {
  padding: 10px;
  border-bottom: 1px solid #eee;
}

.comment-header {
  display: flex;
  align-items: center;
  margin-bottom: 5px;
}

.comment-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  margin-left: 10px;
}

.comment-user-info {
  flex: 1;
}

.comment-user-name {
  font-weight: bold;
  font-size: 0.9em;
  color: #2c3e50;
}

.comment-date {
  font-size: 0.8em;
  color: #7f8c8d;
}

.comment-text {
  color: #34495e;
  font-size: 0.95em;
  line-height: 1.4;
}

.new-comment-form {
  border-top: 1px solid #eee;
  padding-top: 15px;
}

.new-comment-form textarea {
  width: 100%;
  resize: none;
  border: 1px solid #bdc3c7;
  border-radius: 8px;
  padding: 10px;
  margin-bottom: 10px;
}

.stories-list {
  margin-top: 20px;
}

.stories-preview-btn {
  margin-top: 20px;
  text-align: center;
}

.stories-btn {
  background: #3498db;
  color: white;
  padding: 10px 20px;
  border-radius: 20px;
  border: none;
  cursor: pointer;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(52, 152, 219, 0.2);
}

.stories-btn:hover {
  background: #2980b9;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(52, 152, 219, 0.3);
}

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