/**
 * Domainotron CSS Styles
 * Consolidated styles for all pages and components
 */

/* Base styling */
body {
    font-family: system-ui, -apple-system, sans-serif;
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9fb;
}

/* Home page has a narrower layout */
body.home {
    max-width: 600px;
}

/* Header styling */
h1 {
    color: #2f6cde;
    margin-bottom: 30px;
    font-size: 1.8rem;
    line-height: 1.3;
}

.title a {
  text-decoration: none;
  color: inherit;
}

.title a:hover {
  text-decoration: underline;
}

#domain-list-title {
  font-size: 1rem;
  font-weight: 600;
  color: #666;
  margin-bottom: 10px;
}


/* Editor header styles */
.header-content {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 20px;
    margin-bottom: 30px;
}

.project-branding {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.project-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.project-logo.loading {
    opacity: 0.6;
}

#project-title {
    color: #2f6cde;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    flex: 1;
}

.project-description {
    color: #666;
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
}

.project-description p {
    margin: 0;
}

/* Clickable description styling */
.clickable-description {
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 4px 8px;
    border-radius: 4px;
    position: relative;
}

.clickable-description:hover {
    background-color: #f0f4ff;
    color: #2f6cde;
}

.clickable-description:active {
    transform: translateY(1px);
}

/* Add a subtle visual hint that it's clickable */
.clickable-description::after {
    content: '✎';
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #2f6cde;
    font-size: 0.8em;
}

.clickable-description:hover::after {
    opacity: 0.6;
}

/* Action buttons styling */
.action-buttons {
    display: flex;
    gap: 16px;
    margin-top: 16px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: white;
    color: #333;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-sizing: border-box;
}

.action-btn:hover {
    background: #f5f5f5;
    border-color: #d0d0d0;
}

.action-btn:active {
    transform: translateY(1px);
}

.action-btn .btn-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.btn-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

.btn-text {
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.2;
}

.btn-subtitle {
    font-size: 0.75rem;
    color: #666;
    line-height: 1.1;
    white-space: nowrap;
}

.collaborate-btn:hover {
    background: #e8f4fd;
    border-color: #2f6cde;
    color: #2f6cde;
}

.collaborate-btn:hover .btn-subtitle {
    color: #2f6cde;
}

.share-btn:hover {
    background: #f0f9ff;
    border-color: #0ea5e9;
    color: #0ea5e9;
}

.share-btn:hover .btn-subtitle {
    color: #0ea5e9;
}

@media (max-width: 480px) {
    .action-buttons {
        flex-direction: column;
        gap: 8px;
    }
    
    .action-btn {
        flex: none;
        width: 100%;
        justify-content: center;
    }
}

/* Home page specific styles */
.hero {
    text-align: center;
    margin-bottom: 40px;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

.subtitle {
    color: #666;
    font-size: 1.2rem;
    margin-bottom: 40px;
}

.form-container {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    padding: 30px;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

textarea {
    width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    font-size: 1rem;
    font-family: inherit;
    resize: vertical;
}

textarea:focus {
    outline: none;
    border-color: #2f6cde;
}

.generate-btn {
    background: #2f6cde;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.2s ease;
}

.generate-btn:hover {
    background: #1e4ba8;
}

.generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.loading {
    display: none;
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #2f6cde;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.error {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 4px;
    margin-top: 20px;
    display: none;
}

/* Domain list styling */
#domain-list {
    list-style: none;
    padding: 0;
    margin: 20px 0;
}

/* Generate More button styling - consistent with other action buttons */
.generate-more-btn {
    display: none; /* Hidden by default, shown when domains are available */
}

.generate-more-btn:hover {
    background: #e8f4fd;
    border-color: #2f6cde;
    color: #2f6cde;
}

.generate-more-btn:hover .btn-subtitle {
    color: #2f6cde;
}

.generate-more-btn:disabled {
    background: #f8f9fa;
    border-color: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.generate-more-btn:disabled .btn-subtitle {
    color: #6c757d;
}

.empty-state {
    text-align: center;
    color: #666;
    padding: 40px 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.domain-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
}

.domain-info {
    flex: 1;
    min-width: 0; /* Allow text to truncate */
}

.domain-name {
    font-size: 1rem;
    font-weight: 500;
    color: #2f6cde;
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.domain-name:hover {
    text-decoration: underline;
}

.domain-type {
    font-size: 0.85rem;
    color: rgba(0,0,0,0.5);
    padding: 0.25rem 0.6rem;
    border-radius: 4px;
    display: inline-block;
    margin-top: 0.25rem;
    font-style: italic;
}

.domain-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Base styling for domain items */
.domain-item {
  background: white;
  border-radius: 6px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  margin-bottom: 8px;
  transition: box-shadow 0.2s ease, opacity 0.3s ease;
}

.domain-item:hover {
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

/* Starred domain styling */
.domain-item.starred {
  background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
  border: 1px solid #ffc107;
  box-shadow: 0 1px 4px rgba(255, 193, 7, 0.2);
}

.domain-item.starred:hover {
  box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.domain-item.starred .domain-name {
  color: #b08800;
  font-weight: 600;
}

.domain-item.starred .star-btn,
.star-btn.active {
  background: rgba(255, 193, 7, 0.5);
  color: white;
  border-radius: 50%;
  transform: scale(1.1); 
  opacity: 1.0;
}

/* Hidden domain styling */
.domain-item.hidden {
  display: none;
}

/* Action button styling */
.star-btn,
.hide-btn {
  background: none;
  border: none;
  padding: 6px;
  cursor: pointer;
  border-radius: 3px;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  position: relative;
  user-select: none;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.7em;
}

.star-btn {
  background: #f8f9fa;
  color: #e4d5a8;
  opacity: 0.4;
}

.star-btn:hover {
  background: #e9ecef;
  color: #f39c12;
  opacity: 0.9;
}

.star-btn:active {
  transform: scale(0.9);
}

.hide-btn {
  color: #dc3545;
}

.hide-btn:hover {
  background: #f8d7da;
  transform: scale(1.1);
}

.hide-btn:active {
  transform: scale(0.9);
}

/* Focus states for accessibility */
.star-btn:focus,
.hide-btn:focus {
  outline: 2px solid #2f6cde;
  outline-offset: 2px;
}

/* Loading state for buttons */
.star-btn:disabled,
.hide-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Button animations */
.star-btn.clicked {
  animation: star-pulse 0.3s ease-in-out;
}

.hide-btn.clicked {
  animation: hide-pulse 0.3s ease-in-out;
}

@keyframes star-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

@keyframes hide-pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* Toast notifications */
.toast {
  position: fixed;
  top: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  z-index: 1000;
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 14px;
  transform: translateY(-100px);
  opacity: 0;
  transition: all 0.3s ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast.success {
  background: #28a745;
  color: white;
}

.toast.error {
  background: #dc3545;
  color: white;
}

.toast.info {
  background: #2f6cde;
  color: white;
}

/* Responsive design */
@media (max-width: 768px) {
  .domain-content {
    padding: 12px 16px;
  }
  
  .domain-actions {
    gap: 6px;
  }
  
  .star-btn,
  .hide-btn {
    padding: 6px;
    font-size: 0.9rem;
    width: 32px;
    height: 32px;
  }
  
  .domain-name {
    font-size: 1.2rem;
  }
  
  .domain-item {
    margin-bottom: 10px;
  }
}

@media (max-width: 480px) {
  body {
    padding: 12px;
  }
  
  .domain-content {
    padding: 10px 14px;
  }
  
  .domain-name {
    font-size: 1.15rem;
  }
  
  .star-btn,
  .hide-btn {
    width: 30px;
    height: 30px;
    font-size: 0.85rem;
  }
  
  .domain-actions {
    gap: 4px;
  }
}

/* Keyboard navigation */
.domain-item:focus-within {
  outline: 2px solid #2f6cde;
  outline-offset: 2px;
}

/* Animations for domain updates */
.domain-item.updating {
  animation: update-flash 0.5s ease-in-out;
}

@keyframes update-flash {
  0% { background-color: #e3f2fd; }
  50% { background-color: #bbdefb; }
  100% { background-color: white; }
}

/* Prefers reduced motion */
@media (prefers-reduced-motion: reduce) {
  .domain-item,
  .star-btn,
  .hide-btn,
  .toast {
    transition: none;
  }
  
  .star-btn.clicked,
  .hide-btn.clicked,
  .domain-item.updating {
    animation: none;
  }
}

/* Recent Projects Feed */
.recent-projects {
  margin-top: 50px;
  padding-top: 40px;
  border-top: 1px solid #e0e0e0;
}

.recent-projects h2 {
  color: #2f6cde;
  font-size: 1.5rem;
  margin-bottom: 24px;
  text-align: center;
  font-weight: 600;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.project-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  overflow: hidden;
  border: 1px solid #f0f0f0;
  position: relative;
}

.project-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(47, 108, 222, 0.1);
  border-color: #e8f4fd;
}

.project-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.project-card-content {
  padding: 18px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.project-logo {
  flex-shrink: 0;
}

.project-logo img {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid #f0f0f0;
}

.project-placeholder {
  width: 50px;
  height: 50px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2f6cde 0%, #4a7be8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #e8f4fd;
}

.project-placeholder svg {
  width: 24px;
  height: 24px;
}

.project-info {
  flex: 1;
  min-width: 0;
  margin-left: 0.5em;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: #2f6cde;
  margin: 0 0 6px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-description {
  color: #666;
  font-size: 0.85rem;
  line-height: 1.4;
  margin: 0;
  word-wrap: break-word;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Mobile responsiveness for project cards */
@media (max-width: 768px) {
  .recent-projects {
    margin-top: 40px;
    padding-top: 30px;
  }
  
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .project-card-content {
    padding: 16px;
    gap: 12px;
  }
  
  .project-logo img,
  .project-placeholder {
    width: 46px;
    height: 46px;
  }
  
  .project-placeholder svg {
    width: 22px;
    height: 22px;
  }
  
  .project-title {
    font-size: 1rem;
  }
  
  .project-description {
    font-size: 0.8rem;
  }
}

@media (max-width: 480px) {
  .recent-projects {
    margin-top: 30px;
    padding-top: 25px;
  }
  
  .recent-projects h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
  }
  
  .projects-grid {
    gap: 10px;
  }
  
  .project-card-content {
    padding: 14px;
    gap: 10px;
  }
  
  .project-logo img,
  .project-placeholder {
    width: 42px;
    height: 42px;
    border-radius: 8px;
  }
  
  .project-placeholder svg {
    width: 20px;
    height: 20px;
  }
  
  .project-title {
    font-size: 0.95rem;
  }
  
  .project-description {
    font-size: 0.78rem;
  }
} 