 @import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700&display=swap');

:root {
  --bg-deep: #06080d;
  --gold-glow: #e8c99b;
  --rose-glow: #f4b6c2;
  --pearl-glow: #bfe3f7;
  --text-main: #f5f2ec;
  --text-muted: #8d95a5;
  --border-glass: rgba(255, 255, 255, 0.08);
  --surface-glass: rgba(13, 18, 27, 0.82);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  user-select: none;
}

body {
  font-family: 'Tajawal', sans-serif;
  background: radial-gradient(ellipse at 50% 40%, #0d131f 0%, #040609 100%);
  color: var(--text-main);
  height: 100vh;
  width: 100vw;
  overflow: hidden;
  direction: rtl;
  position: relative;
}

/* قماش الفضاء التفاعلي */
#skyCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* الشريط العلوي */
.ambient-header {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  padding: 1.75rem 2.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 10;
  pointer-events: none;
}

.brand {
  pointer-events: auto;
  display: flex;
  flex-direction: column;
}

.logo-title {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 2px;
  color: #fff;
  text-shadow: 0 0 16px rgba(232, 201, 155, 0.7), 0 0 35px rgba(232, 201, 155, 0.3);
  line-height: 1.1;
}

.logo-sub {
  font-size: 0.85rem;
  font-weight: 300;
  color: var(--text-muted);
  margin-top: 0.35rem;
  letter-spacing: 0.5px;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  pointer-events: auto;
}

/* أزرار الواجهة */
.icon-btn {
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(14px);
  transition: all 0.3s ease;
}

.icon-btn:hover {
  background: rgba(232, 201, 155, 0.2);
  border-color: var(--gold-glow);
}

.control-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.action-btn {
  background: linear-gradient(135deg, rgba(232, 201, 155, 0.22), rgba(232, 201, 155, 0.06));
  border: 1px solid rgba(232, 201, 155, 0.45);
  color: var(--gold-glow);
  padding: 0.65rem 1.5rem;
  border-radius: 30px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  backdrop-filter: blur(12px);
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.action-btn:hover {
  background: linear-gradient(135deg, rgba(232, 201, 155, 0.4), rgba(232, 201, 155, 0.2));
  box-shadow: 0 0 25px rgba(232, 201, 155, 0.4);
  transform: translateY(-2px);
}

/* التلميح السفلي */
.ambient-hint {
  position: absolute;
  bottom: 24px;
  width: 100%;
  text-align: center;
  font-size: 0.9rem;
  font-weight: 300;
  color: rgba(245, 242, 236, 0.45);
  pointer-events: none;
  z-index: 10;
  letter-spacing: 0.5px;
}

/* النوافذ الزجاجية */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(4, 6, 10, 0.72);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.glass-card {
  position: relative;
  background: var(--surface-glass);
  border: 1px solid var(--border-glass);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7), 0 0 45px rgba(232, 201, 155, 0.1);
  border-radius: 22px;
  padding: 2.5rem;
  max-width: 500px;
  width: 100%;
  backdrop-filter: blur(25px);
  transform: scale(0.92);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-overlay.active .glass-card {
  transform: scale(1);
}

.close-btn {
  position: absolute;
  top: 1.25rem;
  left: 1.25rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-btn:hover {
  color: #fff;
}
 /* بطاقة القراءة */
.card-tag {
  display: inline-block;
  font-size: 0.8rem;
  color: var(--gold-glow);
  background: rgba(232, 201, 155, 0.12);
  padding: 0.3rem 0.85rem;
  border-radius: 20px;
  margin-bottom: 1.25rem;
}

.card-text {
  font-size: 1.25rem;
  line-height: 2;
  color: var(--text-main);
  font-weight: 400;
  margin-bottom: 2rem;
}

.card-action-bar {
  display: flex;
  justify-content: flex-end;
}

.resonate-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  padding: 0.55rem 1.15rem;
  border-radius: 30px;
  font-family: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s;
}

.resonate-btn:hover,
.resonate-btn.active {
  background: rgba(232, 201, 155, 0.22);
  border-color: var(--gold-glow);
  color: var(--gold-glow);
}

.heart-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.resonate-count {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* بطاقة الكتابة */
.compose-title {
  font-size: 1.35rem;
  font-weight: 600;
  color: var(--gold-glow);
  margin-bottom: 0.4rem;
}

.compose-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.compose-category {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.category-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-glass);
  color: var(--text-muted);
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s;
}

.category-chip.active {
  background: rgba(232, 201, 155, 0.2);
  border-color: var(--gold-glow);
  color: var(--gold-glow);
}

.compose-textarea {
  width: 100%;
  height: 130px;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-glass);
  border-radius: 12px;
  padding: 1rem;
  color: var(--text-main);
  font-family: inherit;
  font-size: 1.05rem;
  line-height: 1.7;
  resize: none;
  outline: none;
  direction: rtl;
  user-select: text;
  transition: border-color 0.2s;
}

.compose-textarea:focus {
  border-color: var(--gold-glow);
}

.compose-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1.25rem;
}

.char-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

@media (max-width: 768px) {
  .ambient-header {
    padding: 1.25rem;
  }
  .logo-title {
    font-size: 1.5rem;
  }
  .glass-card {
    padding: 1.75rem 1.25rem;
  }
  .card-text {
    font-size: 1.1rem;
  }
}