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

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 20px;
}

.hero {
  text-align: center;
  color: white;
  padding: 40px 20px;
  margin-bottom: 30px;
}

.hero h1 {
  font-size: 3em;
  margin-bottom: 10px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.hero p {
  font-size: 1.2em;
  opacity: 0.9;
}

.container {
  max-width: 900px;
  margin: 0 auto;
}

.auth-section, .user-section {
  background: white;
  border-radius: 15px;
  padding: 30px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid #eee;
}

.tab {
  padding: 12px 30px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  transition: all 0.3s;
  border-bottom: 3px solid transparent;
}

.tab.active {
  color: #667eea;
  border-bottom-color: #667eea;
  font-weight: 600;
}

.auth-form {
  max-width: 400px;
  margin: 0 auto;
}

.auth-form h2 {
  color: #333;
  margin-bottom: 20px;
  text-align: center;
}

.auth-form input, .write-section input, .write-section textarea {
  width: 100%;
  padding: 12px 15px;
  margin-bottom: 15px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.auth-form input:focus, .write-section input:focus, .write-section textarea:focus {
  outline: none;
  border-color: #667eea;
}

.auth-form button, .write-section button {
  width: 100%;
  padding: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s;
}

.auth-form button:hover, .write-section button:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.error {
  color: #e74c3c;
  margin-top: 10px;
  text-align: center;
  font-size: 14px;
}

.user-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 10px;
  margin-bottom: 30px;
  color: white;
}

.user-info h2 {
  font-size: 1.5em;
}

.logout-btn {
  padding: 10px 25px !important;
  background: white !important;
  color: #667eea !important;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  width: auto !important;
  transition: all 0.3s;
}

.logout-btn:hover {
  transform: scale(1.05);
}

.write-section {
  background: #f8f9fa;
  padding: 25px;
  border-radius: 10px;
  margin-bottom: 30px;
}

.write-section h3 {
  color: #333;
  margin-bottom: 15px;
}

.write-section textarea {
  resize: vertical;
  min-height: 120px;
}

.view-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.view-tab {
  padding: 10px 20px;
  background: #f8f9fa;
  border: 2px solid #eee;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s;
  color: #666;
}

.view-tab.active {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border-color: transparent;
}

#posts-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.post-card {
  background: white;
  border: 2px solid #eee;
  border-radius: 12px;
  padding: 25px;
  transition: all 0.3s;
}

.post-card:hover {
  border-color: #667eea;
  box-shadow: 0 5px 15px rgba(102, 126, 234, 0.2);
  transform: translateY(-2px);
}

.post-header {
  display: flex;
  justify-content: space-between;
  align-items: start;
  margin-bottom: 15px;
}

.post-title {
  font-size: 1.4em;
  color: #333;
  font-weight: 600;
}

.post-meta {
  font-size: 0.9em;
  color: #666;
  display: flex;
  gap: 15px;
  align-items: center;
}

.post-author {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.85em;
}

.post-content {
  color: #555;
  line-height: 1.6;
  margin-bottom: 10px;
  white-space: pre-wrap;
}

.post-date {
  font-size: 0.85em;
  color: #999;
  font-style: italic;
}

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #999;
}

.empty-state h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
}

@media (max-width: 768px) {
  .hero h1 {
    font-size: 2em;
  }
  
  .auth-section, .user-section {
    padding: 20px;
  }
  
  .user-info {
    flex-direction: column;
    gap: 15px;
  }
  
  .post-header {
    flex-direction: column;
    gap: 10px;
  }
}
