/* MODERN LOGIN PANEL */
#loginPage {
  display: none !important;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  padding: 40px 20px;
  background: #f4f6f9;
}

#loginPage.active {
  display: flex !important;
}

.modern-login-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  padding: 50px 40px;
  border-radius: 24px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  text-align: center;
  max-width: 440px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.3);
  position: relative;
  margin: 0 auto;
}

.modern-login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, #667eea, #764ba2, #4ecdc4, #45b7d1);
}

.modern-login-header {
  margin-bottom: 35px;
}

.modern-login-header h3 {
  color: #2d3748;
  font-size: 1.8em;
  font-weight: 700;
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.modern-login-header p {
  color: #718096;
  font-size: 1.1em;
  margin: 0;
  line-height: 1.5;
}

.modern-login-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.modern-login-input {
  width: 100%;
  padding: 16px 18px;
  border: 2px solid #e2e8f0;
  border-radius: 14px;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.3s;
  box-sizing: border-box;
  background: #f8fafc;
  color: #2d3748;
  font-family: inherit;
}

.modern-login-input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
  outline: none;
  transform: translateY(-2px);
}

.modern-login-input::placeholder {
  color: #a0aec0;
}

.modern-login-btn {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  padding: 18px 30px;
  border: none;
  border-radius: 14px;
  color: white;
  font-size: 1.1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
  margin-top: 10px;
  font-family: inherit;
  position: relative;
  overflow: hidden;
}

.modern-login-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.6s;
}

.modern-login-btn:hover::before {
  left: 100%;
}

.modern-login-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(102, 126, 234, 0.5);
}

.modern-login-btn:active {
  transform: translateY(-1px);
}

.modern-login-btn.loading {
  pointer-events: none;
  opacity: 0.8;
}

.modern-login-btn.loading::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid white;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-left: 8px;
}

.modern-login-footer {
  margin-top: 25px;
  padding-top: 25px;
  border-top: 1px solid #e2e8f0;
}

.modern-back-btn {
  background: linear-gradient(135deg, #a0aec0 0%, #718096 100%) !important;
  padding: 14px 25px;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 15px rgba(113, 128, 150, 0.3);
  width: 100%;
}

.modern-back-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(113, 128, 150, 0.4);
}

/* MODERN MODAL DESIGN */
.edit-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(10px);
}

.edit-modal-content {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  margin: 5vh auto;
  border-radius: 20px;
  width: 95%;
  max-width: 480px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.edit-modal-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 25px;
  text-align: center;
  position: relative;
}

.edit-modal-header h3 {
  margin: 0;
  color: white;
  font-size: 1.5em;
  font-weight: 700;
}

.edit-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: white;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
  background: rgba(255,255,255,0.2);
}

.edit-close:hover {
  background: rgba(255,255,255,0.3);
  transform: rotate(90deg);
}

.edit-modal-body {
  padding: 30px;
}

.car-info-card {
  background: white;
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.05);
  display: flex;
  gap: 15px;
  align-items: center;
}

.car-image-preview img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 12px;
  border: 3px solid #e9ecef;
}

.car-details h4 {
  margin: 0 0 12px 0;
  color: #2d3748;
  font-size: 1.3em;
  font-weight: 700;
}

.price-info-grid {
  display: grid;
  gap: 8px;
}

.price-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
}

.price-label {
  color: #718096;
  font-size: 0.9em;
  font-weight: 500;
}

.price-value {
  color: #2d3748;
  font-weight: 600;
  font-size: 0.95em;
}

.sale-form {
  background: white;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
  border: 1px solid rgba(0,0,0,0.05);
}

.form-group {
  margin-bottom: 25px;
}

.form-group label {
  display: block;
  margin-bottom: 12px;
  color: #2d3748;
  font-weight: 600;
  font-size: 1.1em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.price-input-container {
  position: relative;
}

.price-input-container::before {
  content: '$';
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #667eea;
  font-weight: bold;
  font-size: 1.1em;
  z-index: 2;
}

.form-group input {
  width: 100%;
  padding: 15px 15px 15px 40px;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  box-sizing: border-box;
  background: #f8fafc;
}

.form-group input:focus {
  border-color: #667eea;
  background: white;
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
  outline: none;
}

.price-hint {
  font-size: 0.85em;
  color: #a0aec0;
  margin-top: 8px;
  text-align: center;
}

.profit-calc {
  background: linear-gradient(135deg, #4ecdc4 0%, #44a08d 100%);
  color: white;
  padding: 20px;
  border-radius: 12px;
  margin-top: 20px;
}

.profit-header {
  text-align: center;
  margin-bottom: 15px;
  font-weight: 600;
  font-size: 1.1em;
  opacity: 0.9;
}

.profit-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.2);
}

.profit-row:last-child {
  border-bottom: none;
}

.profit-row.total {
  font-weight: 700;
  font-size: 1.2em;
  padding-top: 12px;
  margin-top: 8px;
  border-top: 2px solid rgba(255,255,255,0.3);
}

.edit-modal-footer {
  display: flex;
  gap: 15px;
  padding: 25px 30px;
  background: rgba(248, 250, 252, 0.8);
  border-top: 1px solid rgba(0,0,0,0.05);
}

.btn-cancel {
  flex: 1;
  background: linear-gradient(135deg, #a0aec0 0%, #718096 100%) !important;
  padding: 15px;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-cancel:hover {
  transform: translateY(-2px);
}

.btn-confirm-sale {
  flex: 2;
  background: linear-gradient(135deg, #48bb78 0%, #38a169 100%) !important;
  padding: 15px;
  border: none;
  border-radius: 12px;
  color: white;
  font-size: 1em;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-confirm-sale:hover {
  transform: translateY(-2px);
}

/* KÉP MODAL */
.image-modal {
  display: none;
  position: fixed;
  z-index: 10000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(10px);
}

.modal-content {
  display: block;
  margin: auto;
  max-width: 90%;
  max-height: 90%;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}

.close-modal {
  position: absolute;
  top: 20px;
  right: 35px;
  color: #f1f1f1;
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10001;
  background: rgba(0,0,0,0.5);
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s;
}

.close-modal:hover {
  background: rgba(0,0,0,0.8);
  transform: scale(1.1);
}

/* Admin history section - alapértelmezetten rejtve */
#adminHistorySection {
  display: none !important;
}

/* Csak admin bejelentkezéskor jelenik meg */
.logged-in.admin #adminHistorySection {
  display: block !important;
}

/* Napló stílusok */
.history-container {
  background: white;
  border-radius: 12px;
  padding: 0;
  max-height: 400px;
  overflow-y: auto;
}

.history-item {
  padding: 20px;
  border-bottom: 1px solid #f1f5f9;
  transition: all 0.3s ease;
}

.history-item:last-child {
  border-bottom: none;
}

.history-item:hover {
  background: #f8fafc;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.history-member-name {
  font-weight: 700;
  color: #2d3748;
  font-size: 1.1em;
}

.history-date {
  color: #718096;
  font-size: 0.9em;
  background: #f7fafc;
  padding: 4px 8px;
  border-radius: 6px;
}

.history-reason {
  color: #4a5568;
  line-height: 1.5;
  margin-bottom: 8px;
  background: #f8fafc;
  padding: 12px;
  border-radius: 8px;
  border-left: 4px solid #e53e3e;
}

.history-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85em;
  color: #a0aec0;
}

.history-kicked-by {
  font-weight: 600;
  color: #e53e3e;
}

.history-empty {
  text-align: center;
  padding: 40px 20px;
  color: #718096;
}

.history-empty::before {
  content: '📝';
  font-size: 3em;
  display: block;
  margin-bottom: 15px;
  opacity: 0.5;
}

/* KITŰZŐ MODAL STÍLUSOK */
.badge-add-form {
  background: white;
  border-radius: 16px;
  padding: 25px;
  margin-bottom: 25px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
}

.badge-add-form h4 {
  color: #2d3748;
  margin-bottom: 20px;
  font-size: 1.3em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 20px;
}

.badge-card {
  background: white;
  border-radius: 16px;
  padding: 25px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  border: 1px solid #e2e8f0;
  transition: all 0.3s ease;
  position: relative;
}

.badge-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0,0,0,0.15);
}

.badge-rank-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 15px;
  padding-bottom: 15px;
  border-bottom: 2px solid #f1f5f9;
}

.badge-rank-icon {
  font-size: 2em;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  color: white;
}

.badge-rank-info {
  flex: 1;
}

.badge-rank-name {
  font-size: 1.3em;
  font-weight: 700;
  color: #2d3748;
  margin: 0 0 5px 0;
}

.badge-members-count {
  color: #718096;
  font-size: 0.9em;
  font-weight: 500;
}

/* Admin-only megjegyzés rész */
.badge-note-section {
  margin-top: 15px;
  padding: 15px;
  background: #f8fafc;
  border-radius: 12px;
  border-left: 4px solid #667eea;
}

.badge-note-label {
  font-weight: 600;
  color: #4a5568;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.badge-note-content {
  color: #2d3748;
  line-height: 1.5;
  font-size: 0.95em;
  white-space: pre-line;
  word-wrap: break-word;
}

.badge-note-empty {
  color: #a0aec0;
  font-style: italic;
  font-size: 0.9em;
}

/* Művelet gombok - CSAK ADMIN */
.badge-actions {
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge-edit-btn {
  background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(237, 137, 54, 0.3);
  width: 100%;
}

.badge-edit-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(237, 137, 54, 0.4);
}

/* Törlés gomb stílus */
.badge-delete-btn {
  background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
  padding: 8px 16px;
  border: none;
  border-radius: 8px;
  color: white;
  font-size: 0.85em;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 2px 8px rgba(229, 62, 62, 0.3);
  width: 100%;
}

.badge-delete-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(229, 62, 62, 0.4);
}

/* Textarea stílus a szerkesztéshez */
.badge-add-form textarea {
  white-space: pre-wrap;
  font-family: inherit;
  line-height: 1.5;
}

/* Automatikus mentés státusz */
.auto-save-status {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 10000;
  padding: 10px 15px;
  border-radius: 8px;
  font-size: 0.9em;
  background: #48bb78;
  color: white;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.auto-save-status.error {
  background: #e53e3e;
}

/* Tag történet gomb jobb oldali pozicionálása 10px-el lejjebb */
.form-header-with-filters {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 25px;
  padding: 0 20px;
  flex-wrap: wrap;
  gap: 15px;
  position: relative;
}

.form-title {
  flex: 1;
}

.form-title h2 {
  margin: 0;
  text-align: left;
}

.compact-filters-row {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: flex-end;
  margin-top: 10px;
}

#historyButton {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  position: relative;
  top: 10px;
  font-size: 14px;
  height: 40px;
  min-width: 120px;
  justify-content: center;
}

#historyButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Kitűző gomb stílus */
#badgeButton {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
  border: none;
  border-radius: 10px;
  color: white;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
  position: relative;
  top: 10px;
  font-size: 14px;
  height: 40px;
  min-width: 120px;
  justify-content: center;
}

#badgeButton:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Bejelentkezés után megjelenik */
.logged-in.admin #historyButton,
.logged-in.admin #badgeButton {
  display: flex !important;
}

/* ... meglévő stílusok ... */

/* Galéria ár módosítás modal */
#editGalleryPriceModal {
  display: none;
}

#editGalleryPriceModal.edit-modal {
  z-index: 10001;
}