:root {
  --color-primary: #667eea;
  --color-primary-dark: #5a6fd8;
  --color-background: #f8f9fa;
  --color-surface: #ffffff;
  --color-text: #333333;
  --color-text-secondary: #666666;
  --color-border: #e9ecef;
  --color-shadow: rgba(0, 0, 0, 0.1);
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--color-background);
  color: var(--color-text);
  line-height: 1.6;
}

/* Auth Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  background: linear-gradient(135deg, var(--color-primary) 0%, #764ba2 100%);
  padding: 1rem;
}

.auth-card {
  background: var(--color-surface);
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  width: 100%;
  max-width: 420px;
}

.auth-header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  text-align: center;
}

.auth-header p {
  color: var(--color-text-secondary);
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.auth-form h2 {
  font-size: 1.8rem;
  margin-bottom: 1.5rem;
  color: var(--color-text);
  text-align: center;
}

.form-group {
  margin-bottom: 1.25rem;
}

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

.form-control {
  width: 100%;
  padding: 0.875rem 1rem;
  border: 2px solid var(--color-border);
  border-radius: 0.75rem;
  font-size: 1rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: 0.75rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all 0.2s;
}

.btn--primary {
  background: var(--color-primary);
  color: white;
}

.btn--primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn--secondary {
  background: #6c757d;
  color: white;
}

.btn--secondary:hover {
  background: #5a6268;
}

.btn--full-width {
  width: 100%;
}

.auth-switch {
  text-align: center;
  margin-top: 1.5rem;
  color: var(--color-text-secondary);
}

.auth-switch a {
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 600;
}

/* Main Layout */
.main-container {
  display: flex;
  height: 100vh;
  background: var(--color-background);
}

.sidebar {
  width: 300px;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  display: flex;
  flex-direction: column;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
}

.sidebar-header {
  padding: 2rem 1.5rem;
  border-bottom: 1px solid var(--color-border);
}

.logo {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  margin: 0;
  text-align: center;
}

.sidebar-nav {
  flex: 1;
  padding: 1.5rem 1rem;
}

.nav-item {
  display: flex;
  align-items: center;
  padding: 1rem 1.25rem;
  margin-bottom: 0.5rem;
  border-radius: 1rem;
  text-decoration: none;
  color: var(--color-text-secondary);
  font-weight: 500;
  transition: all 0.2s;
}

.nav-item.active,
.nav-item:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--color-primary);
  transform: translateX(4px);
}

.nav-icon {
  margin-right: 1rem;
  font-size: 1.3rem;
  width: 24px;
  text-align: center;
}

.nav-text {
  font-size: 1rem;
}

.sidebar-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
}

.user-info {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--color-background);
  border-radius: 1rem;
}

.user-avatar, .chat-avatar, .profile-avatar, .tweet-avatar {
  background: linear-gradient(135deg, var(--color-primary), #764ba2);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-transform: uppercase;
}

.user-avatar {
  width: 48px;
  height: 48px;
  margin-right: 1rem;
  font-size: 1rem;
}

.user-details {
  flex: 1;
}

.user-name {
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 0.25rem;
}

.user-status {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-background);
}

.content-header {
  background: var(--color-surface);
  padding: 2rem;
  border-bottom: 1px solid var(--color-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.content-header h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}

.content-body {
  flex: 1;
  padding: 2rem;
  overflow-y: auto;
}

/* Chat List */
.chat-list, .tweets-list {
  background: var(--color-surface);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.chat-item {
  display: flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--color-background);
  cursor: pointer;
  transition: background 0.2s;
}

.chat-item:hover {
  background: rgba(102, 126, 234, 0.05);
}

.chat-item:last-child {
  border-bottom: none;
}

.chat-avatar {
  width: 52px;
  height: 52px;
  margin-right: 1.25rem;
  font-size: 1.1rem;
}

.chat-info {
  flex: 1;
}

.chat-name {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--color-text);
  margin-bottom: 0.4rem;
}

.chat-last-message {
  color: var(--color-text-secondary);
  font-size: 0.95rem;
}

.chat-time {
  color: var(--color-text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Messages */
.chat-container {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 140px);
  background: var(--color-surface);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.messages-container {
  flex: 1;
  padding: 1.5rem;
  overflow-y: auto;
  background: linear-gradient(to bottom, #f8f9fa, #ffffff);
}

.message {
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  max-width: 75%;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.message--own {
  align-items: flex-end;
  margin-left: auto;
}

.message-content {
  background: var(--color-surface);
  padding: 1rem 1.25rem;
  border-radius: 1.5rem;
  box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  word-wrap: break-word;
  line-height: 1.4;
}

.message--own .message-content {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
}

.message-time {
  font-size: 0.75rem;
  color: var(--color-text-secondary);
  margin-top: 0.5rem;
  padding: 0 1rem;
}

.message-input-container {
  padding: 1.5rem;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.message-input-container form {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.message-input-container input {
  flex: 1;
  padding: 1rem 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: 2rem;
  outline: none;
  font-size: 1rem;
  transition: border-color 0.2s;
}

.message-input-container input:focus {
  border-color: var(--color-primary);
}

/* Profile */
.profile-header {
  display: flex;
  align-items: center;
  margin-bottom: 2rem;
  background: var(--color-surface);
  padding: 2.5rem;
  border-radius: 1rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.profile-avatar {
  width: 100px;
  height: 100px;
  margin-right: 2rem;
  font-size: 2rem;
}

.profile-info h3 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.profile-info p {
  color: var(--color-text-secondary);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.tweet-compose {
  background: var(--color-surface);
  padding: 2rem;
  border-radius: 1rem;
  margin-bottom: 2rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.tweet-compose h4 {
  font-size: 1.3rem;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.tweet-compose textarea {
  width: 100%;
  padding: 1.25rem;
  border: 2px solid var(--color-border);
  border-radius: 1rem;
  resize: vertical;
  min-height: 120px;
  margin-bottom: 1rem;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.tweet-compose textarea:focus {
  outline: none;
  border-color: var(--color-primary);
}

.tweets-list {
  padding: 2rem;
}

.tweets-list h4 {
  font-size: 1.3rem;
  color: var(--color-text);
  margin-bottom: 1.5rem;
}

.tweet-item {
  border-bottom: 1px solid var(--color-background);
  padding: 1.5rem 0;
}

.tweet-item:last-child {
  border-bottom: none;
}

.tweet-header {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
}

.tweet-avatar {
  width: 44px;
  height: 44px;
  margin-right: 1rem;
  font-size: 0.9rem;
}

.tweet-info {
  flex: 1;
}

.tweet-author {
  font-weight: 600;
  color: var(--color-text);
  margin-right: 0.75rem;
}

.tweet-username,
.tweet-time {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
  margin-right: 0.75rem;
}

.tweet-content {
  margin-bottom: 1rem;
  line-height: 1.6;
  font-size: 1rem;
  color: var(--color-text);
}

.tweet-actions {
  color: var(--color-text-secondary);
  font-size: 0.9rem;
}

.tweet-likes {
  cursor: pointer;
  transition: color 0.2s;
}

.tweet-likes:hover {
  color: #e74c3c;
}

/* Users List */
.users-list {
  margin-top: 2rem;
  background: var(--color-surface);
  border-radius: 1rem;
  padding: 1.5rem;
  box-shadow: 0 4px 25px rgba(0, 0, 0, 0.08);
}

.users-list h3 {
  font-size: 1.2rem;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.user-item {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.user-item:hover {
  background: rgba(102, 126, 234, 0.05);
}

.user-item .user-avatar {
  width: 44px;
  height: 44px;
  font-size: 0.9rem;
}

.empty-state {
  text-align: center;
  color: var(--color-text-secondary);
  padding: 3rem 2rem;
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    order: 2;
  }

  .content {
    order: 1;
  }

  .sidebar-nav {
    display: flex;
    overflow-x: auto;
    padding: 1rem;
  }

  .nav-item {
    flex: 0 0 auto;
    margin-right: 1rem;
    margin-bottom: 0;
  }

  .message {
    max-width: 85%;
  }

  .profile-header {
    flex-direction: column;
    text-align: center;
  }

  .profile-avatar {
    margin-right: 0;
    margin-bottom: 1rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 2rem 1.5rem;
  }

  .content-body {
    padding: 1rem;
  }

  .sidebar-footer {
    padding: 1rem;
  }
}
