/* styles.css */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary-blue: #0078d4;
  --dark-blue: #005a9e;
  --light-gray: #f3f2f1;
  --border-gray: #edebe9;
  --text-primary: #323130;
  --text-secondary: #605e5c;
  --teal: #008575;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: #faf9f8;
  color: var(--text-primary);
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Header */
.header {
  background: var(--primary-blue);
  color: white;
  height: 50px;
  display: flex;
  align-items: center;
  padding: 0 16px;
  gap: 16px;
  position: relative;
  z-index: 1000;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  transition: 0.3s;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-icon {
  font-size: 24px;
}

.brand-text {
  font-size: 16px;
  font-weight: 600;
}

.header-search {
  flex: 1;
  max-width: 600px;
  position: relative;
}

.header-search input {
  width: 100%;
  padding: 8px 12px 8px 36px;
  border: none;
  border-radius: 2px;
  font-size: 14px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.6;
}

.header-actions {
  display: flex;
  gap: 8px;
}

.icon-btn {
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  padding: 8px;
  font-size: 18px;
  border-radius: 2px;
  transition: background 0.2s;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Sidebar */
.sidebar {
  position: fixed;
  left: 0;
  top: 50px;
  bottom: 0;
  width: 360px;
  background: white;
  border-right: 1px solid var(--border-gray);
  display: flex;
  flex-direction: column;
  z-index: 900;
  transition: transform 0.3s ease;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-gray);
}

.sidebar-header h2 {
  font-size: 18px;
  font-weight: 600;
}

.close-btn {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  color: var(--text-secondary);
}

.sidebar-section {
  flex: 1;
  overflow-y: auto;
  padding: 16px 0;
}

.sidebar-section h3 {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  padding: 0 20px 12px;
}

.file-list {
  display: flex;
  flex-direction: column;
}

.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  cursor: pointer;
  transition: background 0.2s;
}

.file-item:hover {
  background: var(--light-gray);
}

.file-icon {
  font-size: 24px;
}

.file-info {
  flex: 1;
  min-width: 0;
}

.file-name {
  font-size: 14px;
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-size {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.download-btn {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 8px;
  opacity: 0.6;
  transition: opacity 0.2s;
}

.download-btn:hover {
  opacity: 1;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-gray);
  display: flex;
  gap: 12px;
  align-items: center;
}

.link-btn {
  background: none;
  border: none;
  color: var(--primary-blue);
  cursor: pointer;
  font-size: 14px;
  padding: 8px 0;
}

.btn-primary {
  background: var(--primary-blue);
  color: white;
  border: none;
  padding: 8px 24px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-primary:hover {
  background: var(--dark-blue);
}

/* Main Content */
.main-content {
  margin-left: 360px;
  padding: 32px;
  transition: margin-left 0.3s ease;
}

.hero-section {
  background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
  padding: 48px;
  border-radius: 8px;
  margin-bottom: 32px;
  position: relative;
  overflow: hidden;
}

.hero-section::after {
  content: '';
  position: absolute;
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
  width: 400px;
  height: 300px;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 300"><rect fill="%23b3e5fc" width="400" height="300" rx="8"/></svg>');
  opacity: 0.3;
}

.hero-badge {
  display: inline-block;
  background: rgba(255, 255, 255, 0.9);
  padding: 6px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

.hero-section h1 {
  font-size: 32px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.hero-section p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  max-width: 500px;
}

.btn-action {
  background: var(--teal);
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 2px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: background 0.2s;
}

.btn-action:hover {
  background: #006d5d;
}

.frequent-sites h2 {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

.sites-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.site-card {
  background: white;
  border: 1px solid var(--border-gray);
  border-radius: 4px;
  height: 120px;
}

.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Overlay */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 800;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.overlay.active {
  display: block;
  opacity: 1;
}

/* Loader */
.loader-container {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  align-items: center;
  justify-content: center;
}

.loader-container.active {
  display: flex;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.3);
  border-top-color: var(--primary-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  align-items: center;
  justify-content: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background: white;
  padding: 32px;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  animation: modalSlideIn 0.3s ease;
}

.modal.closing .modal-content {
  animation: modalSlideOut 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalSlideOut {
  from {
    opacity: 1;
    transform: translateY(0);
  }
  to {
    opacity: 0;
    transform: translateY(-20px);
  }
}

.modal-content h3 {
  font-size: 20px;
  margin-bottom: 16px;
}

.modal-content p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  word-break: break-word;
}

/* Mobile Styles */
@media (max-width: 768px) {
  .menu-toggle {
    display: flex;
  }

  .header-search {
    display: none;
  }

  .brand-text {
    font-size: 14px;
  }

  .header-actions {
    margin-left: auto;
  }

  .sidebar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
  }

  .close-btn {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .hero-section {
    padding: 24px;
  }

  .hero-section h1 {
    font-size: 24px;
  }

  .hero-section p {
    font-size: 14px;
  }

  .hero-section::after {
    display: none;
  }
}

@media (max-width: 480px) {
  .header {
    padding: 0 12px;
  }

  .main-content {
    padding: 16px;
  }

  .sidebar {
    width: 100%;
  }

  .hero-section {
    padding: 20px;
  }

  .sites-grid {
    grid-template-columns: 1fr;
  }
}