/* ═══════════════════════════════════════════════════════════════
   Studio Management System — Shared Stylesheet
   Version: 1.0 | Hebrew RTL | Mobile-First
   ═══════════════════════════════════════════════════════════════ */

/* ── CSS Variables ──────────────────────────────────────────── */
:root {
  /* Primary palette */
  --color-primary:       #1B4F72;
  --color-primary-dark:  #154360;
  --color-primary-light: #D6EAF8;
  --color-accent:        #2E86C1;
  --color-accent-hover:  #1A6FA1;

  /* Status colors */
  --color-green:         #1E8449;
  --color-green-light:   #D5F5E3;
  --color-green-bg:      #EAFAF1;
  --color-orange:        #D35400;
  --color-orange-light:  #FDEBD0;
  --color-orange-bg:     #FEF9E7;
  --color-red:           #C0392B;
  --color-red-light:     #FADBD8;
  --color-red-bg:        #FDEDEC;

  /* Neutrals */
  --color-white:         #FFFFFF;
  --color-bg:            #F4F6F9;
  --color-bg-card:       #FFFFFF;
  --color-border:        #D5D8DC;
  --color-text:          #1C2833;
  --color-text-secondary:#5D6D7E;
  --color-text-muted:    #909497;

  /* Typography */
  --font-family:         'Rubik', 'Arial', sans-serif;
  --font-size-xs:        12px;
  --font-size-sm:        13px;
  --font-size-base:      15px;
  --font-size-md:        16px;
  --font-size-lg:        18px;
  --font-size-xl:        22px;
  --font-size-2xl:       26px;
  --font-size-3xl:       32px;

  /* Spacing */
  --space-xs:   4px;
  --space-sm:   8px;
  --space-md:   16px;
  --space-lg:   24px;
  --space-xl:   32px;
  --space-2xl:  48px;

  /* Border radius */
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --radius-full:9999px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 12px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 24px rgba(0,0,0,0.12);

  /* Bottom nav height */
  --bottom-nav-height: 64px;
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  direction: rtl;
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

ul, ol { list-style: none; }

img { max-width: 100%; display: block; }

button {
  font-family: var(--font-family);
  cursor: pointer;
  border: none;
  outline: none;
}

input, textarea, select {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  outline: none;
  direction: rtl;
}

/* ── Layout ─────────────────────────────────────────────────── */
.app-wrapper {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--color-bg);
  position: relative;
}

.page-content {
  padding: var(--space-md);
  padding-bottom: calc(var(--bottom-nav-height) + var(--space-lg));
}

/* ── Top Header ─────────────────────────────────────────────── */
.top-header {
  background: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-md) var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}

.top-header__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  letter-spacing: -0.3px;
}

.top-header__subtitle {
  font-size: var(--font-size-sm);
  opacity: 0.8;
  margin-top: 2px;
}

.top-header__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: var(--font-size-md);
  color: white;
  flex-shrink: 0;
}

/* ── Bottom Navigation ──────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  height: var(--bottom-nav-height);
  background: var(--color-white);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: stretch;
  z-index: 200;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--color-text-muted);
  font-size: var(--font-size-xs);
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s;
  padding: 8px 0;
}

.bottom-nav__item svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
}

.bottom-nav__item.active {
  color: var(--color-accent);
}

.bottom-nav__item--cta {
  color: var(--color-white);
}

.bottom-nav__cta-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: var(--color-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(46,134,193,0.4);
  transition: transform 0.15s;
}

.bottom-nav__cta-wrap:hover { transform: scale(1.05); }
.bottom-nav__item--cta span { color: var(--color-text-muted); font-size: var(--font-size-xs); }

/* ── Cards ──────────────────────────────────────────────────── */
.card {
  background: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(0,0,0,0.04);
}

.card + .card,
.card + * { margin-top: var(--space-md); }

.card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-sm);
}

.card__title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card__value {
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.2;
}

.card__sub {
  font-size: var(--font-size-sm);
  color: var(--color-text-secondary);
  margin-top: 2px;
}

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: 12px var(--space-lg);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  transition: all 0.15s;
  cursor: pointer;
  border: 2px solid transparent;
  text-decoration: none;
  min-height: 48px;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
  border-color: var(--color-accent);
}
.btn-primary:hover {
  background: var(--color-accent-hover);
  border-color: var(--color-accent-hover);
  text-decoration: none;
}

.btn-secondary {
  background: transparent;
  color: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-secondary:hover {
  background: var(--color-primary-light);
  text-decoration: none;
}

.btn-danger {
  background: var(--color-red);
  color: var(--color-white);
  border-color: var(--color-red);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
  padding: 8px var(--space-md);
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 8px var(--space-md);
  font-size: var(--font-size-sm);
  min-height: 36px;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  flex-shrink: 0;
}

/* ── Forms ──────────────────────────────────────────────────── */
.form-group {
  margin-bottom: var(--space-md);
}

.form-label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px var(--space-md);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-white);
  transition: border-color 0.15s, box-shadow 0.15s;
  min-height: 48px;
}

.form-input:focus {
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(46,134,193,0.12);
}

.form-input::placeholder { color: var(--color-text-muted); }

/* ── Status Badges ──────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-green  { background: var(--color-green-light);  color: var(--color-green); }
.badge-orange { background: var(--color-orange-light); color: var(--color-orange); }
.badge-red    { background: var(--color-red-light);    color: var(--color-red); }
.badge-blue   { background: var(--color-primary-light);color: var(--color-accent); }

/* ── Alert / Info Box ───────────────────────────────────────── */
.alert {
  padding: var(--space-md);
  border-radius: var(--radius-md);
  font-size: var(--font-size-sm);
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  line-height: 1.5;
}

.alert-info    { background: var(--color-primary-light); color: var(--color-primary-dark); border-right: 3px solid var(--color-accent); }
.alert-warning { background: var(--color-orange-light);  color: var(--color-orange);       border-right: 3px solid var(--color-orange); }
.alert-success { background: var(--color-green-light);   color: var(--color-green);        border-right: 3px solid var(--color-green); }
.alert-danger  { background: var(--color-red-light);     color: var(--color-red);          border-right: 3px solid var(--color-red); }

.alert-icon {
  font-size: 18px;
  flex-shrink: 0;
  line-height: 1;
  margin-top: 1px;
}

/* ── Progress Bar ───────────────────────────────────────────── */
.progress-bar-wrap {
  background: var(--color-bg);
  border-radius: var(--radius-full);
  height: 8px;
  overflow: hidden;
  margin-top: var(--space-sm);
}

.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary));
  transition: width 0.4s ease;
}

/* ── Section Title ──────────────────────────────────────────── */
.section-title {
  font-size: var(--font-size-base);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* ── Tabs ───────────────────────────────────────────────────── */
.tabs {
  display: flex;
  background: var(--color-bg);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  margin-bottom: var(--space-md);
}

.tab-btn {
  flex: 1;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-text-secondary);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.tab-btn.active {
  background: var(--color-white);
  color: var(--color-accent);
  box-shadow: var(--shadow-sm);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ── Empty State ────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--color-text-secondary);
}

.empty-state__icon {
  font-size: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.6;
}

.empty-state__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
}

.empty-state__text {
  font-size: var(--font-size-sm);
  line-height: 1.6;
  margin-bottom: var(--space-lg);
}

/* ── Modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--color-white);
  width: 100%;
  max-width: 480px;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-lg);
  padding-bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0));
  transform: translateY(100%);
  transition: transform 0.25s ease;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal__handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  margin: 0 auto var(--space-md);
}

.modal__title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  margin-bottom: var(--space-md);
  text-align: center;
}

/* ── Divider ────────────────────────────────────────────────── */
.divider {
  height: 1px;
  background: var(--color-border);
  margin: var(--space-md) 0;
}

/* ── Utility classes ────────────────────────────────────────── */
.text-primary   { color: var(--color-primary); }
.text-accent    { color: var(--color-accent); }
.text-secondary { color: var(--color-text-secondary); }
.text-muted     { color: var(--color-text-muted); }
.text-green     { color: var(--color-green); }
.text-orange    { color: var(--color-orange); }
.text-red       { color: var(--color-red); }
.text-sm        { font-size: var(--font-size-sm); }
.text-xs        { font-size: var(--font-size-xs); }
.text-lg        { font-size: var(--font-size-lg); }
.text-xl        { font-size: var(--font-size-xl); }
.font-bold      { font-weight: 700; }
.font-semibold  { font-weight: 600; }
.text-center    { text-align: center; }

.flex           { display: flex; }
.flex-col       { flex-direction: column; }
.items-center   { align-items: center; }
.justify-between{ justify-content: space-between; }
.gap-sm         { gap: var(--space-sm); }
.gap-md         { gap: var(--space-md); }

.mt-sm  { margin-top: var(--space-sm); }
.mt-md  { margin-top: var(--space-md); }
.mt-lg  { margin-top: var(--space-lg); }
.mb-sm  { margin-bottom: var(--space-sm); }
.mb-md  { margin-bottom: var(--space-md); }
.mb-lg  { margin-bottom: var(--space-lg); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (min-width: 480px) {
  .app-wrapper {
    box-shadow: var(--shadow-lg);
    min-height: 100vh;
  }
  .bottom-nav { max-width: 480px; }
}

/* ── Google Font import ─────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;600;700&display=swap');
