/* ==========================================================================
   MOODLE PLAYER USERS - 1:1 EXACT STYLES (Mantine & Custom Theme)
   Reference: https://moodleplayerusers.com
   ========================================================================== */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background-color: #f6f9fc;
  color: #2a3547;
  min-height: 100vh;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  -webkit-font-smoothing: antialiased;
}

/* App Main Container */
.mp-container {
  width: 100%;
  max-width: 500px;
  min-height: 100vh;
  padding: 16px 14px 140px; /* space for dual floating docks */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ==========================================================================
   HEADER
   ========================================================================== */
.mp-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-bottom: 18px;
  padding-top: 4px;
}

.mp-header-title {
  font-size: 22px;
  font-weight: 700;
  color: #2a3547;
  letter-spacing: -0.3px;
  text-align: center;
}

.mp-header-branch-wrap {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

.mp-header-branch-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(93, 135, 255, 0.1);
  border: 1px solid rgba(93, 135, 255, 0.25);
  border-radius: 9999px;
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #5d87ff;
  cursor: pointer;
  transition: all 0.15s ease;
}

.mp-header-branch-pill:hover {
  background: rgba(93, 135, 255, 0.18);
}

.mp-header-chevron {
  transition: transform 0.2s ease;
}

.mp-header-branch-pill.open .mp-header-chevron {
  transform: rotate(180deg);
}

/* Dropdown Popup Menu */
.mp-header-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 220px;
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
  border: 1px solid #e5eaee;
  padding: 6px;
  z-index: 250;
  display: none;
  animation: ddFadeIn 0.15s ease-out;
}

.mp-header-dropdown.show {
  display: block;
}

@keyframes ddFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

.mp-dropdown-header {
  padding: 8px 12px 6px;
  font-size: 11px;
  font-weight: 700;
  color: #7c8fac;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid #f6f9fc;
  margin-bottom: 4px;
}

.mp-dropdown-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: transparent;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: #2a3547;
  cursor: pointer;
  text-align: left;
  transition: background 0.12s;
}

.mp-dropdown-item:hover {
  background: #f6f9fc;
}

.mp-dropdown-item.mp-dd-danger {
  color: #fa5252;
}

.mp-dropdown-item.mp-dd-danger:hover {
  background: #fff5f5;
}

/* ==========================================================================
   CARDS & SECTIONS
   ========================================================================== */
.mp-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 22px 18px;
  margin-bottom: 16px;
  border: 1px solid #e5eaee;
}

.mp-card-title {
  font-size: 18px;
  font-weight: 700;
  color: #2a3547;
  margin-bottom: 4px;
}

.mp-card-subtitle {
  font-size: 13px;
  color: #5a6a85;
  margin-bottom: 16px;
}

/* Search Box */
.mp-search-wrap {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 14px;
}

.mp-search-icon {
  position: absolute;
  left: 12px;
  color: #7c8fac;
  pointer-events: none;
}

.mp-search-input {
  width: 100%;
  height: 40px;
  padding: 0 14px 0 38px;
  background: #ffffff;
  border: 1px solid #e5eaee;
  border-radius: 8px;
  font-size: 13.5px;
  color: #2a3547;
  outline: none;
  transition: border-color 0.15s;
}

.mp-search-input:focus {
  border-color: #5d87ff;
}

/* ==========================================================================
   VIEW 1: LOGIN CARD (Exact 1:1 with MoodlePlayerUsers)
   ========================================================================== */
.login-view-wrapper {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #5D87FF 0%, #49BEFF 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 1000;
  overflow-y: auto;
}

.mp-login-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 40px 32px 32px;
  border: 1px solid #e5eaee;
  width: 100%;
  max-width: 420px;
  text-align: center;
}

.mp-login-title {
  font-size: 24px;
  font-weight: 700;
  color: #2a3547;
  margin-bottom: 2px;
}

.mp-login-subtitle {
  font-size: 16px;
  color: #7c8fac;
  margin-bottom: 2px;
  font-weight: 500;
}

.mp-login-welcome {
  font-size: 13.5px;
  color: #7c8fac;
  margin-bottom: 24px;
}

.mp-form-group {
  text-align: left;
  margin-bottom: 16px;
}

.mp-form-label {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: #2a3547;
  margin-bottom: 6px;
}

.mp-input-wrap {
  width: 100%;
}

.mp-form-input {
  width: 100%;
  height: 42px;
  padding: 0 14px;
  background: #ffffff;
  border: 1px solid #e5eaee;
  border-radius: 7px;
  font-size: 14px;
  color: #2a3547;
  outline: none;
  transition: all 0.15s;
}

.mp-form-input:focus {
  border-color: #5d87ff;
}

.mp-login-btn {
  width: 100%;
  height: 44px;
  background: #5d87ff;
  color: #ffffff;
  border: none;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}

.mp-login-btn:hover {
  background: #4570ea;
}

/* ==========================================================================
   VIEW 2: BRANCH (Şube) LIST
   ========================================================================== */
.mp-branch-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mp-branch-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e5eaee;
  border-radius: 14px;
  transition: all 0.15s;
}

.mp-branch-item:hover {
  border-color: #5d87ff;
  background: #fcfdff;
}

.mp-branch-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mp-branch-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eef4ff;
  color: #5d87ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-branch-info {
  display: flex;
  flex-direction: column;
}

.mp-branch-name {
  font-size: 15.5px;
  font-weight: 700;
  color: #2a3547;
}

.mp-branch-type {
  font-size: 12px;
  color: #5a6a85;
}

.mp-btn-blue {
  padding: 8px 20px;
  background: #5d87ff;
  color: #ffffff;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}

.mp-btn-blue:hover {
  background: #4570ea;
}

/* ==========================================================================
   VIEW 3: DEVICES LIST
   ========================================================================== */
.mp-device-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #ffffff;
  border: 1px solid #e5eaee;
  border-radius: 14px;
  margin-bottom: 10px;
}

.mp-device-left {
  display: flex;
  align-items: center;
  gap: 14px;
}

.mp-device-icon-box {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #eef4ff;
  color: #5d87ff;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mp-device-name {
  font-size: 15px;
  font-weight: 700;
  color: #2a3547;
  margin-bottom: 4px;
}

.mp-device-badges {
  display: flex;
  align-items: center;
  gap: 6px;
}

.mp-badge-online {
  font-size: 10.5px;
  font-weight: 700;
  color: #13deb9;
  background: #e8f7ff;
  padding: 2px 7px;
  border-radius: 4px;
}

.mp-badge-player-count {
  font-size: 10.5px;
  font-weight: 700;
  color: #5d87ff;
  background: #eef4ff;
  padding: 2px 7px;
  border-radius: 4px;
}

/* ==========================================================================
   VIEW 4: PLAYER CATEGORIES & ACCORDIONS (Exact 1:1)
   ========================================================================== */
.mp-category-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 16px 14px;
  margin-bottom: 16px;
  border: 1px solid #e5eaee;
}

.mp-category-title {
  font-size: 15.5px;
  font-weight: 700;
  color: #2a3547;
  margin-bottom: 12px;
  padding-left: 2px;
}

.mp-player-row {
  border: 1px solid #e5eaee;
  border-radius: 14px;
  margin-bottom: 8px;
  overflow: hidden;
  background: #ffffff;
  transition: all 0.15s ease;
}

.mp-player-row.open {
  border-color: #cbd5e1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.mp-player-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
}

.mp-player-header:hover {
  background: #f8fafc;
}

.mp-player-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
}

.mp-sound-box {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: #eef4ff;
  color: #5d87ff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.15s;
}

.mp-player-row.is-playing .mp-sound-box {
  background: #e8f7ff;
  color: #13deb9;
}

.mp-player-name-text {
  font-size: 13.5px;
  font-weight: 600;
  color: #2a3547;
}

.mp-accordion-chevron {
  color: #7c8fac;
  transition: transform 0.2s ease;
}

.mp-player-row.open .mp-accordion-chevron {
  transform: rotate(180deg);
}

/* Accordion Body */
.mp-player-body {
  display: none;
  padding: 16px 14px;
  background: #ffffff;
  border-top: 1px solid #f6f9fc;
}

.mp-player-row.open .mp-player-body {
  display: block;
}

/* Sliders Section */
.mp-slider-group {
  margin-bottom: 14px;
}

.mp-slider-label {
  font-size: 13px;
  font-weight: 700;
  color: #2a3547;
  margin-bottom: 8px;
  display: block;
}

.mp-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mp-slider-input {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: #e5eaee;
  outline: none;
}

.mp-slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  border: 3.5px solid #5d87ff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(93, 135, 255, 0.3);
}

.mp-slider-value-box {
  min-width: 44px;
  height: 34px;
  border: 1px solid #e5eaee;
  border-radius: 8px;
  background: #f6f9fc;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: #2a3547;
}

/* Single Play / Pause Button */
.mp-single-action-wrap {
  margin-top: 14px;
}

.mp-action-btn {
  width: 100%;
  height: 42px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}

.mp-btn-duraklat {
  background: #5d87ff;
  color: #ffffff;
}

.mp-btn-duraklat:hover {
  background: #4570ea;
}

.mp-player-row.is-playing .mp-btn-duraklat {
  background: #fa896b;
}

.mp-player-row.is-playing .mp-btn-duraklat:hover {
  background: #f3704d;
}

/* ==========================================================================
   FLOATING BOTTOM NAVIGATION DOCK (1:1 with Screenshot)
   ========================================================================== */
.mp-bottom-dock-wrapper {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 24px);
  max-width: 480px;
  z-index: 100;
}

.mp-dock-tabs {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.02);
  border: 1px solid #e5eaee;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 10px 8px 8px;
}

.mp-dock-tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px 2px;
  color: #5a6a85;
  transition: all 0.15s ease;
}

.mp-dock-icon {
  stroke: #5a6a85;
  color: #5a6a85;
  transition: all 0.15s ease;
}

.mp-dock-label {
  font-size: 11px;
  font-weight: 500;
  color: #5a6a85;
  white-space: nowrap;
  letter-spacing: -0.1px;
  transition: all 0.15s ease;
}

.mp-dock-tab-btn:hover {
  color: #2a3547;
}

.mp-dock-tab-btn:hover .mp-dock-icon {
  stroke: #2a3547;
  color: #2a3547;
}

.mp-dock-tab-btn:hover .mp-dock-label {
  color: #2a3547;
}

.mp-dock-tab-btn.active {
  color: #5d87ff;
}

.mp-dock-tab-btn.active .mp-dock-icon {
  stroke: #5d87ff;
  color: #5d87ff;
}

.mp-dock-tab-btn.active .mp-dock-label {
  color: #5d87ff;
  font-weight: 600;
}

/* ==========================================================================
   TABLES & SUB-VIEWS (1:1 with moodleplayerusers.com)
   ========================================================================== */
.mp-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin-top: 10px;
  border-radius: 10px;
  border: 1px solid #e5eaee;
}

.mp-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 13.5px;
}

.mp-table th {
  background: #f6f9fc;
  color: #5a6a85;
  font-weight: 700;
  padding: 12px 14px;
  border-bottom: 1px solid #e5eaee;
  font-size: 12.5px;
}

.mp-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f6f9fc;
  color: #2a3547;
}

.mp-table-empty {
  text-align: center;
  padding: 36px 16px !important;
  color: #7c8fac;
  font-size: 13.5px;
  font-weight: 500;
}

.mp-empty-box {
  background: #f6f9fc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 36px 16px;
  text-align: center;
  color: #7c8fac;
  font-size: 13.5px;
  font-weight: 500;
}

.players-device-container {
  width: 100%;
}

/* Toast */
.mp-toast {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%) translateY(-30px);
  background: #2a3547;
  color: #ffffff;
  padding: 9px 18px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
  z-index: 300;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.mp-toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
