/* style.css — Стили ДипБип */

body { 
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  margin: 0;
  padding: 20px;
  background: #f8f9fa;
  color: #333;
  line-height: 1.6;
  overflow-x: hidden;
  max-width: 100vw;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  background: white;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  width: 100%;
  box-sizing: border-box;
}

.logo-header {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 20px;
}

.logo {
  flex-shrink: 0;
}

.logo-header-small {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  max-width: 100%;
}

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

h1 {
  color: #1a73e8;
  margin-top: 0;
  padding-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  word-break: break-word;
  max-width: 100%;
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 20px;
  flex-wrap: wrap;
  gap: 15px;
  max-width: 100%;
}

input { 
  padding: 12px 15px;
  width: 100%;
  max-width: 400px;
  border: 2px solid #dadce0;
  border-radius: 8px;
  font-size: 16px;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

input:focus {
  outline: none;
  border-color: #1a73e8;
}

button { 
  padding: 12px 24px;
  background: #1a73e8;
  color: white;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 500;
  transition: background 0.2s;
  box-sizing: border-box;
}

button:hover:not(:disabled) {
  background: #0d62d9;
}

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

.btn-home-small {
  background: #34a853;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
  margin-top: 5px;
}

.btn-home-small:hover {
  background: #2d9248;
}

.btn-report-corner {
  background: #ea4335;
  padding: 8px 16px;
  font-size: 14px;
  white-space: nowrap;
}

.btn-report-corner:hover {
  background: #d33426;
}

.btn-visit-site {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #34a853;
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s;
  margin-top: 15px;
  border: 2px solid #34a853;
  box-sizing: border-box;
  max-width: 100%;
}

.btn-visit-site:hover {
  background: #2d9248;
  border-color: #2d9248;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(52, 168, 83, 0.2);
}

.btn-icon {
  font-size: 18px;
  font-weight: bold;
}

.site-url-display {
  display: block;
  font-size: 13px;
  color: #80868b;
  margin-top: 8px;
  word-break: break-all;
  line-height: 1.4;
  max-width: 100%;
}

.visit-site-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e8e8e8;
  max-width: 100%;
}

.refresh-section {
  margin: 25px 0;
  padding: 20px 0;
  border-top: 1px solid #e8e8e8;
  border-bottom: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
  max-width: 100%;
}

.cooldown-message {
  background: #fef7e0;
  border: 1px solid #fbbc04;
  border-radius: 8px;
  padding: 10px 15px;
  margin: 10px 0;
  color: #e37400;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  word-break: break-word;
}

.muted { 
  color: #5f6368; 
  font-size: 14px; 
  margin: 15px 0;
  padding: 10px 0;
  border-bottom: 1px solid #e8e8e8;
  max-width: 100%;
  word-break: break-word;
}

.row { 
  display: flex; 
  gap: 12px; 
  align-items: center;
  flex-wrap: wrap; 
  margin-bottom: 20px; 
  max-width: 100%;
}

a { 
  color: #1a73e8; 
  text-decoration: none;
  transition: color 0.2s;
  word-break: break-word;
}

a:hover { 
  text-decoration: underline;
  color: #0d62d9;
}

/* Стили для недавних сайтов на главной */
.recent-domains-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 15px;
  margin-top: 20px;
  max-width: 100%;
}

.recent-domain-card {
  background: #f8f9fa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 15px;
  transition: all 0.2s;
  text-decoration: none;
  color: inherit;
  display: block;
  box-sizing: border-box;
  word-break: break-word;
  max-width: 100%;
}

.recent-domain-card:hover {
  background: #e8f0fe;
  border-color: #1a73e8;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 115, 232, 0.1);
}

.recent-domain-name {
  font-weight: 600;
  font-size: 16px;
  color: #1a73e8;
  margin-bottom: 5px;
  word-break: break-word;
}

.recent-domain-link {
  font-size: 12px;
  color: #5f6368;
  word-break: break-all;
}

/* Стили для страниц примеров - ИСПРАВЛЕННЫЕ */
.pages-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 15px;
  margin-top: 20px;
  max-width: 100%;
}

.page-card-responsive {
  background: #f8f9fa;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  padding: 15px;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  box-sizing: border-box;
  max-width: 100%;
  overflow: hidden; /* Важно: скрываем переполнение */
}

.page-card-responsive:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.page-url-responsive {
  color: #5f6368;
  font-size: 11px;
  margin-bottom: 8px;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
}

.page-url-responsive a {
  display: inline-block;
  max-width: 100%;
  word-break: break-all; /* Разбиваем длинные слова */
  overflow-wrap: break-word; /* Переносим длинные слова */
  hyphens: auto; /* Автоматические переносы */
  white-space: normal; /* Разрешаем перенос строк */
  text-overflow: ellipsis;
  overflow: hidden;
}

.page-title-responsive {
  font-weight: 600;
  font-size: 15px;
  margin: 0 0 8px 0;
  color: #202124;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 100%;
}

.page-desc-responsive {
  color: #5f6368;
  margin: 8px 0;
  font-size: 13px;
  line-height: 1.4;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  max-width: 100%;
}

/* ИСПРАВЛЕННЫЙ блок ключевых слов */
.page-kw-responsive {
  color: #80868b;
  font-size: 12px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
  line-height: 1.3;
  max-width: 100%;
  overflow: hidden;
}

.page-kw-responsive strong {
  display: block;
  margin-bottom: 3px;
  font-weight: 600;
  color: #5f6368;
}

.page-kw-responsive .keywords-content {
  display: block;
  max-width: 100%;
  word-break: break-word; /* Разбиваем длинные слова */
  overflow-wrap: break-word; /* Переносим длинные слова */
  white-space: normal; /* Разрешаем перенос строк */
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: normal;
}

/* Специальные классы для обработки длинных ключевых слов без пробелов */
.keywords-long {
  font-size: 11px;
  line-height: 1.2;
}

.keywords-long .keywords-content {
  word-break: break-all; /* Агрессивное разбиение длинных слов */
}

.footer {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid #e8e8e8;
  color: #5f6368;
  max-width: 100%;
}

.footer-bottom-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  flex-wrap: wrap;
  gap: 15px;
  max-width: 100%;
}

.legal-info {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 20px;
  margin: 20px 0;
  font-size: 13px;
  line-height: 1.5;
  color: #5f6368;
  max-width: 100%;
  word-break: break-word;
}

.legal-info p {
  margin: 0;
}

.legal-info strong {
  color: #202124;
}

.footer-links {
  font-size: 13px;
  line-height: 1.5;
  color: #5f6368;
  word-break: break-word;
}

.error-box {
  background: #fce8e6;
  border: 1px solid #f28b82;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  color: #c5221f;
  max-width: 100%;
  word-break: break-word;
}

.warning-box {
  background: #fef7e0;
  border: 1px solid #fbbc04;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  color: #e37400;
  max-width: 100%;
  word-break: break-word;
}

.domain-info {
  background: #e8f0fe;
  border-radius: 12px;
  padding: 20px;
  margin: 25px 0;
  max-width: 100%;
  box-sizing: border-box;
}

.domain-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 15px;
  max-width: 100%;
}

.domain-name {
  font-size: 24px;
  font-weight: 600;
  color: #1a73e8;
  margin: 0;
  word-break: break-word;
  max-width: 100%;
}

.domain-age {
  background: white;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 14px;
  color: #5f6368;
  border: 1px solid #dadce0;
  white-space: nowrap;
}

.main-page-info {
  background: #f8f9fa;
  border-left: 4px solid #1a73e8;
  padding: 20px;
  border-radius: 0 8px 8px 0;
  margin-top: 20px;
  max-width: 100%;
  box-sizing: border-box;
}

.main-page-title {
  font-weight: 600;
  font-size: 18px;
  margin: 0 0 10px 0;
  color: #202124;
  word-break: break-word;
}

.main-page-desc {
  color: #5f6368;
  margin: 10px 0;
  font-size: 15px;
  line-height: 1.5;
  word-break: break-word;
}

.main-page-kw {
  color: #80868b;
  font-size: 14px;
  margin-top: 10px;
  word-break: break-word;
  max-width: 100%;
}

.main-page-kw strong {
  display: block;
  margin-bottom: 3px;
  color: #5f6368;
}

.main-page-kw .keywords-content {
  display: block;
  word-break: break-word;
  overflow-wrap: break-word;
  white-space: normal;
  max-width: 100%;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: #202124;
  margin: 30px 0 15px 0;
  padding-bottom: 10px;
  border-bottom: 2px solid #e8f0fe;
  word-break: break-word;
  max-width: 100%;
}

/* Медиа-запросы для мобильных */
@media (max-width: 768px) {
  body {
    padding: 10px;
  }
  
  .container {
    padding: 15px;
    border-radius: 8px;
  }
  
  .header-row {
    flex-direction: column;
    align-items: stretch;
  }
  
  .logo-header-small {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .btn-home-small {
    align-self: flex-start;
    width: auto;
  }
  
  .row {
    flex-direction: column;
    align-items: stretch;
  }
  
  button {
    width: 100%;
  }
  
  .btn-home-small,
  .btn-report-corner {
    width: auto;
  }
  
  .btn-visit-site {
    width: 100%;
    justify-content: center;
  }
  
  .refresh-section {
    align-items: stretch;
  }
  
  .refresh-section button {
    width: 100%;
  }
  
  .recent-domains-grid {
    grid-template-columns: 1fr;
  }
  
  .pages-grid-responsive {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  
  .page-card-responsive {
    padding: 12px;
    min-height: 140px;
  }
  
  .page-url-responsive {
    font-size: 10px;
  }
  
  .page-url-responsive a {
    font-size: 10px;
  }
  
  .page-title-responsive {
    font-size: 14px;
  }
  
  .page-desc-responsive {
    font-size: 12px;
  }
  
  .page-kw-responsive {
    font-size: 11px;
  }
  
  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  
  .btn-report-corner {
    align-self: flex-start;
  }
  
  .domain-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .domain-age {
    margin-top: 10px;
  }
  
  .domain-name {
    font-size: 20px;
  }
  
  .main-page-title {
    font-size: 16px;
  }
  
  .main-page-desc {
    font-size: 14px;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .recent-domains-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .pages-grid-responsive {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1025px) {
  .recent-domains-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .pages-grid-responsive {
    grid-template-columns: repeat(3, 1fr);
  }
}