:root {
  --font-sans: 'Inter', sans-serif;
  --bg-color: #f8fafc;
  --surface-color: #ffffff;
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --border-color: #e2e8f0;
  --hover-bg: #f1f5f9;
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
}

* {
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  font-family: var(--font-sans);
  color: var(--text-primary);
  margin: 0;
  padding: 0;
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-container {
  width: 100%;
  max-width: 900px;
  margin: 2rem;
  background: var(--surface-color);
  border-radius: 16px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Header */
.app-header {
  padding: 1.5rem 2rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(10px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  color: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

h1 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

.search-bar {
  position: relative;
  width: 300px;
}

.search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}

input[type="text"] {
  width: 100%;
  padding: 10px 16px 10px 40px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--bg-color);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.2s;
}

input[type="text"]:focus {
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Dashboard */
.file-dashboard {
  padding: 2rem;
  flex: 1;
  background: var(--bg-color); /* Slight contrast for inner area */
}

.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.primary-btn {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.primary-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.2);
}

.primary-btn:active {
  transform: translateY(0);
}

.primary-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
}

.file-count {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* File Grid */
.file-grid {
  display: grid;
  gap: 1rem;
}

/* File Item Card */
.file-item {
  background: white;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.2s ease;
  cursor: default;
}

.file-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: #cbd5e1;
}

.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.file-icon-wrapper {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

/* Icon Colors */
.type-pdf { background: #fee2e2; color: #ef4444; }
.type-image { background: #e0e7ff; color: #4f46e5; }
.type-archive { background: #ffedd5; color: #f97316; }
.type-spreadsheet { background: #dcfce7; color: #22c55e; }
.type-doc { background: #dbeafe; color: #2563eb; }
.type-default { background: #f1f5f9; color: #64748b; }

.file-details {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.file-name {
  font-weight: 500;
  color: var(--text-primary);
}

.file-meta {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--bg-color);
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.download-btn:hover {
  background: var(--primary-color);
  color: white;
}

/* Loading Skeleton */
.loading-skeleton {
  display: grid;
  gap: 1rem;
}

.skeleton-item {
  height: 80px;
  background: #e2e8f0;
  border-radius: 12px;
  animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

@media (max-width: 600px) {
  .app-container {
    margin: 0;
    border-radius: 0;
    min-height: 100vh;
  }
  
  .file-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }
  
  .download-btn {
    width: 100%;
    justify-content: center;
  }
}

.sort-dropdown {
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d1d5db;
  background: #fff;
  font-size: 14px;
  color: #374151;
  cursor: pointer;
  outline: none;
  transition: 0.2s;
  margin-right: 10px;
}

.sort-dropdown:hover {
  border-color: #9ca3af;
}
