/* DZ Club Manager - Modern Layout Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: var(--font-arabic);
  background-color: var(--bg-app);
  color: var(--text-primary);
  direction: rtl;
  text-align: right;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* App Container Layout */
#app-root {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* Sidebar Styles */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  right: 0;
  z-index: 50;
  transition: width var(--transition-smooth), transform var(--transition-smooth);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed-width);
}

.sidebar-header {
  height: var(--header-height);
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-light);
  gap: 0.75rem;
}

.club-brand-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  overflow: hidden;
  text-decoration: none;
}

.club-avatar-logo {
  width: 42px;
  height: 42px;
  min-width: 42px;
  max-width: 42px;
  max-height: 42px;
  border-radius: var(--radius-md);
  object-fit: contain;
  border: 1.5px solid var(--border-light);
  background-color: #ffffff;
  padding: 2px;
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition-normal);
  display: block;
}

.club-info-text {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  white-space: nowrap;
}

.club-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
}

.club-season-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sidebar-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.sidebar-toggle-btn:hover {
  background-color: var(--bg-hover);
  color: var(--club-primary);
  border-color: var(--club-primary);
}

/* Sidebar Nav */
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.nav-section-title {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 0.6rem 0.75rem 0.35rem;
  letter-spacing: 0.5px;
}

.sidebar.collapsed .nav-section-title,
.sidebar.collapsed .club-info-text,
.sidebar.collapsed .nav-item-label,
.sidebar.collapsed .nav-badge {
  display: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.65rem 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all var(--transition-fast);
  position: relative;
  cursor: pointer;
  border: none;
  background: transparent;
  width: 100%;
  text-align: right;
}

.nav-item svg {
  width: 20px;
  height: 20px;
  stroke-width: 2;
  flex-shrink: 0;
  transition: color var(--transition-fast);
}

.nav-item:hover {
  background-color: var(--bg-hover);
  color: var(--club-primary);
}

.nav-item.active {
  background-color: var(--club-primary-light);
  color: var(--club-primary);
  font-weight: 700;
}

.nav-item.active::before {
  content: '';
  position: absolute;
  right: -0.75rem;
  top: 15%;
  height: 70%;
  width: 4px;
  border-radius: 4px 0 0 4px;
  background-color: var(--club-primary);
}

.nav-badge {
  margin-right: auto;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface-subtle);
  color: var(--text-secondary);
  font-family: var(--font-num);
  font-weight: 700;
}

.nav-item.active .nav-badge {
  background-color: var(--club-primary);
  color: var(--text-inverse);
}

/* Sidebar Footer */
.sidebar-footer {
  padding: 0.75rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  background: var(--bg-surface);
}

.platform-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(5,150,105,0.08) 0%, rgba(16,185,129,0.04) 100%);
  border: 1px solid rgba(5,150,105,0.15);
}

.platform-logo-small {
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  background: var(--brand-dark);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
}

.platform-text {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--brand-dark);
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  margin-right: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  transition: margin-right var(--transition-smooth);
}

.sidebar.collapsed ~ .main-wrapper {
  margin-right: var(--sidebar-collapsed-width);
}

/* Top App Header */
.top-header {
  height: var(--header-height);
  background-color: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.75rem;
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(8px);
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.view-page-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.view-page-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* Quick Search in Header */
.header-search-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-full);
  width: 260px;
  transition: all var(--transition-fast);
}

.header-search-bar:focus-within {
  background-color: var(--bg-surface);
  border-color: var(--club-primary);
  box-shadow: 0 0 0 3px rgba(var(--club-primary-rgb), 0.12);
  width: 320px;
}

.header-search-bar input {
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 0.85rem;
  width: 100%;
  color: var(--text-primary);
}

.header-search-bar input::placeholder {
  color: var(--text-muted);
}

.keyboard-shortcut-tag {
  font-size: 0.8rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: 4px;
  padding: 2px 5px;
  color: var(--text-muted);
  font-family: monospace;
}

/* Header Actions & Profile */
.header-btn {
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
  width: 38px;
  height: 38px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  position: relative;
  transition: all var(--transition-fast);
}

.header-btn:hover {
  background-color: var(--bg-hover);
  color: var(--club-primary);
}

.header-btn .notification-dot {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--danger);
  border: 2px solid var(--bg-surface);
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.75rem 0.35rem 0.5rem;
  background: var(--bg-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.user-profile-menu:hover {
  border-color: var(--border-medium);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--club-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
}

.user-details {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.user-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-primary);
}

.user-role-label {
  font-size: 0.8rem;
  color: var(--club-primary);
  font-weight: 600;
}

/* Page Content Viewport */
.content-body {
  flex: 1;
  padding: 1.75rem;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
}

/* Mobile Responsiveness */
@media (max-width: 1024px) {
  .sidebar {
    transform: translateX(100%);
    width: 280px !important;
  }
  
  .sidebar.mobile-open {
    transform: translateX(0);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.2);
  }
  
  .main-wrapper {
    margin-right: 0 !important;
  }
  
  .header-search-bar {
    display: none;
  }
}
