/* LinkedIn-style CSS for Observatorio ESG */

/* Login Screen */
.login-screen {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, #0a66c2 0%, #057642 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.login-screen.hidden {
  display: none;
}

.login-card {
  background: white;
  padding: 48px 40px;
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  text-align: center;
  max-width: 400px;
  width: 90%;
}

.login-logo {
  height: 48px;
  margin-bottom: 24px;
}

.login-card h1 {
  font-size: 24px;
  font-weight: 600;
  color: #000;
  margin-bottom: 8px;
}

.login-card > p {
  font-size: 14px;
  color: #666;
  margin-bottom: 24px;
}

#login-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

#login-token {
  padding: 14px 16px;
  font-size: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  outline: none;
  transition: border-color 0.2s;
}

#login-token:focus {
  border-color: #0a66c2;
}

#login-form button {
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 600;
  background: #0a66c2;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
}

#login-form button:hover {
  background: #004182;
}

.login-error {
  color: #c53030;
  font-size: 14px;
  margin-top: 16px;
  min-height: 20px;
}

.main-app.hidden {
  display: none;
}

:root {
  --linkedin-blue: #0a66c2;
  --linkedin-blue-hover: #004182;
  --linkedin-green: #057642;
  --bg-color: #f4f2ee;
  --card-bg: #ffffff;
  --text-primary: #000000;
  --text-secondary: #666666;
  --text-muted: #00000099;
  --border-color: #e0e0e0;
  --hover-bg: #f5f5f5;
  --navbar-height: 52px;
}

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

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}

/* Navbar */
.navbar {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 100;
}

.navbar-container {
  max-width: 1128px;
  margin: 0 auto;
  padding: 0 16px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  height: 32px;
  width: auto;
}

.brand-text {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.navbar-stats {
  display: flex;
  align-items: center;
}

.stat-badge {
  background-color: var(--linkedin-blue);
  color: white;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 13px;
  font-weight: 500;
}

/* Layout */
.layout {
  max-width: 1128px;
  margin: 0 auto;
  padding: calc(var(--navbar-height) + 24px) 16px 24px;
  display: grid;
  grid-template-columns: 225px 1fr 300px;
  gap: 24px;
}

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .sidebar-left,
  .sidebar-right {
    display: none;
  }
}

/* Sidebars */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Profile Card */
.profile-card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.profile-header {
  padding: 24px 16px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.profile-icon {
  width: 72px;
  height: 72px;
  background: linear-gradient(135deg, var(--linkedin-blue), var(--linkedin-green));
  border-radius: 50%;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-icon svg {
  width: 36px;
  height: 36px;
  color: white;
}

.profile-header h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.profile-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
}

.profile-stats {
  display: flex;
  padding: 12px 16px;
}

.profile-stat {
  flex: 1;
  text-align: center;
}

.profile-stat .stat-value {
  display: block;
  font-size: 16px;
  font-weight: 600;
  color: var(--linkedin-blue);
}

.profile-stat .stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* Keywords Card */
.keywords-card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 16px;
}

.keywords-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.keywords-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.keyword-tag {
  background-color: #e8f4f8;
  color: var(--linkedin-blue);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

/* Info Cards */
.info-card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  padding: 16px;
}

.info-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.info-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.info-meta {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border-color);
}

.info-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.info-value {
  display: block;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
  margin-top: 4px;
}

/* How it works */
.how-it-works {
  list-style: none;
}

.how-it-works li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
}

.how-it-works li:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

.step-icon {
  width: 24px;
  height: 24px;
  background: var(--linkedin-blue);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  flex-shrink: 0;
}

/* Feed */
.feed {
  min-width: 0;
}

.feed-header {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 8px;
  overflow: hidden;
}

.feed-tabs {
  display: flex;
  padding: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
  border-bottom: 2px solid transparent;
}

.tab-btn:hover {
  background-color: var(--hover-bg);
  color: var(--text-primary);
}

.tab-btn.active {
  color: var(--linkedin-blue);
  border-bottom-color: var(--linkedin-blue);
}

.tab-btn svg {
  width: 18px;
  height: 18px;
}

/* Feed Content */
.feed-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Post Card */
.post-card {
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
  overflow: hidden;
  transition: box-shadow 0.2s;
}

.post-card:hover {
  box-shadow: 0 0 0 1px var(--border-color), 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-header {
  display: flex;
  align-items: flex-start;
  padding: 16px 16px 0;
  gap: 12px;
}

.post-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 600;
  flex-shrink: 0;
}

.post-meta {
  flex: 1;
  min-width: 0;
}

.post-author {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.verified-badge {
  color: var(--linkedin-blue);
  width: 16px;
  height: 16px;
}

.post-info {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.post-keyword {
  background: #e8f4f8;
  color: var(--linkedin-blue);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

.post-rank {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--linkedin-blue);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.post-card-wrapper {
  position: relative;
}

/* Post Content */
.post-content {
  padding: 12px 16px;
}

.post-snippet {
  font-size: 14px;
  color: var(--text-primary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Post Stats */
.post-stats {
  display: flex;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px solid var(--border-color);
  gap: 16px;
}

.stat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.stat-item svg {
  width: 16px;
  height: 16px;
}

.stat-item.likes svg {
  color: #df704d;
}

.stat-item.comments svg {
  color: var(--linkedin-blue);
}

.stat-item.reposts svg {
  color: var(--linkedin-green);
}

.stat-total {
  margin-left: auto;
  font-weight: 600;
  color: var(--text-primary);
}

/* Post Actions */
.post-actions {
  display: flex;
  padding: 4px 8px;
  border-top: 1px solid var(--border-color);
}

.btn-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  border-radius: 4px;
  transition: background-color 0.2s;
}

.btn-view:hover {
  background-color: var(--hover-bg);
  color: var(--linkedin-blue);
}

.btn-view svg {
  width: 20px;
  height: 20px;
}

/* Date Separator */
.date-separator {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0 8px;
}

.date-separator::before,
.date-separator::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border-color);
}

.date-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Loading Spinner */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--border-color);
  border-top-color: var(--linkedin-blue);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.loading-spinner p {
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  background: var(--card-bg);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.empty-state h3 {
  font-size: 18px;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Error State */
.error-state {
  text-align: center;
  padding: 48px 24px;
  background: #fff5f5;
  border-radius: 8px;
  border: 1px solid #feb2b2;
}

.error-state h3 {
  font-size: 18px;
  color: #c53030;
  margin-bottom: 8px;
}

.error-state p {
  font-size: 14px;
  color: #742a2a;
}

/* Today's Top 3 Special Styling */
.top3-header {
  background: linear-gradient(135deg, var(--linkedin-blue), #0077b5);
  color: white;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 8px;
  text-align: center;
}

.top3-header h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.top3-header p {
  font-size: 14px;
  opacity: 0.9;
}

/* Rank Badges */
.rank-badge {
  position: absolute;
  top: -8px;
  left: -8px;
  z-index: 1;
}

.rank-badge-inner {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.rank-1 .rank-badge-inner {
  background: linear-gradient(135deg, #ffd700, #ffb347);
}

.rank-2 .rank-badge-inner {
  background: linear-gradient(135deg, #c0c0c0, #a8a8a8);
}

.rank-3 .rank-badge-inner {
  background: linear-gradient(135deg, #cd7f32, #b87333);
}

/* Top 10 Table Style */
.top10-card {
  position: relative;
  border-left: 4px solid var(--linkedin-blue);
}

.top10-card .post-rank {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

/* Responsive */
@media (max-width: 768px) {
  .layout {
    padding: calc(var(--navbar-height) + 16px) 12px 16px;
  }

  .tab-btn {
    padding: 12px 8px;
    font-size: 12px;
  }

  .tab-btn svg {
    display: none;
  }

  .post-header {
    padding: 12px 12px 0;
  }

  .post-content {
    padding: 10px 12px;
  }

  .post-stats {
    padding: 8px 12px;
  }
}
