﻿/* ============================================
   DOCUMENTS.CSS - Document Management Page
   Google-Inspired Clean Table Design
   ============================================ */

/* ========== PAGE STRUCTURE ========== */
.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem;
}

/* ========== HEADER ========== */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.header .logo {
  max-height: 56px;
  transition: opacity var(--transition-fast);
}

.header .logo:hover {
  opacity: 0.8;
}

/* ========== SECTION ========== */
.section {
  padding: 1.5rem;
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.section h2 {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  font-size: 1.375rem;
  font-weight: 400;
  margin-bottom: 1.25rem;
  color: var(--text-primary);
}

.section h2 i {
  color: var(--google-blue);
  font-size: 1.25rem;
}

/* ========== MESSAGE CARD ========== */
.message-card {
  padding: 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}

.success-message {
  background: var(--success-subtle);
  color: var(--success);
  border: 1px solid rgba(52, 168, 83, 0.2);
}

.success-message i {
  color: var(--google-green);
}

.error-message {
  background: var(--error-subtle);
  color: var(--error);
  border: 1px solid rgba(234, 67, 53, 0.2);
}

.error-message i {
  color: var(--google-red);
}

/* ========== FILTER CONTAINER ========== */
.filter-container {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.filter-container label {
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filter-container select {
  max-width: 300px;
}

/* ========== TABLE ========== */
.table-container {
  background: var(--color-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th {
  text-align: left;
  padding: 1rem 1.5rem;
  background: var(--color-surface-subtle);
  border-bottom: 1px solid var(--border-light);
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

th a {
  color: inherit;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
}

th a:hover {
  color: var(--text-primary);
}

td {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
  font-size: 0.9375rem;
  vertical-align: middle;
  transition: background var(--transition-fast);
}

tr:last-child td {
  border-bottom: none;
}

tr:hover td {
  background: var(--color-surface-subtle);
  cursor: pointer;
}

/* ========== BUTTONS ========== */
.delete-button {
  background: transparent;
  border: 1px solid var(--border-medium);
  color: var(--text-secondary);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.delete-button:hover {
  background: var(--error-subtle);
  color: var(--error);
  border-color: var(--error);
}

/* ========== MODAL ========== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

.modal {
  display: none;
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90%;
  max-width: 900px;
  max-height: 85vh;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  z-index: 1001;
  overflow: hidden;
  animation: scaleIn 0.3s ease;
  border: 1px solid var(--border-light);
}

.modal-content {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 85vh;
  overflow-y: auto;
  padding: 2rem;
}

.close-button {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-surface-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  z-index: 10;
}

.close-button:hover {
  background: var(--error-subtle);
  color: var(--error);
}

.summary-section {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-light);
}

.chunks-section h3 {
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.chunk {
  background: var(--color-surface-subtle);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1rem;
  transition: all var(--transition-fast);
}

.chunk:hover {
  border-color: var(--google-blue);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}

.chunk h4 {
  margin-bottom: 0.75rem;
  font-size: 1rem;
  color: var(--google-blue);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chunk-type {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--color-surface);
  border: 1px solid var(--border-medium);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chunk p {
  margin: 0;
  color: var(--text-secondary);
  line-height: 1.7;
  font-size: 0.9375rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
  .table-container {
    overflow-x: scroll;
  }
  
  table {
    min-width: 800px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 1rem;
  }
  
  .header {
    flex-direction: column;
    gap: 1rem;
  }
  
  .section {
    padding: 1.25rem;
  }
  
  .filter-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .filter-container select {
    max-width: 100%;
  }
  
  .modal {
    width: 95%;
    padding: 1.5rem;
  }
}

/* ========== ANIMATIONS ========== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-16px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: translate(-50%, -48%) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
  }
}
