/* ============================================================
   GLOBALNI CSS - Centralizovani stilovi za ceo web
   ============================================================ */

:root {
  /* Colors */
  --color-bg: #0f172a;
  --color-surface: #1e293b;
  --color-surface-light: #334155;
  --color-text: #e2e8f0;
  --color-text-muted: #94a3b8;
  
  /* Accent colors */
  --accent: #3b82f6;
  --accent-hover: #2563eb;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #0ea5e9;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Z-index layers */
  --z-toast: 10000;
  --z-modal: 9999;
  --z-dropdown: 1000;
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */

.toast-container {
  position: fixed;
  right: 20px;
  bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: var(--z-toast);
  pointer-events: none;
  max-width: 400px;
}

.toast {
  pointer-events: auto;
  background: var(--color-surface);
  color: var(--color-text);
  padding: 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-xl);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-left: 4px solid var(--info);
  opacity: 0;
  transform: translateX(10px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  max-width: 100%;
}

.toast-icon {
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding: 4px;
}

.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
  line-height: 1.4;
}

.toast-message {
  font-size: 13px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

.toast-close {
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  font-size: 18px;
  line-height: 1;
  padding: 2px;
  flex-shrink: 0;
}

.toast-close:hover {
  opacity: 1;
}

/* Toast types */
.toast-success {
  border-left-color: var(--success);
}

.toast-success .toast-icon {
  color: var(--success);
  background: rgba(16, 185, 129, 0.1);
}

.toast-error {
  border-left-color: var(--danger);
}

.toast-error .toast-icon {
  color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.toast-warning {
  border-left-color: var(--warning);
}

.toast-warning .toast-icon {
  color: var(--warning);
  background: rgba(245, 158, 11, 0.1);
}

.toast-info {
  border-left-color: var(--info);
}

.toast-info .toast-icon {
  color: var(--info);
  background: rgba(14, 165, 233, 0.1);
}

/* ============================================================
   MODAL DIALOGS (CONFIRM, ALERTS)
   ============================================================ */

.ui-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.ui-modal-overlay.show {
  opacity: 1;
}

.ui-modal {
  background: var(--color-surface);
  color: var(--color-text);
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 440px;
  box-shadow: var(--shadow-xl);
  transform: scale(0.95);
  transition: transform 0.2s ease-in-out;
}

.ui-modal-overlay.show .ui-modal {
  transform: scale(1);
}

.ui-modal-icon {
  font-size: 48px;
  text-align: center;
  margin-bottom: 16px;
}

.ui-modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  line-height: 1.4;
}

.ui-modal-message {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 1.6;
}

.ui-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Modal types */
.ui-modal-danger .ui-modal-title {
  color: var(--danger);
}

.ui-modal-warning .ui-modal-title {
  color: var(--warning);
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  gap: 8px;
}

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

.btn-primary {
  background: var(--accent);
  color: white;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-secondary {
  background: var(--color-surface-light);
  color: var(--color-text);
}

.btn-secondary:hover:not(:disabled) {
  background: #475569;
}

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

.btn-danger:hover:not(:disabled) {
  background: #dc2626;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border: 1px solid var(--color-surface-light);
}

.btn-ghost:hover:not(:disabled) {
  background: var(--color-surface-light);
}

/* ============================================================
   UTILITY CLASSES
   ============================================================ */

.hidden {
  display: none !important;
}

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

.text-success {
  color: var(--success);
}

.text-danger {
  color: var(--danger);
}

.text-warning {
  color: var(--warning);
}

.text-info {
  color: var(--info);
}

/* Responsive */
@media (max-width: 640px) {
  .toast-container {
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }
  
  .toast {
    max-width: 100%;
  }
  
  .ui-modal {
    width: 95%;
    padding: 20px;
  }
  
  .ui-modal-actions {
    flex-direction: column-reverse;
  }
  
  .btn {
    width: 100%;
  }
}
