/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

.tags-container {
  position: fixed;
  left: 0;
  top: 0;
  width: 220px;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 6px;
  overflow-y: auto;
  padding: 16px 12px;
  background-color: #f8fbff;
  border-right: 1px solid #d0e5ff;
  z-index: 1;
  /* Scrollbar styling */
  scrollbar-width: thin;
  scrollbar-color: #b3d9ff #f8fbff;
}

.tags-container::-webkit-scrollbar {
  width: 6px;
}

.tags-container::-webkit-scrollbar-track {
  background: #f8fbff;
}

.tags-container::-webkit-scrollbar-thumb {
  background: #b3d9ff;
  border-radius: 3px;
}

.tags-container::-webkit-scrollbar-thumb:hover {
  background: #99ccff;
}

/* Scroll indicator - shows when content is scrollable */
.tags-container::before {
  content: '';
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: linear-gradient(to bottom, #f8fbff, transparent);
  pointer-events: none;
  z-index: 10;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.tags-container:not(:hover)::before {
  opacity: 1;
}

.tag-button {
  background-color: #4A90E2;
  color: white;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: center;
  text-transform: uppercase;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  position: relative;
}

.tag-button:focus {
  outline: 2px solid #FF6B35;
  outline-offset: 2px;
}

.tag-button:hover {
  background-color: #FF6B35;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(255, 107, 53, 0.3);
}

.tag-button:active {
  transform: translateY(0);
}

.tag-button-highlighted {
  background-color: #FF6B35;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(255, 107, 53, 0.4);
  border: 2px solid rgba(255, 107, 53, 0.3);
}

.tag-button-highlighted:hover {
  background-color: #E55A2B;
}

.add-tag-button {
  background-color: transparent;
  color: #666;
  border: 2px dashed #ccc;
  padding: 10px 12px;
  border-radius: 6px;
  text-align: center;
  font-weight: 500;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.add-tag-button:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

.add-tag-button:active {
  transform: scale(0.98);
}

.add-tag-button:hover {
  border-color: #4A90E2;
  color: #4A90E2;
  background-color: rgba(74, 144, 226, 0.05);
}

.add-tag-button svg {
  flex-shrink: 0;
}

.chrome-extension-promo {
  margin-top: 16px;
  padding: 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 8px;
  color: white;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chrome-extension-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.chrome-extension-icon svg {
  color: white;
  width: 28px;
  height: 28px;
}

.chrome-extension-content h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 600;
  color: white;
}

.chrome-extension-content p {
  margin: 0 0 12px 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.9);
}

.chrome-extension-button {
  display: block;
  width: 100%;
  padding: 10px 14px;
  background-color: white;
  color: #667eea;
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  box-sizing: border-box;
}

.chrome-extension-button:hover {
  background-color: #f5f5f5;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.create-tag-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.create-tag-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

.create-tag-modal-content {
  position: relative;
  background-color: #f5f5f5;
  border-radius: 8px;
  padding: 24px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  min-width: 300px;
  z-index: 1001;
}

.create-tag-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Garamond", "EB Garamond", "Times New Roman", Times, serif;
  margin-bottom: 12px;
  box-sizing: border-box;
  background-color: #fff;
  color: #333;
}

.create-tag-input:focus {
  outline: none;
  border-color: #4A90E2;
  box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.1);
}

.create-tag-input::placeholder {
  color: #999;
}

.create-tag-button {
  width: 100%;
  padding: 12px;
  background-color: #e8e8e8;
  border: 1px solid #d0d0d0;
  border-radius: 6px;
  font-size: 14px;
  font-family: "Garamond", "EB Garamond", "Times New Roman", Times, serif;
  color: #666;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.create-tag-button:hover {
  background-color: #ddd;
  border-color: #bbb;
}

.create-tag-button:active {
  transform: translateY(1px);
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

body {
  font-family: "Garamond", "EB Garamond", "Times New Roman", Times, serif;
  background: linear-gradient(135deg, #f0f7ff 0%, #e6f2ff 100%);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Responsive design */
@media (max-width: 768px) {
  .tags-container {
    width: 180px;
  }
  
  .main-content {
    margin-left: 180px;
    padding: 12px 16px;
  }
  
  .post-item {
    padding: 20px;
    margin-bottom: 16px;
  }
  
  .posts-container {
    max-width: 100%;
  }
}

.main-content {
  margin-left: 220px;
  padding: 16px 24px;
  padding-top: 0px;
  position: relative;
  z-index: 2;
  min-height: 100vh;
}

.top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  padding: 0;
}

.auth-header {
  display: flex;
  gap: 12px;
  align-items: center;
}

/* Style auth buttons in tabs bar */
.tabs-right .button,
.tabs-right a.button {
  display: inline-block;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  margin-right: 8px;
}

.tabs-right .button:last-child,
.tabs-right a.button:last-child {
  margin-right: 0;
}

.tabs-right a[href="/sign_up"] {
  background-color: #FF6B35;
  color: white;
}

.tabs-right a[href="/sign_up"]:hover {
  background-color: #E55A2B;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(255, 107, 53, 0.3);
}

.tabs-right a[href="/sign_in"] {
  background-color: #4A90E2;
  color: white;
}

.tabs-right a[href="/sign_in"]:hover {
  background-color: #357ABD;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(74, 144, 226, 0.3);
}

.tabs-right button[type="button"],
.tabs-right button.button {
  background-color: #666;
  color: white;
}

.tabs-right button[type="button"]:hover,
.tabs-right button.button:hover {
  background-color: #555;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.tabs-right p {
  margin: 0;
  color: #666;
  font-size: 0.9rem;
}

.content-tabs {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0;
  margin-bottom: 16px;
  border-bottom: 1px solid #e0e0e0;
  background-color: #f8f9fa;
  padding: 0;
}

.tabs-left {
  display: flex;
  gap: 0;
}

.tabs-right {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 12px;
}

.tab {
  padding: 12px 20px;
  text-decoration: none;
  color: #555;
  font-weight: 600;
  font-size: 1rem;
  border-bottom: 3px solid transparent;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background-color: transparent;
  position: relative;
}

.tab:focus {
  outline: 2px solid #FF6B35;
  outline-offset: -2px;
  border-radius: 4px 4px 0 0;
}

.tab:hover {
  color: #4A90E2;
  background-color: rgba(74, 144, 226, 0.05);
}

.tab-active {
  color: #FF6B35;
  border-bottom-color: #FF6B35;
  background-color: #fff;
  font-weight: 600;
}

.tab-active::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #FF6B35, transparent);
  animation: tabUnderline 0.3s ease;
}

@keyframes tabUnderline {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

.posts-container {
  max-width: 1080px;
  margin: 0;
  padding: 0;
}

.posts-header {
  margin-bottom: 0;
}

.posts-header h1 {
  font-size: 2rem;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 4px 0;
  letter-spacing: -0.01em;
}

.posts-header p {
  color: #555;
  font-size: 1.05rem;
  margin: 0;
  font-weight: 400;
}

.posts-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.post-item {
  background-color: #fafafa;
  border: 1px solid #e8e8e8;
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 6px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.1);
  position: relative;
}

.post-item:hover {
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1), 0 3px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px) scale(1.005);
  border-color: #4A90E2;
  border-left-color: #FF6B35;
  background-color: #fff;
}

.post-item:focus-within {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

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

.post-title-section {
  flex: 1;
}

.post-actions {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
  opacity: 0.6;
  transition: opacity 0.2s ease;
}

.post-item:hover .post-actions {
  opacity: 1;
}

.post-item h2 {
  margin: 0 0 4px 0;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
  display: flex;
  align-items: baseline;
  gap: 5px;
  flex-wrap: wrap;
  color: #2d4a6b;
}

.post-domain-badge {
  font-size: 0.8rem;
  font-weight: 600;
  color: #555;
  background-color: #f0f0f0;
  padding: 3px 8px;
  border-radius: 4px;
  text-transform: lowercase;
  letter-spacing: 0;
  white-space: nowrap;
  opacity: 0.9;
}

.save-icon,
.archive-icon {
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  color: #666;
  transition: all 0.3s ease;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.save-icon:hover,
.archive-icon:hover {
  color: #FF6B35;
  background-color: rgba(255, 107, 53, 0.1);
  transform: scale(1.1);
}

.save-icon:active,
.archive-icon:active {
  transform: scale(0.95);
}

.save-icon:focus,
.archive-icon:focus {
  outline: 2px solid #FF6B35;
  outline-offset: 2px;
}

.save-icon.saved {
  color: #FF6B35;
}

.save-icon.saved svg {
  fill: #FF6B35;
  stroke: #FF6B35;
}

.post-item h2 a {
  color: #2d4a6b;
  text-decoration: none;
  transition: color 0.3s ease;
  flex: 1;
  min-width: 0;
  font-weight: 700;
}

.post-item h2 a:hover {
  color: #4A90E2;
  text-decoration: none;
}

.post-item h2 a:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
  border-radius: 2px;
}

.post-url {
  color: #666;
  font-size: 0.95rem;
  margin: 12px 0;
  word-break: break-all;
  display: flex;
  align-items: center;
  gap: 8px;
}

.post-url::before {
  content: "🔗";
  font-size: 0.85rem;
}

.post-summary {
  color: #333;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 3px 0;
  padding: 3px 0;
  border-left: 2px solid #e8e8e8;
  padding-left: 8px;
  font-style: italic;
  font-weight: 400;
  word-wrap: break-word;
  overflow-wrap: break-word;
  hyphens: auto;
  text-align: left;
}

.post-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px solid #f5f5f5;
  gap: 8px;
}

.post-date {
  color: #999;
  font-size: 0.9rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.post-date::before {
  content: "📅";
  font-size: 0.85rem;
}

.post-footer-left {
  display: flex;
  align-items: center;
  flex: 1;
}

.post-footer-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
}

.post-tag-badge {
  display: inline-block;
  padding: 2px 6px;
  background-color: #e8f0fe;
  color: #4A90E2;
  border: 1px solid rgba(74, 144, 226, 0.2);
  border-radius: 6px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
}

.post-tag-badge:hover {
  background-color: #4A90E2;
  color: white;
  border-color: #4A90E2;
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(74, 144, 226, 0.3);
}

.post-tag-badge:active {
  transform: translateY(0);
}

.post-tag-badge:focus {
  outline: 2px solid #4A90E2;
  outline-offset: 2px;
}

.post-read-time {
  color: #666;
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 500;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 3px;
}

.post-read-time::before {
  content: "⏱";
  font-size: 0.9rem;
  font-style: normal;
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: #666;
  font-size: 1.15rem;
  font-weight: 400;
  background-color: #fafafa;
  border-radius: 12px;
  border: 2px dashed #e0e0e0;
  margin: 20px 0;
}

.empty-state-icon {
  margin-bottom: 24px;
  color: #ccc;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0.6;
}

.empty-state-icon svg {
  filter: grayscale(0.3);
}

.empty-state h3 {
  margin: 0 0 12px 0;
  font-size: 1.5rem;
  font-weight: 700;
  color: #444;
  letter-spacing: -0.01em;
}

.empty-state p {
  margin: 0 0 32px 0;
  font-size: 1.1rem;
  color: #666;
  font-weight: 400;
  max-width: 450px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.chrome-extension-button-large {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-decoration: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.chrome-extension-button-large:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.chrome-extension-button-large svg {
  flex-shrink: 0;
}
