/* ============================================
   Conference Manager - Frontend Styles (RTL)
   ============================================ */

:root {
  --cm-primary: #2563eb;
  --cm-primary-dark: #1e40af;
  --cm-accent: #f59e0b;
  --cm-text: #1e293b;
  --cm-text-muted: #64748b;
  --cm-bg: #f8fafc;
  --cm-card-bg: #ffffff;
  --cm-border: #e2e8f0;
  --cm-success: #10b981;
  --cm-error: #ef4444;
  --cm-warning: #f59e0b;
  --cm-radius: 12px;
  --cm-shadow: 0 4px 24px rgba(0,0,0,0.08);
  --cm-shadow-hover: 0 8px 40px rgba(37,99,235,0.15);
}

.cm-widget { font-family: -apple-system, 'Segoe UI', Arial, sans-serif; direction: rtl; color: var(--cm-text); }

/* ---- Cards ---- */
.cm-list { display: flex; flex-direction: column; gap: 20px; }
.cm-cols-2 { display: grid; grid-template-columns: repeat(2,1fr); gap: 24px; }
.cm-cols-3 { display: grid; grid-template-columns: repeat(3,1fr); gap: 24px; }
.cm-cols-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 20px; }

@media (max-width: 768px) {
  .cm-cols-2, .cm-cols-3, .cm-cols-4 { grid-template-columns: 1fr; }
}

.cm-card {
  background: var(--cm-card-bg);
  border-radius: var(--cm-radius);
  border: 1px solid var(--cm-border);
  box-shadow: var(--cm-shadow);
  padding: 24px;
  transition: transform 0.2s, box-shadow 0.2s;
  cursor: pointer;
}
.cm-card:hover { transform: translateY(-3px); box-shadow: var(--cm-shadow-hover); }

.cm-card-header { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 12px; }

.cm-date-badge {
  background: var(--cm-primary);
  color: #fff;
  border-radius: 10px;
  padding: 8px 14px;
  text-align: center;
  min-width: 56px;
  flex-shrink: 0;
}
.cm-date-day { display: block; font-size: 22px; font-weight: 700; line-height: 1; }
.cm-date-month { display: block; font-size: 12px; font-weight: 500; margin-top: 2px; opacity: 0.9; }

.cm-card-info { flex: 1; }
.cm-card-title { font-size: 18px; font-weight: 700; margin: 0 0 6px; color: var(--cm-text); }
.cm-card-meta { display: flex; flex-wrap: wrap; gap: 8px; }
.cm-meta-item { font-size: 13px; color: var(--cm-text-muted); }

.cm-card-desc { font-size: 14px; color: var(--cm-text-muted); line-height: 1.6; margin: 12px 0; }

.cm-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--cm-border); flex-wrap: wrap; gap: 12px; }

.cm-card-stats { display: flex; flex-direction: column; gap: 4px; }
.cm-stat { font-size: 13px; color: var(--cm-text-muted); }
.cm-price { font-size: 18px; font-weight: 700; color: var(--cm-primary); }

.cm-progress-bar { background: var(--cm-border); border-radius: 4px; height: 6px; width: 120px; margin-bottom: 4px; overflow: hidden; }
.cm-progress-fill { height: 100%; background: var(--cm-primary); border-radius: 4px; transition: width 0.5s; }

/* ---- Buttons ---- */
.cm-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 20px; border-radius: 8px; border: none;
  font-size: 14px; font-weight: 600; cursor: pointer;
  transition: all 0.2s; white-space: nowrap;
}
.cm-btn-primary { background: var(--cm-primary); color: #fff; }
.cm-btn-primary:hover { background: var(--cm-primary-dark); transform: translateY(-1px); }
.cm-btn-large { padding: 14px 32px; font-size: 16px; border-radius: 10px; }
.cm-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

/* ---- Modal ---- */
.cm-modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 20px; }
.cm-modal-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); }
.cm-modal-container {
  position: relative; background: var(--cm-card-bg); border-radius: 20px;
  box-shadow: 0 24px 80px rgba(0,0,0,0.25); max-width: 680px; width: 100%;
  max-height: 90vh; overflow-y: auto; animation: cm-slide-up 0.3s ease;
}
@keyframes cm-slide-up { from { opacity:0; transform: translateY(30px); } to { opacity:1; transform: translateY(0); } }

.cm-modal-close {
  position: sticky; top: 16px; float: left; margin: 16px 16px 0 0;
  background: var(--cm-bg); border: none; width: 36px; height: 36px;
  border-radius: 50%; cursor: pointer; font-size: 16px; z-index: 1;
  transition: background 0.2s; color: var(--cm-text);
}
.cm-modal-close:hover { background: var(--cm-border); }
.cm-modal-body { padding: 24px; }

/* ---- Single Conference ---- */
.cm-single-conference { max-width: 800px; margin: 0 auto; }
.cm-single-header { background: linear-gradient(135deg, var(--cm-primary), var(--cm-primary-dark)); color: #fff; border-radius: var(--cm-radius); padding: 40px; margin-bottom: 32px; }
.cm-single-title { font-size: 32px; font-weight: 800; margin: 0 0 20px; }
.cm-single-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; }
.cm-meta-pill { background: rgba(255,255,255,0.2); padding: 6px 14px; border-radius: 20px; font-size: 14px; font-weight: 500; }
.cm-price-pill { background: var(--cm-accent); color: #1e293b; font-weight: 700; }
.cm-single-desc { font-size: 16px; line-height: 1.7; opacity: 0.9; margin: 0; }

/* ---- Agenda Timeline ---- */
.cm-agenda, .cm-registration-form { background: var(--cm-card-bg); border-radius: var(--cm-radius); border: 1px solid var(--cm-border); padding: 32px; margin-bottom: 28px; box-shadow: var(--cm-shadow); }
.cm-section-title { font-size: 22px; font-weight: 700; margin: 0 0 24px; color: var(--cm-text); }

.cm-timeline { display: flex; flex-direction: column; gap: 0; }
.cm-timeline-item { display: grid; grid-template-columns: 80px 24px 1fr; gap: 0 16px; padding: 12px 0; position: relative; }
.cm-timeline-item::before { content: ''; position: absolute; right: 88px; top: 0; bottom: 0; width: 2px; background: var(--cm-border); z-index: 0; }
.cm-timeline-item:last-child::before { height: 50%; }
.cm-timeline-item:first-child::before { top: 50%; }

.cm-timeline-time { text-align: left; font-size: 13px; font-weight: 600; color: var(--cm-primary); padding-top: 2px; }
.cm-timeline-dot { width: 14px; height: 14px; background: var(--cm-primary); border-radius: 50%; border: 3px solid var(--cm-card-bg); box-shadow: 0 0 0 2px var(--cm-primary); align-self: start; margin-top: 4px; z-index: 1; position: relative; }
.cm-break .cm-timeline-dot { background: var(--cm-border); box-shadow: 0 0 0 2px var(--cm-border); }
.cm-timeline-content { padding-bottom: 4px; }
.cm-timeline-content strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.cm-speaker, .cm-room { display: inline-block; font-size: 13px; color: var(--cm-text-muted); margin-left: 12px; }

/* ---- Registration Form ---- */
.cm-form { direction: rtl; }
.cm-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
@media (max-width: 600px) { .cm-form-row { grid-template-columns: 1fr; } }
.cm-form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.cm-form-group label { font-size: 14px; font-weight: 600; color: var(--cm-text); }
.cm-form-group input, .cm-form-group select, .cm-form-group textarea {
  padding: 10px 14px; border: 2px solid var(--cm-border); border-radius: 8px;
  font-size: 15px; transition: border-color 0.2s; background: var(--cm-bg);
  direction: rtl; font-family: inherit;
}
.cm-form-group input:focus { border-color: var(--cm-primary); outline: none; background: #fff; }

.cm-form-message { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 16px; display: none; }
.cm-form-message.success { background: #d1fae5; color: #065f46; display: block; }
.cm-form-message.error   { background: #fee2e2; color: #991b1b; display: block; }

/* ---- Calendar ---- */
.cm-calendar { background: var(--cm-card-bg); border-radius: var(--cm-radius); border: 1px solid var(--cm-border); box-shadow: var(--cm-shadow); overflow: hidden; }
.cm-cal-header { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; background: var(--cm-primary); color: #fff; }
.cm-cal-title { font-size: 18px; font-weight: 700; margin: 0; }
.cm-cal-nav { background: rgba(255,255,255,0.2); border: none; color: #fff; width: 36px; height: 36px; border-radius: 50%; font-size: 20px; cursor: pointer; transition: background 0.2s; }
.cm-cal-nav:hover { background: rgba(255,255,255,0.35); }
.cm-cal-grid { display: grid; grid-template-columns: repeat(7,1fr); text-align: center; background: var(--cm-bg); }
.cm-cal-dayname { padding: 10px; font-size: 13px; font-weight: 600; color: var(--cm-text-muted); }
.cm-cal-days { display: grid; grid-template-columns: repeat(7,1fr); padding: 8px; gap: 4px; }
.cm-cal-day { min-height: 70px; border-radius: 8px; padding: 6px; cursor: default; transition: background 0.15s; }
.cm-cal-day.other-month { opacity: 0.3; }
.cm-cal-day.today { background: var(--cm-bg); border: 2px solid var(--cm-primary); }
.cm-cal-day-num { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.cm-cal-event { background: var(--cm-primary); color: #fff; font-size: 11px; border-radius: 4px; padding: 2px 6px; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.cm-cal-event:hover { background: var(--cm-primary-dark); }
.cm-cal-event-info { padding: 16px 24px; border-top: 1px solid var(--cm-border); background: var(--cm-bg); }

/* ---- Notices ---- */
.cm-notice { padding: 14px 18px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.cm-notice-warning { background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }
.cm-empty { text-align: center; padding: 48px; color: var(--cm-text-muted); font-size: 16px; }

/* ---- Loading spinner ---- */
.cm-loading { text-align: center; padding: 48px; color: var(--cm-text-muted); }
.cm-spinner { width: 40px; height: 40px; border: 4px solid var(--cm-border); border-top-color: var(--cm-primary); border-radius: 50%; animation: cm-spin 0.8s linear infinite; margin: 0 auto 16px; }
@keyframes cm-spin { to { transform: rotate(360deg); } }
