:root {
  --primary: #6366f1;
  --secondary: #8b5cf6;
  --accent: #ec4899;
  --dark: #0f0f1a;
  --darker: #0a0a12;
  --light: #e2e8f0;
  --gray: #64748b;
  --success: #10b981;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(135deg, var(--darker) 0%, var(--dark) 100%);
  color: var(--light);
  height: 100vh;
  overflow: hidden;
}

.app-container {
  display: flex;
  height: 100vh;
  position: relative;
}

.sidebar {
  width: 320px;
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar.collapsed {
  transform: translateX(-100%);
}

.header {
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 16px;
}

.file-input-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: 100%;
}

.file-input {
  display: none;
}

.file-input-label {
  display: block;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  font-weight: 600;
  transition: all 0.3s ease;
}

.file-input-label:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
}

.file-type-indicator {
  display: inline-block;
  padding: 4px 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  font-size: 12px;
  margin-left: 8px;
}

.file-type-indicator.pdf {
  background: linear-gradient(135deg, #ff6b6b, #ee5a52);
}

.file-type-indicator.word {
  background: linear-gradient(135deg, #2b5b9e, #1e3a5f);
}

.pages-container {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.page-item {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 2px solid transparent;
}

.page-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateX(4px);
}

.page-item.active {
  border-color: var(--primary);
  background: rgba(99, 102, 241, 0.1);
}

.page-number {
  font-size: 14px;
  color: var(--gray);
  margin-bottom: 8px;
}

.page-preview {
  font-size: 12px;
  color: var(--light);
  opacity: 0.8;
  line-height: 1.4;
  max-height: 60px;
  overflow: hidden;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  position: relative;
}

.toolbar {
  background: rgba(15, 15, 26, 0.8);
  backdrop-filter: blur(20px);
  padding: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.controls-group {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.control-button {
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 8px;
  color: var(--light);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-button:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

.control-button.active {
  background: var(--primary);
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.3);
}

.page-navigation {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
  flex-shrink: 0;
}

.page-info {
  font-size: 14px;
  color: var(--gray);
}

.text-container {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  position: relative;
}

.text-content {
  max-width: 800px;
  margin: 0 auto;
  font-size: 18px;
  line-height: 1.8;
  color: var(--light);
  white-space: pre-wrap;
  font-family: "Inter", sans-serif;
}

.text-content .highlight {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  padding: 2px 4px;
  border-radius: 4px;
  animation: pulse 0.5s ease;
}

.text-content[contenteditable="true"] {
  background: rgba(255, 255, 255, 0.05);
  border: 2px dashed var(--primary);
  padding: 16px;
  border-radius: 8px;
  outline: none;
  min-height: 200px;
}

.text-content[contenteditable="true"]:focus {
  background: rgba(99, 102, 241, 0.1);
  border-color: var(--secondary);
}

.text-content[contenteditable="true"] p {
  outline: none;
  border: 1px solid transparent;
  padding: 4px;
  border-radius: 4px;
}

.text-content[contenteditable="true"] p:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

@keyframes pulse {
  0% {
    opacity: 0;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.8;
  }
}

.progress-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: rgba(255, 255, 255, 0.1);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  width: 0%;
  transition: width 0.3s ease;
}

.sidebar-toggle {
  display: none;
}

@media (max-width: 768px) {
  .sidebar-toggle {
    display: block;
    position: static;
    top: auto;
    left: auto;
    z-index: auto;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: 8px;
    padding: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
  }

  .sidebar-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
  }
}

@media (max-width: 1200px) {
  .toolbar {
    padding: 16px;
    gap: 12px;
  }

  .page-navigation {
    margin-left: 0;
    width: 100%;
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .toolbar {
    padding: 16px;
    gap: 12px;
  }

  .controls-group {
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
  }

  .page-navigation {
    width: 100%;
    justify-content: center;
    margin-left: 0;
  }

  .control-button {
    padding: 8px 12px;
    font-size: 13px;
  }

  .page-info {
    font-size: 13px;
  }
}
