/* styles.css */
:root {
  --color-white-solid: #ffffff;
  --color-white: #ffffff;
  --color-black-solid: #000000;
  --color-black: #000000;
  --color-azure-88: #C9DEFA;
  --color-light-blue: #C9DEFA;
  --color-grey-21: #343536;
  --color-gray: #343536;
  --color-grey-46: #757575;
  --color-gray-light: #757575;
  --color-grey-71: #B6B6B6;
  --color-beige: #7A6E62;
  --sidebar-width: 255px;
  --header-height: 60px;
  --safe-area-inset-left: env(safe-area-inset-left);
  --safe-area-inset-right: env(safe-area-inset-right);
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Ubuntu', sans-serif;
  background-color: var(--color-white-solid);
  color: var(--color-grey-21);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.page {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

/* Sidebar */
nav.sidebar {
  width: var(--sidebar-width);
  background: linear-gradient(to bottom, #ffffff 0%, #f8f9fa 100%);
  border-right: 1px solid rgba(0, 0, 0, 0.08);
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 1000;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: sidebar always visible */
@media (min-width: 769px) {
  nav.sidebar {
    transform: translateX(0);
    position: fixed;
  }
  
  main.with-sidebar {
    margin-left: var(--sidebar-width);
  }
}

.sidebar.active {
  transform: translateX(0);
}

.sidebar h1 {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 400;
  line-height: 1.35;
  margin-bottom: 15px;
  color: var(--color-grey-21);
}

/* Sidebar section styling for better visual separation */
.sidebar-section {
  padding: 8px 0;
}

.sidebar-section .nav-list {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 10px 15px;
  margin-left: 5px;
}

/* Search */
.search-box {
  position: relative;
  margin-bottom: 20px;
}

.search-box input {
  width: 100%;
  height: 40px;
  padding: 10px 35px 10px 40px;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  color: var(--color-grey-46);
  background: rgba(255, 255, 255, 0.7);
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.search-box input:focus {
  outline: none;
  border-color: var(--color-grey-21);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.search-box svg {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
}

/* Nav */
.section-title {
  font-family: 'Unbounded', sans-serif;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  margin: 25px 0 10px;
  color: var(--color-grey-46);
  letter-spacing: 0.5px;
  padding-left: 10px;
}

.nav-list {
  padding-left: 15px;
}

.nav-item {
  opacity: 0.75;
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 400;
  padding: 10px 12px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  border-radius: 6px;
  background: transparent;
  border: none;
  text-align: left;
  width: 100%;
  color: var(--color-grey-21);
  text-decoration: none;
  display: block;
  margin: 2px 0;
}

.nav-item:hover,
.nav-item:focus {
  opacity: 1;
  background: rgba(0, 0, 0, 0.04);
  transform: translateX(3px);
}

.nav-item:active {
  transform: scale(0.98) translateX(3px);
}

.footer-note {
  opacity: 0.5;
  font-family: 'Unbounded', sans-serif;
  font-size: 13px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  color: var(--color-grey-46);
}

/* Main content */
main {
  flex: 1;
  background: var(--color-azure-88);
  padding: 30px 0 40px;
  margin-left: 0;
  min-height: 100vh;
  transition: margin-left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Desktop: main content offset for sidebar */
@media (min-width: 769px) {
  main.with-sidebar {
    margin-left: var(--sidebar-width);
  }
}

/* Question Page Specific Styles */
.breadcrumb {
    padding: 20px 40px;
    background: var(--color-grey-21);
}

.breadcrumb-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb-item {
    color: var(--color-beige);
    font-size: 16px;
}

.breadcrumb-arrow {
    color: var(--color-grey-46);
}

.header {
    background: var(--color-grey-21);
    padding: 60px 40px;
}

.header-title {
    text-align: center;
    color: var(--color-white-solid);
    font-size: 38px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 500;
    line-height: 57px;
}

.content {
    padding: 60px 40px;
    background: var(--color-azure-88);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.filters {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.filter-select {
    padding: 12px 20px;
    border: 2px solid var(--color-grey-21);
    border-radius: 8px;
    font-size: 16px;
    background: var(--color-white-solid);
    cursor: pointer;
    min-width: 200px;
    font-family: 'Ubuntu', sans-serif;
}

.question-item {
    margin-bottom: 20px;
    background: var(--color-white-solid);
    border-radius: 12px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: transform 0.2s ease;
}

.question-item:hover {
    transform: translateY(-2px);
}

.question-header {
    padding: 25px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    border-bottom: 1px solid #eee;
}

.question-title {
    color: var(--color-black-solid);
    font-size: 20px;
    font-family: 'Unbounded', sans-serif;
    font-weight: 400;
    line-height: 27px;
    flex: 1;
}

.toggle-icon {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
    font-size: 18px;
    color: var(--color-grey-21);
}

.toggle-icon.expanded {
    transform: rotate(180deg);
}

.question-content {
    padding: 0 30px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.question-content.expanded {
    padding: 20px 30px;
    max-height: 1000px;
}

.description {
    color: var(--color-grey-21);
    font-size: 18px;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--color-grey-21);
}

.answer-section {
    margin-bottom: 15px;
}

.answer-good {
    color: #28a745;
    font-size: 16px;
    line-height: 1.8;
    padding: 15px;
    background: #f8fff9;
    border-radius: 8px;
    border-left: 4px solid #28a745;
    margin-bottom: 10px;
}

.answer-bad {
    color: #dc3545;
    font-size: 16px;
    line-height: 1.8;
    padding: 15px;
    background: #fff8f8;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-grey-21);
    color: var(--color-white-solid);
    border-radius: 20px;
    font-size: 12px;
    margin-left: 15px;
}

.group-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--color-beige);
    color: var(--color-white-solid);
    border-radius: 20px;
    font-size: 12px;
    margin-left: 10px;
}

.no-tasks {
    text-align: center;
    color: var(--color-grey-46);
    font-size: 18px;
    padding: 40px;
    background: var(--color-white-solid);
    border-radius: 12px;
}

.stats {
    background: var(--color-white-solid);
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 30px;
    text-align: center;
}

.stats-number {
    font-size: 24px;
    font-weight: bold;
    color: var(--color-grey-21);
    font-family: 'Unbounded', sans-serif;
}

.stats-label {
    color: var(--color-grey-46);
    font-size: 14px;
}

/* Cards grid (for main page) */
.section {
  max-width: 1200px;
  margin: 0 auto 50px;
  padding: 0 clamp(20px, 4vw, 40px);
}

.section-header {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(32px, 5vw, 50px);
  font-weight: 500;
  line-height: 1.17;
  text-align: left;
  margin-bottom: 40px;
  padding: 0 10px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 350px), 1fr));
  gap: clamp(20px, 3vw, 30px);
  width: 100%;
}

.card {
  background: var(--color-white-solid);
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.card:active {
  transform: translateY(-2px);
}

.card-image-wrapper {
  width: 100%;
  height: 250px;
  background: var(--color-grey-71);
  overflow: hidden;
  position: relative;
}

.card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.card-image.loaded {
  opacity: 1;
}

.card-content {
  padding: clamp(20px, 3vw, 24px);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card-title {
  font-family: 'Unbounded', sans-serif;
  font-size: clamp(18px, 2vw, 20px);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
}

.card-text {
  font-size: clamp(14px, 1.5vw, 16px);
  line-height: 1.5;
  color: var(--color-grey-46);
  flex: 1;
  margin: 0;
}

.card-actions {
  display: flex;
  gap: 12px;
  margin-top: auto;
}

/* Buttons */
.btn {
  padding: 12px 20px;
  font-family: 'Unbounded', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  border-radius: 8px;
  white-space: nowrap;
  border: none;
  transition: all 0.2s ease;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1;
}

.btn:focus {
  outline: 2px solid var(--color-black-solid);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--color-black-solid);
  color: var(--color-white-solid);
}

.btn-primary:hover,
.btn-primary:focus {
  background: var(--color-grey-21);
  transform: translateY(-1px);
}

.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
}

.overlay.active {
  display: block;
}

/* Mobile menu button - hidden on desktop, visible on mobile */
@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
    position: fixed;
    left: 20px;
    top: 20px;
    background: rgba(255, 255, 255, 0.8);
    border: 2px solid var(--color-black-solid);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1001;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: background-color 0.2s ease;
  }

  .mobile-menu-btn:hover {
    background: rgba(255, 255, 255, 0.9);
  }
}

/* Адаптивность */
@media (max-width: 1024px) {
  :root { --sidebar-width: 240px; }
  .cards-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 25px; }
  .section-header { margin-bottom: 35px; }
}

@media (max-width: 768px) {
  .page { flex-direction: column; }
  nav.sidebar { width: 280px; }

  .breadcrumb,
  .header,
  .content {
      padding: 20px;
  }

  .header-title {
      font-size: 28px;
      line-height: 1.3;
  }

  .filters {
      flex-direction: column;
  }

  .filter-select {
      min-width: 100%;
  }

  .question-header {
      padding: 20px;
  }

  .question-title {
      font-size: 18px;
  }

  .cards-grid { grid-template-columns: 1fr; gap: 20px; }
  .section-header { margin-bottom: 30px; text-align: center; }
  .card-content { padding: 20px; }
  .card-actions { flex-direction: column; }
  .btn { width: 100%; min-height: 48px; }
}

@media (min-width: 769px) {
  main.with-sidebar { margin-left: var(--sidebar-width); }
}

/* Add subtle shadow to main content on desktop for depth */
@media (min-width: 769px) {
  main.with-sidebar {
    box-shadow: -2px 0 8px rgba(0, 0, 0, 0.04);
  }
}

@media (max-width: 480px) {
  .section { padding: 0 15px; }
  .section-header { font-size: 28px; margin-bottom: 25px; }
  .card { border-radius: 10px; }
  .card-image-wrapper { height: 200px; }
}
/* Question actions (edit/delete buttons) */
.question-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.btn-edit {
  display: inline-block;
  padding: 10px 20px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-edit:hover {
  background: linear-gradient(135deg, #357ABD 0%, #2868A8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-delete {
  padding: 10px 20px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-delete:hover {
  background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(231, 76, 60, 0.3);
}

@media (max-width: 768px) {
  .question-actions {
    flex-direction: column;
  }
  
  .btn-edit,
  .btn-delete {
    width: 100%;
    text-align: center;
  }
}

/* Question card link - makes the entire card clickable */
.question-card-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.question-card-link:hover {
  text-decoration: none;
  color: inherit;
}

/* Admin actions below question card */
.question-admin-actions {
  display: flex;
  gap: 10px;
  padding: 15px 30px;
  border-top: 1px solid #eee;
}

/* Question detail page styles */
.question-detail-card {
  background: var(--color-white-solid);
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  padding: 30px;
  margin-bottom: 20px;
}

.question-detail-header {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}

.question-detail-text {
  color: var(--color-black-solid);
  font-size: 24px;
  font-family: 'Unbounded', sans-serif;
  font-weight: 400;
  line-height: 1.4;
  margin-bottom: 20px;
}

.answer-blocks {
  margin-top: 30px;
}

.answer-block {
  margin-bottom: 20px;
}

.answer-toggle {
  width: 100%;
  padding: 15px 20px;
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Ubuntu', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--color-grey-21);
  transition: all 0.3s ease;
}

.answer-toggle:hover {
  background: #e9ecef;
  border-color: var(--color-grey-21);
}

.toggle-icon-small {
  transition: transform 0.3s ease;
  font-size: 14px;
}

.toggle-icon-small.expanded {
  transform: rotate(180deg);
}

.answer-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.answer-content.expanded {
  max-height: 2000px;
  margin-top: 10px;
}

.navigation-links {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.btn-back {
  display: inline-block;
  padding: 12px 24px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: linear-gradient(135deg, #6c757d 0%, #5a6268 100%);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-back:hover {
  background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* Question navigation (prev/next) */
.question-navigation {
  display: flex;
  gap: 10px;
  margin-top: 15px;
  justify-content: space-between;
}

.btn-nav {
  display: inline-block;
  padding: 12px 24px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: white;
  background: linear-gradient(135deg, #4A90E2 0%, #357ABD 100%);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.btn-nav:hover {
  background: linear-gradient(135deg, #357ABD 0%, #2868A8 100%);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(74, 144, 226, 0.3);
}

.btn-nav-disabled {
  display: inline-block;
  padding: 12px 24px;
  font-family: 'Ubuntu', sans-serif;
  font-size: 14px;
  font-weight: 500;
  color: #999;
  background: #e0e0e0;
  border-radius: 8px;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .question-navigation {
    flex-direction: column;
  }
  
  .btn-nav,
  .btn-nav-disabled {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .question-admin-actions {
    flex-direction: column;
    padding: 15px 20px;
  }
  
  .question-detail-card {
    padding: 20px;
  }
  
  .question-detail-text {
    font-size: 20px;
  }
  
  .answer-toggle {
    font-size: 14px;
    padding: 12px 15px;
  }
  
  .navigation-links {
    flex-direction: column;
  }
  
  .btn-back,
  .question-navigation {
    width: 100%;
  }
}
