/* style.css - Повністю адаптивний дизайн */
:root {
  --primary-color: #1a365d;
  --primary-dark: #0d2438;
  --primary-light: #2d4a8a;
  --secondary-color: #c9a95e;
  --secondary-dark: #b8942c;
  --accent-color: #2a5d8a;
  --success-color: #2e8b57;
  --warning-color: #d4a017;
  --danger-color: #c53030;
  --light-color: #f8f9fa;
  --dark-color: #1a202c;
  --gray-light: #e2e8f0;
  --gray-medium: #a0aec0;
  --gray-dark: #4a5568;
  --border-color: #cbd5e0;
  
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  
  --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  --box-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
  
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  
  --font-serif: 'Georgia', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--dark-color);
  background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
  width: 100%;
}

body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  z-index: 1000;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

@media (min-width: 640px) {
  .container {
    padding: 0 24px;
  }
}

@media (min-width: 768px) {
  .container {
    padding: 0 32px;
  }
}

@media (min-width: 1024px) {
  .container {
    padding: 0 40px;
  }
}

/* === HEADER === */
.header {
  background: white;
  padding: 20px 0;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
  box-shadow: var(--box-shadow);
  width: 100%;
}

@media (min-width: 768px) {
  .header {
    padding: 30px 0 20px;
    margin-bottom: 40px;
  }
}

.header-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

@media (min-width: 768px) {
  .header-content {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.logo-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
  width: 100%;
}

@media (min-width: 480px) {
  .logo-section {
    flex-direction: row;
    text-align: left;
  }
}

@media (min-width: 768px) {
  .logo-section {
    width: auto;
  }
}

.logo-icon {
  font-size: 2.2rem;
  color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .logo-icon {
    font-size: 2.5rem;
  }
}

.header-title {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  letter-spacing: -0.5px;
  line-height: 1.2;
  margin: 0;
}

@media (min-width: 768px) {
  .header-title {
    font-size: 2rem;
  }
}

@media (min-width: 1024px) {
  .header-title {
    font-size: 2.2rem;
  }
}

.header-subtitle {
  color: var(--gray-dark);
  font-size: 0.9rem;
  font-weight: 400;
  margin-top: 4px;
  max-width: 500px;
}

@media (min-width: 768px) {
  .header-subtitle {
    font-size: 1rem;
  }
}

.contact-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--gray-dark);
  width: 100%;
}

@media (min-width: 480px) {
  .contact-info {
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
  }
}

@media (min-width: 768px) {
  .contact-info {
    flex-direction: column;
    align-items: flex-end;
    width: auto;
    gap: 8px;
    font-size: 0.9rem;
  }
}

.contact-info i {
  color: var(--secondary-color);
  margin-right: 6px;
  width: 16px;
  text-align: center;
}

/* === MAIN CONTENT === */
.main-content {
  flex: 1;
  padding: 0 0 40px;
  width: 100%;
}

@media (min-width: 768px) {
  .main-content {
    padding: 0 0 60px;
  }
}

/* === ADMIN LOGIN === */
.admin-login-container {
  background: white;
  border-radius: var(--border-radius);
  padding: 24px;
  margin: 0 auto 30px;
  max-width: 500px;
  width: 100%;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--secondary-color);
}

@media (min-width: 640px) {
  .admin-login-container {
    padding: 30px;
  }
}

.admin-login-container h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .admin-login-container h2 {
    font-size: 1.4rem;
  }
}

/* === FORM ELEMENTS === */
.form-group {
  margin-bottom: 20px;
  width: 100%;
}

@media (min-width: 768px) {
  .form-group {
    margin-bottom: 24px;
  }
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 600;
  color: var(--gray-dark);
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .form-group label {
    font-size: 0.95rem;
  }
}

.input-field {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  transition: var(--transition);
  background: white;
  color: var(--dark-color);
  font-family: var(--font-sans);
}

@media (min-width: 768px) {
  .input-field {
    padding: 14px 18px;
    font-size: 16px;
  }
}

.input-field:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(26, 54, 93, 0.1);
}

.textarea-field {
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

@media (min-width: 768px) {
  .textarea-field {
    min-height: 120px;
  }
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: none;
  border-radius: var(--border-radius-sm);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  font-family: var(--font-sans);
  letter-spacing: 0.3px;
  width: 100%;
}

@media (min-width: 480px) {
  .btn {
    width: auto;
    padding: 12px 24px;
  }
}

@media (min-width: 768px) {
  .btn {
    padding: 14px 28px;
    font-size: 16px;
  }
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(26, 54, 93, 0.2);
}

.btn-secondary {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary:hover {
  background: var(--secondary-dark);
  transform: translateY(-2px);
}

.btn-danger {
  background: var(--danger-color);
  color: white;
}

.btn-danger:hover {
  background: #9b2c2c;
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: white;
}

.btn-small {
  padding: 8px 16px;
  font-size: 14px;
  gap: 6px;
}

@media (min-width: 768px) {
  .btn-small {
    padding: 10px 18px;
  }
}

.btn-icon {
  padding: 8px;
  min-width: 36px;
  min-height: 36px;
  border-radius: var(--border-radius-sm);
}

@media (min-width: 768px) {
  .btn-icon {
    padding: 10px;
    min-width: 40px;
    min-height: 40px;
  }
}

/* === ADMIN PANEL === */
.admin-panel {
  background: white;
  border-radius: var(--border-radius);
  padding: 24px;
  margin: 0 auto 40px;
  max-width: 100%;
  width: 100%;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--secondary-color);
}

@media (min-width: 768px) {
  .admin-panel {
    padding: 30px;
    max-width: 800px;
  }
}

.admin-panel h2 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .admin-panel h2 {
    font-size: 1.5rem;
    margin-bottom: 25px;
  }
}

/* === UPLOAD FORM === */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

@media (min-width: 768px) {
  .upload-form {
    gap: 24px;
  }
}

/* === FEED === */
.feed {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

@media (min-width: 768px) {
  .feed {
    gap: 30px;
  }
}

.feed-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

@media (min-width: 640px) {
  .feed-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.feed-header h2 {
  color: var(--primary-color);
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
}

@media (min-width: 768px) {
  .feed-header h2 {
    font-size: 1.6rem;
  }
}

.files-count {
  background: var(--light-color);
  color: var(--gray-dark);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .files-count {
    padding: 8px 16px;
    font-size: 0.9rem;
  }
}

/* === FILE CARDS === */
.card {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  border: 1px solid var(--border-color);
  position: relative;
  overflow: hidden;
  width: 100%;
}

@media (min-width: 768px) {
  .card {
    padding: 30px;
  }
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: var(--box-shadow-hover);
}

.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(to bottom, var(--primary-color), var(--accent-color));
}

.card-header {
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--gray-light);
}

@media (min-width: 768px) {
  .card-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
  }
}

.file-meta {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

@media (min-width: 640px) {
  .file-meta {
    flex-wrap: nowrap;
    align-items: center;
  }
}

.file-icon {
  font-size: 1.6rem;
  color: var(--primary-color);
  background: var(--light-color);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  flex-shrink: 0;
}

@media (min-width: 768px) {
  .file-icon {
    font-size: 1.8rem;
    width: 50px;
    height: 50px;
  }
}

.file-title-section {
  flex: 1;
  min-width: 0;
  width: 100%;
}

@media (min-width: 640px) {
  .file-title-section {
    width: auto;
  }
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 4px;
  line-height: 1.3;
  word-break: break-word;
}

@media (min-width: 768px) {
  .card-title {
    font-size: 1.4rem;
    margin-bottom: 5px;
  }
}

.file-date {
  color: var(--gray-medium);
  font-size: 0.8rem;
  font-weight: 500;
  background: var(--light-color);
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-block;
  font-family: 'Courier New', monospace;
  word-break: break-word;
}

@media (min-width: 768px) {
  .file-date {
    font-size: 0.85rem;
    padding: 6px 12px;
  }
}

.file-date i {
  color: var(--secondary-color);
  margin-right: 4px;
}

.card-description {
  color: var(--gray-dark);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 12px 0;
  padding-left: 8px;
  border-left: 2px solid var(--gray-light);
  word-break: break-word;
}

@media (min-width: 768px) {
  .card-description {
    font-size: 1rem;
    margin: 15px 0;
    padding-left: 10px;
  }
}

/* === FILE PREVIEW CONTENT === */
.file-preview-content {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  width: 100%;
}

@media (min-width: 768px) {
  .file-preview-content {
    flex-direction: row;
    gap: 20px;
    align-items: flex-start;
  }
}

.preview-image-container {
  flex: 0 0 auto;
  width: 100%;
}

@media (min-width: 768px) {
  .preview-image-container {
    width: 280px;
  }
}

@media (min-width: 1024px) {
  .preview-image-container {
    width: 300px;
  }
}

.preview-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  box-shadow: var(--box-shadow);
  transition: var(--transition);
  cursor: pointer;
}

@media (min-width: 480px) {
  .preview-image {
    height: 220px;
  }
}

@media (min-width: 768px) {
  .preview-image {
    height: 260px;
  }
}

.preview-image:hover {
  transform: scale(1.02);
  box-shadow: var(--box-shadow-hover);
}

.file-description-container {
  flex: 1;
  padding: 16px;
  background: var(--light-color);
  border-radius: var(--border-radius);
  border: 1px solid var(--border-color);
  width: 100%;
}

@media (min-width: 768px) {
  .file-description-container {
    padding: 20px;
  }
}

.file-description-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .file-description-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
  }
}

.file-description-text {
  line-height: 1.5;
  color: var(--gray-dark);
  font-size: 0.9rem;
  word-break: break-word;
}

@media (min-width: 768px) {
  .file-description-text {
    line-height: 1.6;
    font-size: 0.95rem;
  }
}

.no-preview {
  width: 100%;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-light);
  border-radius: var(--border-radius);
  color: var(--gray-medium);
  font-style: italic;
  border: 2px dashed var(--border-color);
  padding: 20px;
  text-align: center;
}

@media (min-width: 768px) {
  .no-preview {
    height: 260px;
  }
}

/* === FILE ACTIONS === */
.file-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 20px;
  flex-wrap: wrap;
}

@media (min-width: 480px) {
  .file-actions {
    flex-direction: row;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .file-actions {
    gap: 12px;
    margin-top: 25px;
  }
}

.file-actions .btn {
  width: 100%;
}

@media (min-width: 480px) {
  .file-actions .btn {
    width: auto;
  }
}

.file-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 600;
  padding: 10px 18px;
  background: rgba(26, 54, 93, 0.05);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  transition: var(--transition);
  width: 100%;
}

@media (min-width: 480px) {
  .file-link {
    width: auto;
  }
}

.file-link:hover {
  background: rgba(26, 54, 93, 0.1);
  border-color: var(--primary-color);
  transform: translateX(3px);
}

/* === COMMENTS === */
.comments-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--gray-light);
  width: 100%;
}

@media (min-width: 768px) {
  .comments-section {
    margin-top: 30px;
    padding-top: 25px;
  }
}

.comments-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

@media (min-width: 640px) {
  .comments-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .comments-header {
    margin-bottom: 20px;
  }
}

.comments-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .comments-title {
    font-size: 1.2rem;
  }
}

.comments-count {
  background: var(--light-color);
  color: var(--gray-dark);
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
}

.comments-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
  max-height: 400px;
  overflow-y: auto;
  padding-right: 5px;
  width: 100%;
}

@media (min-width: 768px) {
  .comments-list {
    gap: 16px;
    padding-right: 10px;
  }
}

.comments-list::-webkit-scrollbar {
  width: 4px;
}

@media (min-width: 768px) {
  .comments-list::-webkit-scrollbar {
    width: 6px;
  }
}

.comments-list::-webkit-scrollbar-track {
  background: var(--light-color);
  border-radius: 3px;
}

.comments-list::-webkit-scrollbar-thumb {
  background: var(--gray-medium);
  border-radius: 3px;
}

.comment-item {
  background: var(--light-color);
  border-radius: var(--border-radius-sm);
  padding: 14px;
  position: relative;
  border-left: 3px solid var(--gray-medium);
  width: 100%;
}

@media (min-width: 768px) {
  .comment-item {
    padding: 18px;
  }
}

.comment-item.admin-editable {
  border-left-color: var(--secondary-color);
}

.comment-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 768px) {
  .comment-content {
    gap: 10px;
  }
}

.comment-text {
  line-height: 1.5;
  color: var(--dark-color);
  font-size: 0.9rem;
  word-break: break-word;
}

@media (min-width: 768px) {
  .comment-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }
}

.comment-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-top: 8px;
}

@media (min-width: 480px) {
  .comment-meta {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

.comment-date {
  color: var(--gray-medium);
  font-size: 0.75rem;
  font-family: 'Courier New', monospace;
  font-weight: 500;
}

@media (min-width: 768px) {
  .comment-date {
    font-size: 0.8rem;
  }
}

.comment-actions {
  display: flex;
  gap: 8px;
  opacity: 0.7;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .comment-actions {
    opacity: 0;
  }
  
  .comment-item:hover .comment-actions {
    opacity: 1;
  }
}

.comment-form {
  margin-top: 20px;
  background: var(--light-color);
  padding: 18px;
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--border-color);
  width: 100%;
}

@media (min-width: 768px) {
  .comment-form {
    margin-top: 25px;
    padding: 20px;
  }
}

.comment-form h4 {
  color: var(--primary-color);
  margin-bottom: 12px;
  font-size: 1rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .comment-form h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
  }
}

.comments-disabled {
  text-align: center;
  padding: 16px;
  color: var(--gray-medium);
  font-style: italic;
  border-top: 1px solid var(--border-color);
  margin-top: 16px;
  width: 100%;
}

@media (min-width: 768px) {
  .comments-disabled {
    padding: 20px;
    margin-top: 20px;
  }
}

/* === FILTER PANEL === */
.filter-panel {
  background: white;
  border-radius: var(--border-radius);
  padding: 20px;
  margin-bottom: 30px;
  box-shadow: var(--box-shadow);
  border: 1px solid var(--border-color);
  border-top: 4px solid var(--accent-color);
  width: 100%;
}

@media (min-width: 768px) {
  .filter-panel {
    padding: 25px;
    margin-bottom: 35px;
  }
}

.filter-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

@media (min-width: 640px) {
  .filter-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

@media (min-width: 768px) {
  .filter-header {
    margin-bottom: 25px;
  }
}

.filter-title {
  color: var(--primary-color);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

@media (min-width: 768px) {
  .filter-title {
    font-size: 1.3rem;
  }
}

.filter-badge {
  background: var(--gray-light);
  color: var(--gray-dark);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  text-align: center;
  border: 1px solid var(--border-color);
  word-break: break-word;
}

@media (min-width: 768px) {
  .filter-badge {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
}

.filter-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  width: 100%;
}

@media (min-width: 640px) {
  .filter-form {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .filter-form {
    grid-template-columns: repeat(4, 1fr);
  }
}

.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

@media (min-width: 640px) {
  .filter-actions {
    flex-direction: row;
    grid-column: span 2;
    justify-content: flex-end;
  }
}

@media (min-width: 1024px) {
  .filter-actions {
    grid-column: span 4;
  }
}

.filter-actions .btn {
  width: 100%;
}

@media (min-width: 640px) {
  .filter-actions .btn {
    width: auto;
    min-width: 140px;
  }
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

.filter-group label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--gray-dark);
  font-size: 0.9rem;
}

.filter-group .input-field {
  padding: 10px 14px;
  font-size: 14px;
}

@media (min-width: 768px) {
  .filter-group .input-field {
    padding: 12px 16px;
    font-size: 15px;
  }
}

/* === EMPTY STATES === */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  background: white;
  border-radius: var(--border-radius);
  border: 2px dashed var(--border-color);
  margin: 20px 0;
  width: 100%;
}

@media (min-width: 768px) {
  .empty-state {
    padding: 60px 30px;
    margin: 30px 0;
  }
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  color: var(--gray-light);
}

@media (min-width: 768px) {
  .empty-state-icon {
    font-size: 4rem;
    margin-bottom: 20px;
  }
}

.empty-state h3 {
  color: var(--gray-dark);
  margin-bottom: 8px;
  font-weight: 600;
  font-size: 1.2rem;
}

@media (min-width: 768px) {
  .empty-state h3 {
    font-size: 1.3rem;
    margin-bottom: 10px;
  }
}

.empty-state p {
  color: var(--gray-medium);
  max-width: 400px;
  margin: 0 auto;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .empty-state p {
    font-size: 1rem;
  }
}

/* === NOTIFICATIONS === */
#notification-container {
  position: fixed;
  top: 20px;
  right: 20px;
  left: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

@media (min-width: 640px) {
  #notification-container {
    left: auto;
    width: 360px;
  }
}

.notification {
  padding: 14px 18px;
  border-radius: var(--border-radius-sm);
  color: white;
  font-weight: 500;
  box-shadow: var(--box-shadow-hover);
  animation: slideIn 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  border-left: 4px solid;
  pointer-events: auto;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .notification {
    padding: 16px 24px;
    font-size: 1rem;
  }
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.notification.success {
  background: var(--success-color);
  border-left-color: #1e6b3a;
}

.notification.error {
  background: var(--danger-color);
  border-left-color: #9b2c2c;
}

.notification.info {
  background: var(--primary-color);
  border-left-color: var(--primary-dark);
}

.notification.warning {
  background: var(--warning-color);
  border-left-color: #b08c10;
}

.notification i {
  font-size: 1.1rem;
}

/* === PREVIEW MODAL === */
.preview-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.95);
  overflow: auto;
  padding: 20px;
}

@media (min-width: 768px) {
  .preview-modal {
    padding: 40px;
  }
}

.preview-container {
  position: relative;
  margin: 0 auto;
  max-width: 1200px;
  background: #1a1a1a;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
  width: 100%;
}

.preview-header {
  background: #2d2d2d;
  color: white;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

@media (min-width: 768px) {
  .preview-header {
    padding: 15px 20px;
  }
}

.preview-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0;
  word-break: break-word;
  padding-right: 40px;
}

@media (min-width: 768px) {
  .preview-title {
    font-size: 1.1rem;
  }
}

.close-preview {
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: var(--transition);
}

@media (min-width: 768px) {
  .close-preview {
    font-size: 30px;
    width: 40px;
    height: 40px;
  }
}

.close-preview:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.preview-body {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 300px;
  padding: 20px;
  overflow: auto;
}

@media (min-width: 768px) {
  .preview-body {
    min-height: 400px;
    padding: 30px;
  }
}

.preview-actions {
  background: #2d2d2d;
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

@media (min-width: 768px) {
  .preview-actions {
    padding: 15px 20px;
  }
}

.preview-download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary-color);
  color: white;
  padding: 10px 16px;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .preview-download-btn {
    gap: 8px;
    padding: 10px 20px;
    font-size: 1rem;
  }
}

.preview-download-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

.text-preview {
  background: white;
  padding: 20px;
  border-radius: 8px;
  font-family: 'Courier New', monospace;
  white-space: pre-wrap;
  max-height: 70vh;
  overflow-y: auto;
  text-align: left;
  width: 100%;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .text-preview {
    padding: 30px;
    font-size: 1rem;
  }
}

.file-unsupported {
  text-align: center;
  color: #a0aec0;
  padding: 40px 20px;
}

@media (min-width: 768px) {
  .file-unsupported {
    padding: 60px;
  }
}

.file-unsupported i {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
}

@media (min-width: 768px) {
  .file-unsupported i {
    font-size: 4rem;
    margin-bottom: 20px;
  }
}

/* === FOOTER === */
.footer {
  background: var(--primary-color);
  color: white;
  padding: 40px 0 30px;
  margin-top: 60px;
  border-top: 4px solid var(--secondary-color);
  width: 100%;
}

@media (min-width: 768px) {
  .footer {
    padding: 40px 0 30px;
    margin-top: 80px;
  }
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
  width: 100%;
}

@media (min-width: 640px) {
  .footer-content {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
  }
}

.footer-section {
  width: 100%;
}

.footer-title {
  color: white;
  font-size: 1.1rem;
  margin-bottom: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (min-width: 768px) {
  .footer-title {
    font-size: 1.2rem;
    margin-bottom: 20px;
  }
}

.footer-text {
  color: rgba(255, 255, 255, 0.8);
  line-height: 1.6;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

@media (min-width: 768px) {
  .footer-text {
    font-size: 0.95rem;
  }
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-contact div {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  flex-wrap: wrap;
}

.footer-contact i {
  color: var(--secondary-color);
  width: 18px;
  text-align: center;
}

.footer-bottom {
  text-align: center;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.6);
  font-size: 0.8rem;
}

@media (min-width: 768px) {
  .footer-bottom {
    margin-top: 40px;
    padding-top: 20px;
    font-size: 0.9rem;
  }
}

/* === LOADING SPINNER === */
.loading-spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(26, 54, 93, 0.1);
  border-radius: 50%;
  border-top-color: var(--primary-color);
  animation: spin 0.8s linear infinite;
}

@media (min-width: 768px) {
  .loading-spinner {
    width: 20px;
    height: 20px;
    border-width: 3px;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* === UTILITY CLASSES === */
.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

.w-100 {
  width: 100%;
}

.d-none {
  display: none;
}

.d-block {
  display: block;
}

.d-flex {
  display: flex;
}

.flex-wrap {
  flex-wrap: wrap;
}

.align-center {
  align-items: center;
}

.justify-center {
  justify-content: center;
}

.gap-10 {
  gap: 10px;
}

.gap-20 {
  gap: 20px;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

/* === PRINT STYLES === */
@media print {
  .header, .footer, .filter-panel, .admin-login-container, 
  .file-actions, .comments-section, .btn, .preview-modal {
    display: none !important;
  }
  
  .card {
    break-inside: avoid;
    border: 1px solid #ddd;
    box-shadow: none;
  }
  
  body {
    background: white;
  }
}

/* Стили для тегов */
.tag {
  display: inline-block;
  background: linear-gradient(135deg, #1a365d 0%, #2d4a8a 100%);
  color: white;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  margin: 3px;
  letter-spacing: 0.3px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  transition: all 0.2s ease;
  cursor: default;
}

.tag:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.tag i {
  margin-right: 4px;
  font-size: 0.7rem;
  opacity: 0.9;
}

.description-with-tags {
  line-height: 1.8;
}

.file-description-text {
  line-height: 1.6;
  color: #4a5568;
  font-size: 0.95rem;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  max-height: 120px;
}

.file-description-container {
  cursor: pointer;
  transition: all 0.2s ease;
}

.file-description-container:hover {
  background: #edf2f7;
  border-color: #1a365d;
}