/* X.com (Twitter) Style Design for Speak & Grow */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f7f9fa;
  --bg-hover: rgba(0, 0, 0, 0.03);
  --text-primary: #0f1419;
  --text-secondary: #536471;
  --text-link: #1d9bf0;
  --border-color: #eff3f4;
  --border-hover: #cfd9de;
  --accent-blue: #1d9bf0;
  --accent-green: #00ba7c;
  --accent-red: #f91880;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Dark mode */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #000000;
    --bg-secondary: #16181c;
    --bg-hover: rgba(255, 255, 255, 0.03);
    --text-primary: #e7e9ea;
    --text-secondary: #71767b;
    --border-color: #2f3336;
    --border-hover: #545961;
  }
}

* {
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Mobile-first container */
.x-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background-color: var(--bg-primary);
}

/* Header Navigation */
.x-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: var(--bg-primary);
  backdrop-filter: blur(12px);
  background-color: rgba(255, 255, 255, 0.85);
  border-bottom: 1px solid var(--border-color);
}

@media (prefers-color-scheme: dark) {
  .x-header {
    background-color: rgba(0, 0, 0, 0.85);
  }
}

.x-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 53px;
  padding: 0 16px;
}

.x-logo {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}

/* Tab Navigation */
.x-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

.x-tab {
  flex: 1;
  padding: 16px;
  text-align: center;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border-bottom: 4px solid transparent;
  transition: all 0.2s;
  cursor: pointer;
}

.x-tab:hover {
  background-color: var(--bg-hover);
}

.x-tab.active {
  color: var(--text-primary);
  font-weight: 700;
  border-bottom-color: var(--accent-blue);
}

/* Post/Article Card */
.x-post {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  transition: background-color 0.2s;
  cursor: pointer;
}

.x-post:hover {
  background-color: var(--bg-hover);
}

.x-post-header {
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.x-post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  margin-right: 12px;
  background-color: var(--bg-secondary);
}

.x-post-meta {
  flex: 1;
}

.x-post-author {
  font-weight: 700;
  color: var(--text-primary);
  font-size: 15px;
}

.x-post-time {
  color: var(--text-secondary);
  font-size: 15px;
  margin-left: 4px;
}

.x-post-content {
  margin-left: 60px;
}

.x-post-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.3;
}

.x-post-text {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 12px;
  white-space: pre-wrap;
  word-wrap: break-word;
}

/* Image in post */
.x-post-image {
  width: 100%;
  border-radius: 16px;
  margin: 12px 0;
  overflow: hidden;
  border: 1px solid var(--border-color);
}

.x-post-image img {
  width: 100%;
  height: auto;
  display: block;
}

/* Action buttons */
.x-post-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  margin-left: 60px;
  max-width: 425px;
}

.x-action-button {
  display: flex;
  align-items: center;
  padding: 8px;
  margin: -8px;
  border-radius: 50%;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
  background: none;
  border: none;
}

.x-action-button:hover {
  background-color: rgba(29, 155, 240, 0.15);
  color: var(--accent-blue);
}

.x-action-button.like:hover {
  background-color: rgba(249, 24, 128, 0.15);
  color: var(--accent-red);
}

.x-action-button svg {
  width: 20px;
  height: 20px;
  margin-right: 4px;
}

/* Compose/Input area */
.x-compose {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  background-color: var(--bg-primary);
}

.x-compose-inner {
  display: flex;
  gap: 12px;
}

.x-compose-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: var(--bg-secondary);
  flex-shrink: 0;
}

.x-compose-input {
  flex: 1;
  background: none;
  border: none;
  font-size: 20px;
  color: var(--text-primary);
  padding: 12px 0;
  resize: none;
  outline: none;
}

.x-compose-input::placeholder {
  color: var(--text-secondary);
}

.x-compose-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.x-compose-button {
  background-color: var(--accent-blue);
  color: white;
  border: none;
  border-radius: 9999px;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s;
}

.x-compose-button:hover {
  background-color: #1a8cd8;
}

.x-compose-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Loading spinner */
.x-spinner {
  display: flex;
  justify-content: center;
  padding: 32px;
}

.x-spinner-circle {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 600px) {
  .x-container {
    max-width: 100%;
  }
  
  .x-post-title {
    font-size: 17px;
  }
  
  .x-post-text {
    font-size: 15px;
  }
  
  .x-tab {
    font-size: 14px;
    padding: 12px 8px;
  }
}

/* Floating action button */
.x-fab {
  position: fixed;
  bottom: 70px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-color: var(--accent-blue);
  color: white;
  border: none;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s;
}

.x-fab:hover {
  transform: scale(1.1);
}

.x-fab svg {
  width: 24px;
  height: 24px;
}

/* Bottom navigation for mobile */
.x-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: var(--bg-primary);
  border-top: 1px solid var(--border-color);
  display: none;
}

@media (max-width: 600px) {
  .x-bottom-nav {
    display: flex;
  }
  
  .x-container {
    padding-bottom: 53px;
  }
}

.x-bottom-nav-item {
  flex: 1;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
}

.x-bottom-nav-item.active {
  color: var(--text-primary);
}

.x-bottom-nav-item svg {
  width: 26px;
  height: 26px;
}