/**
 * Y Community - Components CSS
 * רכיבים משותפים לכל האתר
 * גרסה 1.0 - 2025
 */

/* ========================================
   EMOJI & ICONS
   ======================================== */

.emoji {
  display: inline-block;
}

.emoji-large {
  font-size: var(--font-size-6xl, 3.75rem);
  display: block;
  text-align: center;
  margin-bottom: var(--spacing-md);
}

.emoji-medium {
  font-size: var(--font-size-3xl, 1.875rem);
  display: inline-block;
}

.emoji-small {
  font-size: var(--font-size-2xl, 1.5rem);
  display: inline-block;
}

/* ========================================
   LOADING SPINNERS
   ======================================== */

.loading-spinner {
  display: none;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm, 0.5rem);
  color: var(--brand-text-muted, #3aa06a);
  font-style: italic;
  flex-direction: column;
}

.loading-spinner.show {
  display: flex;
}

.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--brand-dark-200, #b8eacc);
  border-top: 3px solid var(--brand-primary-light, #a0df50);
  border-radius: var(--radius-full, 50%);
  animation: spin 1s linear infinite;
}

.spinner-medium {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

.spinner-large {
  width: 60px;
  height: 60px;
  border-width: 5px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ========================================
   PROGRESS BARS
   ======================================== */

.progress-container {
  width: 100%;
  margin: var(--spacing-md, 1rem) 0;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: var(--brand-dark-200, #b8eacc);
  border-radius: var(--radius-xs, 4px);
  overflow: hidden;
  margin: var(--spacing-sm, 0.5rem) 0;
}

.progress-fill {
  height: 100%;
  background: var(--brand-gradient-primary, linear-gradient(135deg, #013024 0%, #2a8054 50%, #a0df50 100%));
  border-radius: var(--radius-xs, 4px);
  transition: width 0.3s ease;
}

/* ========================================
   STAT ICONS
   ======================================== */

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm, 8px);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--font-size-lg, 1.25rem);
}

.stat-icon-primary {
  background: var(--brand-light-100, #ecfccb);
  color: var(--brand-primary-light, #a0df50);
}

.stat-icon-success {
  background: var(--brand-light-100, #ecfccb);
  color: var(--brand-primary-light, #a0df50);
}

.stat-icon-warning {
  background: var(--brand-warning-light, #fef3c7);
  color: var(--brand-warning, #fbbf24);
}

.stat-icon-info {
  background: var(--brand-light-100, #ecfccb);
  color: var(--brand-primary-light, #a0df50);
}

/* ========================================
   TEXT UTILITIES
   ======================================== */

.text-muted {
  color: var(--brand-text-muted, #3aa06a);
  font-size: 0.875rem;
}

.text-small {
  font-size: 0.875rem;
  color: var(--brand-text-secondary, #236644);
}

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

/* ========================================
   MARGIN & PADDING UTILITIES
   ======================================== */

.mt-sm {
  margin-top: var(--spacing-sm, 0.5rem);
}

.mt-md {
  margin-top: var(--spacing-md, 1rem);
}

.mt-lg {
  margin-top: var(--spacing-lg, 1.5rem);
}

.mb-sm {
  margin-bottom: var(--spacing-sm, 0.5rem);
}

.mb-md {
  margin-bottom: var(--spacing-md, 1rem);
}

.mb-lg {
  margin-bottom: var(--spacing-lg, 1.5rem);
}

.mb-8px {
  margin-bottom: 8px;
}

.mt-05 {
  margin-top: 0.5rem;
}

.mt-1 {
  margin-top: 1rem;
}

/* ========================================
   DISPLAY UTILITIES
   ======================================== */

.hidden {
  display: none !important;
}

.show {
  display: block !important;
}

.flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.gap-8 {
  gap: 8px;
}

/* ========================================
   GRID UTILITIES
   ======================================== */

.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.grid-center {
  text-align: center;
  padding: 10px;
  background: var(--brand-dark-50, #f0f9f4);
  border-radius: 8px;
}

/* ========================================
   BORDER & BACKGROUND UTILITIES
   ======================================== */

.border-right-brand {
  border-right: 4px solid var(--brand-primary-light, #a0df50);
}

.bg-white {
  background: var(--brand-white, #ffffff);
  padding: 20px;
  border-radius: 8px;
}

.border-brand-light {
  border: 1px solid var(--brand-border-light, #b8eacc);
  border-radius: 12px;
  margin: 15px 0;
}

/* ========================================
   COLOR UTILITIES
   ======================================== */

.color-success {
  color: var(--brand-primary-light, #a0df50);
}

.color-warning {
  color: var(--brand-warning, #fbbf24);
}

.color-error {
  color: var(--brand-error, #ef4444);
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

/* ========================================
   DISABLED INPUT
   ======================================== */

.disabled-input {
  background: var(--brand-dark-50, #f0f9f4) !important;
  opacity: 0.7 !important;
  cursor: not-allowed;
}

/* ========================================
   LINE HEIGHT UTILITIES
   ======================================== */

.line-height-normal {
  line-height: 1.6;
}

.line-height-tight {
  line-height: 1.4;
}

.line-height-loose {
  line-height: 1.8;
}

/* ========================================
   PADDING UTILITIES
   ======================================== */

.pr-20 {
  padding-right: 20px;
}

.p-10 {
  padding: 10px;
}

/* ========================================
   STAT BOXES
   ======================================== */

.stat-box {
  text-align: center;
  padding: 10px;
  background: var(--brand-dark-50, #f0f9f4);
  border-radius: 8px;
}

.stat-box-brand {
  text-align: center;
  padding: 10px;
  background: var(--brand-dark-50, #f0f9f4);
  border-radius: 8px;
}

.stat-box-brand strong {
  color: var(--brand-primary-light, #a0df50);
}

/* ========================================
   TEXT CONTENT
   ======================================== */

.text-content {
  line-height: 1.6;
}

/* ========================================
   TEMPLATE BUTTONS
   ======================================== */

.template-label {
  margin-bottom: 8px;
  display: block;
  color: var(--brand-text-muted, #3aa06a);
  font-size: 0.875rem;
}

.template-buttons-container {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ========================================
   CONTENT COUNT
   ======================================== */

.content-count-bold {
  font-weight: bold;
  color: var(--brand-primary-dark, #013024);
}

/* ========================================
   TEXT ALIGN
   ======================================== */

.text-center {
  text-align: center;
}

.text-right {
  text-align: right;
}

.text-left {
  text-align: left;
}

/* ========================================
   LINK BRAND
   ======================================== */

.link-brand {
  color: var(--brand-primary-dark, #013024);
  text-decoration: none;
  transition: color 0.3s ease;
}

.link-brand:hover {
  color: var(--brand-primary-light, #a0df50);
}

/* ========================================
   HEADER BRAND
   ======================================== */

.header-brand {
  background: var(--brand-gradient-hero, linear-gradient(135deg, #013024 0%, #236644 25%, #2a8054 50%, #65a30d 75%, #a0df50 100%));
  color: white;
  padding: 2rem;
  text-align: center;
  box-shadow: var(--brand-shadow-lg, 0 12px 24px rgba(1, 48, 36, 0.15));
}

/* ========================================
   TABLE HEADER
   ======================================== */

.table-header-row {
  background: var(--brand-bg-secondary, #f0f9f4);
  font-weight: bold;
}

.table-header-cell {
  text-align: center;
}

/* ========================================
   CHART CONTAINER
   ======================================== */

.chart-container-height {
  height: 300px;
}

/* ========================================
   MARGIN TOP UTILITIES
   ======================================== */

.mt-05 {
  margin-top: 0.5rem;
}

/* ========================================
   INPUT HIDDEN
   ======================================== */

.input-hidden {
  display: none;
}

/* ========================================
   TEXT ALIGN RIGHT
   ======================================== */

.text-align-right {
  text-align: right;
  letter-spacing: normal;
}

/* ========================================
   FIXED POSITION
   ======================================== */

.fixed-top {
  position: fixed;
  top: 20px;
  right: 20px;
  left: 20px;
  z-index: 1000;
}

.fixed-bottom {
  position: fixed;
  bottom: 20px;
  right: 20px;
  left: 20px;
  z-index: 1000;
}

/* ========================================
   SUBTITLE TEXT
   ======================================== */

.subtitle-text {
  font-size: 1.2rem;
  opacity: 0.9;
}

/* ========================================
   MUTED TEXT
   ======================================== */

.text-muted-gray {
  color: var(--brand-text-muted, #636e72);
  margin-bottom: var(--spacing-md, 1rem);
}

/* ========================================
   TEXT TRANSFORM
   ======================================== */

.text-transform-none {
  text-transform: none;
}

/* ========================================
   FIXED MESSAGES
   ======================================== */

.fixed-messages {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  max-width: 400px;
}

.fixed-progress {
  position: fixed;
  bottom: 20px;
  left: 20px;
  right: 20px;
  z-index: 10000;
}

/* ========================================
   RESULTS CONTAINER
   ======================================== */

.results-center {
  text-align: center;
  padding: 3rem;
}

.results-center-large {
  text-align: center;
  margin-bottom: 2rem;
}

.results-center-top {
  text-align: center;
  margin-top: 2rem;
}

.emoji-huge {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.text-white {
  color: white;
}

.text-white-muted {
  color: rgba(255, 255, 255, 0.8);
}

.text-white-light {
  color: rgba(255, 255, 255, 0.6);
}

.button-max-width {
  max-width: 300px;
}

.mb-md {
  margin-bottom: 1rem;
}

.mb-lg {
  margin-bottom: 2rem;
}

.mt-lg {
  margin-top: 2rem;
}

/* ========================================
   ICON LARGE
   ======================================== */

.icon-large {
  font-size: 2rem;
  margin-bottom: 10px;
}

/* ========================================
   TEXT SMALL MUTED
   ======================================== */

.text-small-muted {
  font-size: 0.8rem;
  opacity: 0.8;
}

/* ========================================
   STAT ICON VARIANTS
   ======================================== */

.stat-icon-success {
  background: var(--brand-light-100, #ecfccb);
  color: var(--brand-primary-light, #a0df50);
}

.stat-icon-green {
  background: var(--brand-success-light, #dcfce7);
  color: var(--brand-success, #10b981);
}

.stat-icon-warning {
  background: var(--brand-warning-light, #fef3c7);
  color: var(--brand-warning, #f59e0b);
}

.stat-icon-warning-dark {
  background: var(--brand-warning-light, #fef3c7);
  color: var(--brand-warning-dark, #92400e);
}

.stat-icon-success-dark {
  background: var(--brand-success-light, #d1fae5);
  color: var(--brand-success-dark, #065f46);
}

/* ========================================
   GRID COLUMN
   ======================================== */

.grid-column-full {
  grid-column: 1 / -1;
}

/* ========================================
   TEXT MARGIN RESET
   ======================================== */

.text-no-margin {
  margin: 0;
}

.text-small-margin {
  margin: 5px 0 0 0;
}

/* ========================================
   TEXTAREA MIN HEIGHT
   ======================================== */

.textarea-min-height {
  min-height: 200px;
}

/* ========================================
   STAT ICON BRAND
   ======================================== */

.stat-icon-brand {
  background: var(--brand-light-100, #ecfccb);
  color: var(--brand-primary-dark, #013024);
}

.stat-icon-purple {
  background: var(--brand-dark-100, #ede9fe);
  color: var(--brand-dark-600, #8b5cf6);
}

/* ========================================
   MODAL CONTENT
   ======================================== */

.modal-content-margin {
  margin-bottom: 1rem;
}

.modal-content-text {
  color: var(--brand-text-muted, #3aa06a);
  font-size: 0.875rem;
}

.modal-content-box {
  background: var(--brand-dark-50, #f0f9f4);
  padding: 1rem;
  border-radius: 0.5rem;
}

.modal-image {
  max-width: 100%;
  border-radius: 0.5rem;
}

/* ========================================
   LOADING CONTAINER
   ======================================== */

.loading-container {
  padding: 2rem;
  text-align: center;
}

/* ========================================
   WARNING BOX
   ======================================== */

.warning-box {
  margin-top: var(--spacing-md, 1rem);
  padding: var(--spacing-sm, 0.5rem);
  background: var(--warning-bg, rgba(255, 193, 7, 0.1));
  border: 1px solid var(--warning-border, rgba(255, 193, 7, 0.3));
  border-radius: var(--radius-xs, 4px);
  font-size: var(--font-size-sm, 0.875rem);
  color: var(--warning-text, #856404);
}

/* ========================================
   DEMO TEXT
   ======================================== */

.demo-text {
  color: var(--brand-text-muted, #3aa06a);
  font-size: 0.875rem;
  font-style: italic;
}

/* ========================================
   BUTTON ICON REMOVE
   ======================================== */

.btn-icon-remove {
  margin-right: auto;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--spacing-xs, 0.25rem);
  color: var(--text-muted, #3aa06a);
  transition: var(--transition-fast);
}

.btn-icon-remove:hover {
  color: var(--error-color, #ef4444);
  transform: scale(1.1);
}

.btn-icon-remove:focus {
  outline: 2px solid var(--brand-primary-light, #a0df50);
  outline-offset: 2px;
  border-radius: var(--radius-xs, 4px);
}

/* ========================================
   APP RATING BADGE
   ======================================== */

.app-rating {
  background: rgba(255, 255, 255, 0.2);
  padding: 4px 8px;
  border-radius: var(--radius-md, 12px);
  font-size: var(--font-size-xs, 0.75rem);
  display: inline-block;
}

/* ========================================
   STAT NUMBER LARGE
   ======================================== */

.stat-number-large {
  font-size: var(--font-size-xl, 1.5rem);
  color: var(--brand-primary-light, #a0df50);
  font-weight: bold;
  margin-bottom: var(--spacing-xs, 0.25rem);
}

.stat-icon-brand {
  color: var(--brand-primary-light, #a0df50);
}

/* ========================================
   BUTTONS SYSTEM
   ======================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-sm);
  padding: var(--spacing-sm) var(--spacing-md);
  font-size: var(--font-size-base);
  font-weight: 600;
  line-height: 1.5;
  text-align: center;
  text-decoration: none;
  border: 2px solid transparent;
  border-radius: var(--radius-full, 50px);
  cursor: pointer;
  transition: var(--transition-normal);
  user-select: none;
  min-height: 44px; /* Accessibility - minimum touch target */
  box-shadow: var(--shadow-medium);
}

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

/* Button variants - מבוססי צבעי המותג */
.btn-primary {
  background: var(--brand-primary-light, #a0df50);
  color: var(--brand-primary-dark, #013024);
  border-color: var(--brand-primary-light, #a0df50);
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-light-500, #84cc16);
  transform: translateY(-2px) scale(1.02);
  box-shadow: var(--shadow-heavy), 0 0 var(--spacing-lg, 1.5rem) rgba(160, 223, 80, 0.3);
  color: var(--brand-primary-dark, #013024);
  text-decoration: none;
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: var(--shadow-medium);
}

.btn-secondary {
  background: var(--white-overlay-20, rgba(255, 255, 255, 0.2));
  color: var(--background-primary);
  border-color: var(--white-overlay-30, rgba(255, 255, 255, 0.3));
}

.btn-secondary:hover:not(:disabled) {
  background: var(--white-overlay-30, rgba(255, 255, 255, 0.3));
  transform: translateY(-2px);
  box-shadow: var(--shadow-heavy);
  text-decoration: none;
}

.btn-large {
  padding: var(--spacing-lg, 1.5rem) var(--spacing-2xl, 2.5rem);
  font-size: var(--font-size-lg, 1.25rem);
}

.btn-icon {
  font-size: 1.2em;
}

.btn-outline {
  background: transparent;
  color: var(--brand-primary-dark, #013024);
  border: 2px solid var(--brand-primary-dark, #013024);
}

.btn-outline:hover {
  background: var(--brand-primary-dark, #013024);
  color: var(--brand-white, #ffffff);
}

/* Focus States */
.btn:focus {
  outline: 2px solid var(--brand-primary-light, var(--brand-accent));
  outline-offset: 2px;
}

.btn:disabled:hover {
  transform: none !important;
}

/* ========================================
   LOADING STATES
   ======================================== */

#loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--background-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  transition: opacity 0.3s ease;
}

.loading-content {
  text-align: center;
}

.loading-text {
  color: var(--text-secondary);
  margin: 0;
}

/* ========================================
   RESPONSIVE UTILITIES
   ======================================== */

@media (max-width: 768px) {
  .emoji-large {
    font-size: 3rem;
  }

  .emoji-medium {
    font-size: 2rem;
  }

  .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }

  .btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
  }
}

