/* ==========================================================================
   TURNAMEN VOLI - ADMIN DASHBOARD & CONTROL PANEL CSS
   ========================================================================== */

/* Admin Shell Layout */
.admin-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Admin Sidebar */
.admin-sidebar {
  width: 260px;
  background: #0f172a;
  color: white;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: var(--transition);
}

.sidebar-header {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid #1e293b;
}

.sidebar-brand {
  font-size: 1.2rem;
  font-weight: 700;
  color: white;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.8rem 1rem;
  color: #94a3b8;
  border-radius: var(--radius-sm);
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.sidebar-link:hover, .sidebar-link.active {
  background: var(--primary);
  color: white;
}

.sidebar-footer {
  padding: 1.25rem;
  border-top: 1px solid #1e293b;
}

.btn-logout {
  width: 100%;
  background: #ef4444;
  color: white;
  border: none;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  transition: var(--transition);
}

.btn-logout:hover {
  background: #dc2626;
}

/* Admin Main Content Wrapper */
.admin-content {
  margin-left: 260px;
  flex: 1;
  padding: 2rem;
  background: var(--bg-main);
  min-height: 100vh;
  transition: var(--transition);
}

/* Admin Header Bar */
.admin-topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
  background: white;
  padding: 1rem 1.5rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
}

.admin-user-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.admin-avatar {
  width: 40px;
  height: 40px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

/* Form Styles inside Modals / Cards */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.4rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
  padding: 1rem;
  overflow-y: auto;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-dialog {
  background: white;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 540px;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: var(--transition);
  overflow: hidden;
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  margin: auto;
}

.modal-overlay.active .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-main);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--accent-loss);
}

.modal-body {
  padding: 1.5rem;
  overflow-y: auto;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}

.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  background: var(--bg-subtle);
  flex-shrink: 0;
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: white;
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 280px;
  border-left: 4px solid var(--primary);
  animation: slideInRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast-success {
  border-left-color: var(--accent-win);
}

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

.toast-icon {
  font-size: 1.25rem;
}

.toast-success .toast-icon {
  color: var(--accent-win);
}

.toast-error .toast-icon {
  color: var(--accent-loss);
}

.toast-message {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-main);
}

@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Score Input Specific Styling */
.score-input-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  padding: 1.5rem 0;
}

.score-team-box {
  flex: 1;
  text-align: center;
}

.score-team-name {
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.75rem;
  color: var(--text-main);
}

.score-number-input {
  width: 90px;
  height: 80px;
  font-size: 2.2rem;
  font-weight: 800;
  text-align: center;
  border: 2px solid var(--border-color);
  border-radius: var(--radius);
  background: var(--bg-subtle);
  transition: var(--transition);
}

.score-number-input:focus {
  border-color: var(--primary);
  background: white;
  box-shadow: 0 0 0 4px var(--primary-glow);
}

.score-vs-divider {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text-muted);
  background: var(--bg-subtle);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Sidebar Toggle & Mobile Backdrop */
.admin-sidebar-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  color: var(--text-main);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.admin-sidebar-toggle:hover {
  background: var(--primary-light);
  color: var(--primary);
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.25rem;
  transition: var(--transition);
}

.sidebar-close-btn:hover {
  color: white;
}

.sidebar-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.sidebar-backdrop.active {
  opacity: 1;
  visibility: visible;
}

@media (max-width: 992px) {
  .admin-sidebar-toggle {
    display: flex;
  }

  .sidebar-close-btn {
    display: block;
  }

  .admin-sidebar {
    transform: translateX(-100%);
    box-shadow: var(--shadow-lg);
  }

  .admin-sidebar.open {
    transform: translateX(0);
  }

  .admin-content {
    margin-left: 0;
    padding: 1.25rem;
  }
}

@media (max-width: 600px) {
  .modal-overlay {
    padding: 0.5rem;
  }

  .modal-dialog {
    max-height: 94vh;
    border-radius: var(--radius);
  }

  .modal-header {
    padding: 0.85rem 1rem;
  }

  .modal-title {
    font-size: 1rem;
  }

  .modal-body {
    padding: 1rem 0.85rem;
  }

  .modal-footer {
    padding: 0.75rem 1rem;
    flex-wrap: wrap;
  }

  .modal-footer .btn {
    flex: 1;
    min-width: 120px;
  }

  .score-input-container {
    gap: 0.5rem;
    padding: 0.5rem 0;
  }

  .score-number-input {
    width: 68px;
    height: 60px;
    font-size: 1.6rem;
  }

  .score-team-name {
    font-size: 0.9rem;
  }
}
