/* Современный светлый дизайн личного кабинета */

:root {
  --primary-blue: #667eea;
  --secondary-purple: #764ba2;
  --success-green: #10B981;
  --warning-yellow: #F59E0B;
  --danger-red: #EF4444;
  --bg-gray: #F9FAFB;
  --sidebar-width: 60px;
}

body {
  margin: 0;
  padding: 0;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: #374151;
  background: #f6f8fa;
}

/* Header styles - светлый белый */
.wa-header {
  background: white;
  color: #1f2937;
  padding: 20px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  border-bottom: 1px solid #e5e7eb;
}

.wa-header__logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.wa-header__logo-img {
  width: 32px;
  height: 32px;
}

.wa-header__logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1f2937;
}

.wa-header__right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.wa-header__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.4);
}

.wa-header__status-text {
  color: #6b7280;
  font-size: 0.875rem;
}

.wa-header__logout {
  background: #f3f4f6;
  color: #374151;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.wa-header__logout:hover {
  background: #e5e7eb;
  transform: translateY(-1px);
}

.wa-header__analytics-btn {
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-purple) 100%);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
}

.wa-header__analytics-btn:hover {
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Компактный sidebar - 60px */
.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-purple) 100%);
  color: white;
  min-height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 100;
  transition: left 0.3s ease;
}

.avatar-circle {
  width: 60px;
  height: 60px;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0 auto 0.5rem;
  border: 2px solid rgba(255,255,255,0.3);
}

/* Main content с отступом для компактного sidebar */
.main-content {
  margin-left: var(--sidebar-width);
  min-height: 100vh;
  background: var(--bg-gray);
}


/* Tab content */
.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Loading spinner */
.loading-spinner {
  border: 3px solid #f3f3f3;
  border-top: 3px solid #667eea;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Mobile styles - компактный дизайн */
@media (max-width: 1023px) {
  :root {
    --sidebar-mobile: 240px;
  }
  
  .sidebar {
    width: var(--sidebar-mobile);
    left: calc(-1 * var(--sidebar-mobile));
  }
  
  .sidebar.open {
    left: 0;
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .wa-header {
    margin-left: 0;
  }
  
  .mobile-menu {
    display: block;
  }
  
  /* На мобилке показываем аватар section */
  .sidebar .avatar-section {
    display: block !important;
  }
  
  /* Header adjustments */
  .wa-header {
    padding: 1rem;
    flex-wrap: wrap;
  }
  
  .wa-header__analytics-btn {
    padding: 6px 12px;
    font-size: 0.875rem;
  }
  
  .wa-header__analytics-btn span {
    display: none;
  }
  
  .wa-header__right {
    flex-wrap: wrap;
    gap: 0.5rem;
  }
  
  .wa-header__logout {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
  
  /* Responsive grid */
  .grid-cols-1.md\\:grid-cols-2 {
    grid-template-columns: 1fr !important;
  }
  
  .flex.gap-4.col-span-2 {
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  .flex.gap-4.col-span-2 button {
    width: 100% !important;
    margin: 0 !important;
  }
  
  /* Typography */
  .text-3xl.font-bold {
    font-size: 1.75rem !important;
  }
  
  .text-2xl.font-bold {
    font-size: 1.5rem !important;
  }
  
  /* Cards */
  .bg-white.rounded-2xl.shadow-lg {
    padding: 1.5rem !important;
    margin: 0.5rem !important;
  }
}

/* Very small screens */
@media (max-width: 480px) {
  .wa-header__status-text {
    display: none;
  }
  
  .bg-white.rounded-2xl.shadow-lg {
    margin: 0.25rem !important;
    border-radius: 1rem !important;
  }
  
  .main-content .p-6 {
    padding: 1rem !important;
  }
  
  .avatar-circle {
    width: 50px;
    height: 50px;
    font-size: 1.25rem;
  }
}

/* Tablet adaptations */
@media (min-width: 769px) and (max-width: 1024px) {
  .sidebar {
    width: 240px;
  }
  
  .main-content {
    margin-left: 240px;
  }
  
  .grid-cols-1.sm\\:grid-cols-2.lg\\:grid-cols-4 {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

/* Touch-friendly interactions */
@media (hover: none) and (pointer: coarse) {
  button, 
  .cursor-pointer,
  a {
    min-height: 44px;
    min-width: 44px;
  }
  
  input[type="text"],
  input[type="password"],
  input[type="email"] {
    font-size: 16px; /* Prevents zoom on iOS */
    padding: 0.75rem;
  }
  
  /* Remove hover effects on touch devices */
  .hover\\:-translate-y-1:hover {
    transform: none !important;
  }
  
  .tab-button:hover {
    background: rgba(255,255,255,0.05);
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  .bg-white {
    background-color: #1f2937 !important;
    color: #f9fafb !important;
  }
  
  .text-gray-900 {
    color: #f9fafb !important;
  }
  
  .text-gray-700 {
    color: #d1d5db !important;
  }
  
  .text-gray-600 {
    color: #9ca3af !important;
  }
  
  .text-gray-500 {
    color: #6b7280 !important;
  }
  
  .border-gray-300 {
    border-color: #4b5563 !important;
  }
  
  .bg-gray-100 {
    background-color: #374151 !important;
  }
  
  .bg-gray-50 {
    background-color: #374151 !important;
  }
}

/* Accessibility improvements */
.tab-button:focus {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 2px;
}

button:focus,
input:focus {
  outline: 2px solid #6366f1;
  outline-offset: 2px;
}

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Print styles */
@media print {
  .sidebar,
  .mobile-menu,
  .wa-header {
    display: none !important;
  }
  
  .main-content {
    margin-left: 0 !important;
  }
  
  .tab-content {
    display: block !important;
  }
}
