/* === Глобальные стили === */

:root {
  --font-main: Arial, sans-serif;
  --color-primary: #4181d7;
  --color-primary-hover: #356fbd;
  --color-accent: #ffe449;
  --color-page: #f4f7fb;
  --color-surface: #fff;
  --color-surface-muted: #f8fafc;
  --color-surface-soft: #f0f5ff;
  --color-border: #e0e0e0;
  --color-border-soft: #e7eaf1;
  --color-text: #222;
  --color-heading: #333;
  --color-text-muted: #666;
  --color-text-soft: #999;
  --color-danger: #d32f2f;
  --color-danger-dark: #b71c1c;
  --color-danger-bg: #ffebee;
  --color-warning: #b8860b;
  --color-warning-bg: #fff8e1;
  --color-success: #2e7d32;
  --color-success-bg: #e8f5e9;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 2px 10px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 24px;
  --focus-ring: 0 0 0 3px rgba(65, 129, 215, 0.14);
  --transition-fast: 0.2s ease;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--font-main);
  background: var(--color-page);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
}

/* === Шапка === */

header {
  background: var(--color-primary);
  color: var(--color-accent);
  padding: 0;
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  height: 80px;
}

.header-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-subtitle {
  font-size: 17px;
  color: var(--color-surface);
  text-align: center;
}

.header-right {
  display: flex;
  gap: 16px;
  position: relative;
}

/* Кнопки в шапке */
.ldpr-btn,
.header-btn {
  box-sizing: border-box;
  background: var(--color-primary);
  border: 2px solid var(--color-accent);
  color: var(--color-accent);
  font-weight: bold;
  border-radius: var(--radius-lg);
  padding: 8px 28px;
  cursor: pointer;
  font-size: 20px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  outline: none;
  transition: background 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.ldpr-btn:hover,
.header-btn:hover {
  background: var(--color-primary-hover);
  color: var(--color-accent);
  text-decoration: none;
}

.ldpr-btn:focus,
.ldpr-btn:active,
.ldpr-btn:visited,
.header-btn:focus,
.header-btn:active,
.header-btn:visited {
  color: var(--color-accent);
  outline: none;
  box-shadow: none;
  text-decoration: none;
}

.ldpr-btn:focus-visible,
.header-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 228, 73, 0.28);
}

.header-subnav {
  background: var(--color-primary-hover);
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.header-subnav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 42px;
  padding: 7px 32px;
}

.header-subnav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 12px;
  color: var(--color-accent);
  font-size: 16px;
  text-decoration: none;
}

.header-subnav a:hover,
.header-subnav a:focus-visible {
  background: rgba(255, 228, 73, 0.14);
  color: var(--color-surface);
  text-decoration: none;
}

.header-subnav span {
  color: rgba(255, 255, 255, 0.65);
  font-weight: 700;
}

/* === Основной макет === */

.main-layout {
  display: flex;
  min-height: calc(100vh - 80px);
  flex: 1;
}

/* Левая панель */
aside {
  background: var(--color-surface);
  width: 315px;
  border-right: 1px solid var(--color-border-soft);
  display: flex;
  flex-direction: column;
  height: calc(100vh - 80px);
  overflow: hidden;
}

aside nav {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
  overflow-y: auto;
  padding-bottom: 16px;
  margin-top: 8px;
}

.nav-link {
  color: var(--color-primary);
  font-size: 22px;
  font-weight: bold;
  text-decoration: none;
  text-align: center;
  margin-bottom: 12px;
}

/* Основное содержимое */
.main-content {
  flex: 1;
  padding: 0;
  display: flex;
  align-items: flex-start;
}

.map-block {
  width: 100%;
  height: calc(100vh - 80px - 86px);
}

#yandex-map {
  width: 100%;
  height: 100%;
  border: none;
  cursor: pointer;
}

/* === Футер === */

footer {
  background: var(--color-primary);
  color: var(--color-surface);
  margin-top: auto;
  padding: 30px 0 26px 0;
}

.footer-row {
  display: flex;
  justify-content: space-between;
  gap: 46px;
  font-size: 17px;
}

.footer-col-title {
  color: var(--color-surface);
  font-weight: bold;
  margin-bottom: 4px;
  letter-spacing: 0.5px;
}

.footer-highlight {
  color: var(--color-accent);
  font-weight: bold;
}

.footer-icon {
  font-size: 17px;
  margin-right: 3px;
}

/* === Адаптив === */

@media (max-width: 900px) {
  .footer-row {
    flex-direction: column;
    gap: 18px;
  }
  .header-row {
    flex-direction: column;
    height: auto;
    gap: 10px;
    padding: 10px;
  }
  .main-layout {
    flex-direction: column;
  }
  aside {
    width: 100%;
    padding: 10px 0;
  }
  .header-subnav-inner {
    padding: 8px 10px;
  }
  .nav-link {
    font-size: 18px;
  }
}

@media (max-width: 600px) {
  .ldpr-btn, .header-btn {
    width: auto;
    min-width: 140px;
    min-height: 44px;
    font-size: 16px;
    padding: 6px 16px;
  }
}

/* === Список заявок: фото снизу === */
.request-item {
  display: flex;
  flex-direction: column; /* Элементы вертикально */
  align-items: stretch;
  padding: 12px !important;
  margin-bottom: 8px !important;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: box-shadow 0.2s;
  cursor: pointer;
}

.request-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Текстовый блок сверху */
.request-item .request-text {
  flex: 1;
  min-width: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 12px;
}

.request-item .request-title {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text);
  margin-bottom: 6px;
  /* ✅ Разрешаем перенос */
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.request-item .request-address {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-bottom: 4px;
  /* ✅ Разрешаем перенос */
  white-space: normal;
  word-wrap: break-word;
  overflow-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

.request-item .request-desc {
  font-size: 12px;
  color: var(--color-text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Фото снизу: на всю ширину */
.request-item .request-thumb-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
}

.request-item .request-thumb {
  width: 100%;
  max-width: 200px; /* Ограничение ширины фото */
  height: 120px;
  border-radius: var(--radius-md);
  object-fit: cover;
  display: block;
}

.request-item .request-thumb-placeholder {
  width: 100%;
  max-width: 200px;
  height: 120px;
  background: #f0f0f0;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-soft);
  font-size: 32px;
}

/* Адаптив для мобильных */
@media (max-width: 600px) {
  .request-item .request-thumb {
    max-width: 100%;
    height: 140px;
  }
  .request-item .request-thumb-placeholder {
    max-width: 100%;
    height: 140px;
  }
}

.hidden-input {
    display: none;
}

.request-select {
    width: 100%;
    padding: 10px;
    margin-bottom: 14px;
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
    font-size: 14px;
}

.comments-error {
    margin-bottom: 10px;
    color: var(--color-danger);
}

.comment-submit-btn {
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--color-primary);
    color: var(--color-surface);
    cursor: pointer;
}

.edit-photo-block {
    margin-bottom: 16px;
}

.request-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

.current-photo-block {
    margin-bottom: 12px;
}

.current-photo-img {
    display: block;
    max-width: 100%;
    max-height: 150px;
    margin-bottom: 8px;
    border-radius: var(--radius-md);
}

.delete-photo-btn {
    width: 100%;
    padding: 8px 16px;
    border: none;
    border-radius: var(--radius-md);
    background: #ff6b6b;
    color: var(--color-surface);
    cursor: pointer;
}

.edit-photo-dropzone {
    padding: 20px;
    border: 2px dashed #ddd;
    border-radius: var(--radius-lg);
    background: var(--color-surface-muted);
    text-align: center;
    cursor: pointer;
}

.edit-photo-preview-wrap {
    position: relative;
    display: inline-block;
}

.edit-photo-preview-img {
    max-width: 100%;
    max-height: 150px;
    border-radius: var(--radius-md);
}

.edit-photo-remove-btn {
    position: absolute;
    top: -10px;
    right: -10px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--color-danger);
    color: var(--color-surface);
    cursor: pointer;
}

.status-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.status-title {
    margin-right: 0;
}

.status-badge {
    padding: 4px 12px;
    border-radius: var(--radius-md);
    color: var(--color-surface);
    font-size: 14px;
    font-weight: 600;
}

.status-not-done {
    background: #e53935;
}

.status-in-progress {
    background: #fbc02d;
}

.status-done {
    background: var(--color-success);
}

.status-select {
    margin-left: 0;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: var(--radius-md);
    background: var(--color-surface-muted);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.status-select:disabled {
    cursor: not-allowed;
}

.request-edit-actions {
    margin-bottom: 16px;
}

.confirm-backdrop {
    position: fixed;
    z-index: 10000;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
}

.confirm-modal {
    width: 90%;
    max-width: 400px;
    padding: var(--space-xl);
    border-radius: var(--radius-lg);
    background: var(--color-surface);
}

.confirm-modal h3 {
    margin: 0 0 12px;
}

.confirm-modal p {
    margin: 0 0 24px;
    color: var(--color-text-muted);
}

.confirm-actions {
    display: flex;
    gap: 12px;
}

.confirm-delete-btn,
.confirm-cancel-btn {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.confirm-delete-btn {
    background: var(--color-danger);
    color: var(--color-surface);
}

.confirm-cancel-btn {
    background: #e5e7eb;
}

.confirm-delete-btn:disabled,
.confirm-cancel-btn:disabled {
    cursor: not-allowed;
}

/* === СТРАНИЦА ПОМОЩИ === */
.help-page-container {
    max-width: 820px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: var(--font-main);
    color: var(--color-text);
    line-height: 1.5;
}

.help-page-container h1 {
    font-size: 32px;
    color: var(--color-primary);
    margin: 0 0 30px 0;
    text-align: center;
    border-bottom: 3px solid var(--color-accent);
    padding-bottom: 15px;
}

.help-section {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: var(--space-xl);
    margin-bottom: var(--space-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border-soft);
}

.help-section h2 {
    font-size: 22px;
    color: var(--color-heading);
    margin: 0 0 12px 0;
}

.help-section p {
    font-size: 15px;
    color: var(--color-text-muted);
    margin: 0;
}

/* === ИНЛАЙН СТАТУСЫ === */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    vertical-align: middle;
}
.status-not-done { background: var(--color-danger-bg); color: #c62828; border: 1px solid #ef9a9a; }
.status-in-progress { background: var(--color-warning-bg); color: var(--color-warning); border: 1px solid #f0e68c; }
.status-done { background: var(--color-success-bg); color: var(--color-success); border: 1px solid #a5d6a7; }

/* === FAQ БЛОК === */
.faq-section {
    background: var(--color-surface-muted);
    box-shadow: var(--shadow-md);
}

.faq-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
}

.faq-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.faq-item h3 {
    font-size: 17px;
    color: var(--color-primary);
    margin: 0 0 8px 0;
    font-weight: 600;
}

.faq-item p {
    font-size: 14px;
    color: var(--color-text-muted);
    line-height: 1.6;
    margin: 0;
}

/* === АДАПТИВНОСТЬ === */
@media (max-width: 600px) {
    .help-page-container {
        margin: 20px auto;
        padding: 0 15px;
    }
    .help-page-container h1 {
        font-size: 26px;
        margin-bottom: 20px;
    }
    .help-section {
        padding: 16px;
        margin-bottom: 16px;
    }
    .help-section h2 {
        font-size: 19px;
    }
    .faq-item h3 {
        font-size: 16px;
    }
}
