/* profile.css: стили для экрана профиля */

#profile-screen {
  max-width: 750px; /* было 600px, увеличение на 25% */
  margin: 0 auto;
  padding: var(--space-xl);
  min-height: 100vh;
  box-sizing: border-box;
}

#profile-screen h1 {
  margin: 0 0 var(--space-lg) 0;
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  flex-wrap: wrap;
  gap: var(--space-md);
}

#profile-form {
  background: #fff;
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
  max-width: 100%;
}

.profile-field {
  margin-bottom: var(--space-md);
}

.profile-field:last-of-type {
  margin-bottom: var(--space-lg);
}

.profile-field label {
  display: block;
  margin-bottom: var(--space-sm);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  font-size: var(--font-size-base);
}

.profile-field input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid #ddd;
  border-radius: var(--radius-sm);
  font-size: var(--font-size-base);
  height: var(--button-height-md);
  box-sizing: border-box;
}

.profile-field input:disabled {
  background: #f5f5f5;
  color: #666;
  cursor: not-allowed;
}

.profile-field small {
  display: block;
  margin-top: var(--space-xs);
  color: #666;
  font-size: 15px; /* было 12px, увеличение на 25% */
}

#profile-error {
  color: var(--color-danger);
  margin-top: var(--space-sm);
  font-size: var(--font-size-base);
  min-height: 25px; /* было 20px, увеличение на 25% */
}

/* Profile Tabs */
.profile-tabs {
  display: flex;
  gap: 8px;
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  margin-bottom: var(--space-lg);
}

.profile-tab {
  padding: 12px 24px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: -2px;
}

.profile-tab:hover {
  color: var(--color-text);
  background: rgba(0, 0, 0, 0.02);
}

.profile-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

.notification-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--color-danger, #EB5A46);
  color: #fff;
  border-radius: 10px;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  margin-left: 8px;
}

.profile-content {
  min-height: 400px;
}

.profile-tab-content {
  display: none;
}

.profile-tab-content.active {
  display: block;
}

/* Analytics tab - full width */
#profile-tab-analytics {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Make profile screen full width when analytics tab is active */
body:has(#profile-tab-analytics.active) #profile-screen,
#profile-screen.analytics-active {
  max-width: 100%;
  padding-left: var(--space-xl);
  padding-right: var(--space-xl);
}

/* Fallback: if :has() is not supported, use class */
#profile-screen.analytics-active {
  max-width: 100%;
}

/* Analytics filters responsive */
@media (max-width: 1200px) {
  #analytics-filters > div:first-of-type {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 768px) {
  #analytics-filters > div:first-of-type {
    grid-template-columns: 1fr !important;
  }
  
  #analytics-filters > div:nth-of-type(2) {
    grid-template-columns: 1fr !important;
  }
}

/* Notifications */
.notifications-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-md);
}

.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.notification-item {
  background: var(--color-bg-white);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  transition: all 0.2s ease;
  cursor: pointer;
}

.notification-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.notification-item.unread {
  background: rgba(0, 121, 191, 0.03);
  border-left: 4px solid var(--color-primary);
  font-weight: var(--font-weight-medium);
}

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

.notification-message {
  font-size: var(--font-size-base);
  color: var(--color-text);
  margin-bottom: 8px;
  line-height: 1.5;
}

.notification-task-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--color-primary);
  text-decoration: none;
  font-size: 12px;
  word-break: break-all;
  transition: color 0.2s ease;
}

.notification-task-link:hover {
  color: #005a8f;
  text-decoration: underline;
}

.notification-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  font-size: 12px;
  color: var(--color-text-tertiary);
}

.notification-type {
  font-weight: var(--font-weight-medium);
}

.notification-date {
  margin-left: auto;
}

.notification-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.delete-notification-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-tertiary);
}

.empty-state p {
  font-size: var(--font-size-base);
  margin: 0;
}

/* Analytics tags selector - стильный и аккуратный */
.analytics-tags-container {
  position: relative;
  width: 100%;
}

.analytics-tags-display {
  width: 100%;
  min-height: 42px;
  padding: 8px 36px 8px 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
  cursor: pointer;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  transition: all 0.2s ease;
  outline: none;
}

.analytics-tags-display:hover {
  border-color: #bdbdbd;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.analytics-tags-display:focus {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.analytics-tags-display[aria-expanded="true"] {
  border-color: #1976d2;
  box-shadow: 0 0 0 3px rgba(25, 118, 210, 0.1);
}

.analytics-tags-placeholder {
  color: #9e9e9e;
  font-size: 14px;
  user-select: none;
}

.analytics-tags-arrow {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #757575;
  font-size: 12px;
  pointer-events: none;
  transition: transform 0.2s ease;
}

.analytics-tags-display[aria-expanded="true"] .analytics-tags-arrow {
  transform: translateY(-50%) rotate(180deg);
}

/* Tag chips - стильные и аккуратные */
.analytics-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
  color: #1565c0;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  gap: 6px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease;
}

.analytics-tag-chip:hover {
  background: linear-gradient(135deg, #bbdefb 0%, #90caf9 100%);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transform: translateY(-1px);
}

.analytics-tag-label {
  user-select: none;
}

.analytics-tag-remove {
  cursor: pointer;
  font-weight: bold;
  font-size: 16px;
  line-height: 1;
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s ease;
  user-select: none;
}

.analytics-tag-remove:hover {
  background: rgba(21, 101, 192, 0.1);
  transform: scale(1.1);
}

.analytics-tag-remove:active {
  transform: scale(0.95);
}

/* Dropdown - стильный и аккуратный */
.analytics-tags-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  margin-top: 0;
  max-height: 240px;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1), 0 2px 4px rgba(0, 0, 0, 0.06);
  animation: dropdownFadeIn 0.2s ease;
}

.analytics-tags-dropdown.show {
  display: block;
}

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

.analytics-tag-dropdown-item {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  cursor: pointer;
  transition: background-color 0.15s ease;
  border-bottom: 1px solid #f5f5f5;
}

.analytics-tag-dropdown-item:last-child {
  border-bottom: none;
}

.analytics-tag-dropdown-item:hover {
  background: #f5f5f5;
}

.analytics-tag-dropdown-item:active {
  background: #eeeeee;
}

.analytics-tag-dropdown-item input[type="checkbox"] {
  margin: 0;
  margin-right: 10px;
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: #1976d2;
  flex-shrink: 0;
}

.analytics-tag-dropdown-label {
  font-size: 14px;
  color: #424242;
  user-select: none;
  flex: 1;
}

.analytics-tag-dropdown-item:hover .analytics-tag-dropdown-label {
  color: #1976d2;
}

/* Scrollbar для dropdown */
.analytics-tags-dropdown::-webkit-scrollbar {
  width: 8px;
}

.analytics-tags-dropdown::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 4px;
}

.analytics-tags-dropdown::-webkit-scrollbar-thumb {
  background: #bdbdbd;
  border-radius: 4px;
}

.analytics-tags-dropdown::-webkit-scrollbar-thumb:hover {
  background: #9e9e9e;
}

