/* Global Reset & Theme Variables */
:root {
  --bg-dark: #090b16;
  --bg-medium: #111426;
  --glass-bg: rgba(18, 22, 41, 0.65);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-glow: rgba(139, 92, 246, 0.15);
  
  --primary-gradient: linear-gradient(135deg, #8b5cf6 0%, #3b82f6 100%);
  --hover-gradient: linear-gradient(135deg, #a78bfa 0%, #60a5fa 100%);
  --danger-gradient: linear-gradient(135deg, #f87171 0%, #ef4444 100%);
  --success-gradient: linear-gradient(135deg, #34d399 0%, #10b981 100%);

  --text-primary: #f3f4f6;
  --text-secondary: #9ca3af;
  --text-muted: #6b7280;
  
  --font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --border-radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-dark);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: hidden;
  position: relative;
}

/* Decorative Background Blobs */
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  z-index: -1;
  opacity: 0.4;
  pointer-events: none;
}

.blob-1 {
  width: 400px;
  height: 400px;
  background: #8b5cf6;
  top: -100px;
  left: -100px;
  animation: float 20s infinite ease-in-out;
}

.blob-2 {
  width: 500px;
  height: 500px;
  background: #3b82f6;
  bottom: -150px;
  right: -100px;
  animation: float 25s infinite ease-in-out alternate;
}

.blob-3 {
  width: 300px;
  height: 300px;
  background: #ec4899;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: float 18s infinite ease-in-out;
}

@keyframes float {
  0% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(30px, -50px) scale(1.1); }
  100% { transform: translate(0, 0) scale(1); }
}

/* App Container */
#app-container {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  z-index: 10;
}

/* Glassmorphism Card Base */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-radius: var(--border-radius);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  transition: var(--transition-smooth);
}

.glass-card:hover {
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.5), 0 0 20px 0 var(--glass-glow);
}

/* Fade-in & Transition Classes */
.fade-in {
  animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

/* 1. LOGIN SCREEN STYLING */
#login-container {
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.logo-icon {
  width: 64px;
  height: 64px;
  background: var(--primary-gradient);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  font-size: 1.8rem;
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.3);
}

.login-header h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 0.5rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.password-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-icon {
  position: absolute;
  left: 1rem;
  color: var(--text-muted);
}

.password-wrapper input {
  width: 100%;
  padding: 0.85rem 3rem 0.85rem 2.8rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition-smooth);
}

.password-wrapper input:focus {
  outline: none;
  border-color: #8b5cf6;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.password-toggle-btn {
  position: absolute;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.2rem;
  transition: var(--transition-smooth);
}

.password-toggle-btn:hover {
  color: var(--text-primary);
}

/* Error Messages */
.error-msg {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #f87171;
  font-size: 0.85rem;
  margin-bottom: 1.2rem;
  background: rgba(239, 68, 68, 0.1);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid rgba(239, 68, 68, 0.2);
  animation: shake 0.3s ease-in-out;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.85rem 1.5rem;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  box-shadow: 0 4px 15px rgba(139, 92, 246, 0.2);
}

.btn-primary:hover {
  background: var(--hover-gradient);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(139, 92, 246, 0.3);
}

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

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
}

.btn-block {
  width: 100%;
}

/* 2. DASHBOARD CONTAINER STYLING */
#dashboard-container {
  width: 100%;
  padding: 2rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 1.5rem;
}

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

.logo-small {
  font-size: 2.2rem;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand h2 {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 500;
  background: rgba(16, 185, 129, 0.12);
  color: #34d399;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  border: 1px solid rgba(16, 185, 129, 0.2);
  margin-top: 0.2rem;
}

.pulse-dot {
  width: 6px;
  height: 6px;
  background-color: #10b981;
  border-radius: 50%;
  animation: pulse 1.5s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 1; }
  50% { transform: scale(1.4); opacity: 0.5; }
  100% { transform: scale(0.9); opacity: 1; }
}

/* Dashboard Content Grid */
.dash-content {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 2rem;
}

@media (max-width: 900px) {
  .dash-content {
    grid-template-columns: 1fr;
  }
}

/* Left Panel: Upload */
.upload-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.upload-section h3, .files-section h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.drag-drop-zone {
  border: 2px dashed rgba(255, 255, 255, 0.15);
  border-radius: 14px;
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition-smooth);
  position: relative;
  overflow: hidden;
}

.drag-drop-zone:hover, .drag-drop-zone.dragover {
  border-color: #8b5cf6;
  background: rgba(139, 92, 246, 0.05);
  box-shadow: inset 0 0 15px rgba(139, 92, 246, 0.1);
}

.file-hidden-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.upload-icon-wrapper {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem auto;
  font-size: 1.6rem;
  color: var(--text-secondary);
  transition: var(--transition-smooth);
}

.drag-drop-zone:hover .upload-icon-wrapper,
.drag-drop-zone.dragover .upload-icon-wrapper {
  background: var(--primary-gradient);
  color: white;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.25);
  transform: translateY(-5px);
}

.animate-bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.drop-text-primary {
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 0.4rem;
}

.drop-text-primary span {
  color: #60a5fa;
  font-weight: 600;
  text-decoration: underline;
}

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

/* Upload Progress Card */
.progress-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.progress-details {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
}

.file-name-progress {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 250px;
}

.progress-percentage {
  font-weight: 700;
  color: #60a5fa;
}

.progress-bar-bg {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: var(--primary-gradient);
  width: 0%;
  transition: width 0.1s ease;
  border-radius: 4px;
  box-shadow: 0 0 8px rgba(139, 92, 246, 0.5);
}

.progress-speed-info {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Right Panel: File List */
.files-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.files-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

.search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 280px;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.search-wrapper input {
  width: 100%;
  padding: 0.55rem 1rem 0.55rem 2.2rem;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.85rem;
  transition: var(--transition-smooth);
}

.search-wrapper input:focus {
  outline: none;
  border-color: #3b82f6;
  background: rgba(255, 255, 255, 0.08);
}

.file-list-wrapper {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  min-height: 350px;
  max-height: 500px;
  overflow-y: auto;
  position: relative;
}

/* Custom Scrollbar */
.file-list-wrapper::-webkit-scrollbar {
  width: 6px;
}
.file-list-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.file-list-wrapper::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
}
.file-list-wrapper::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Loading & Empty States */
.list-loading, .list-empty {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-secondary);
}

.list-loading i {
  font-size: 2rem;
  color: #3b82f6;
  margin-bottom: 0.8rem;
}

.list-empty i {
  font-size: 3rem;
  color: var(--text-muted);
  margin-bottom: 0.8rem;
}

.list-empty h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.list-empty p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* File Table */
.file-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9rem;
}

.file-table th {
  padding: 1rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 5;
}

.file-table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
}

.file-table tbody tr {
  transition: var(--transition-smooth);
}

.file-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

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

.file-icon {
  font-size: 1.25rem;
  width: 24px;
  text-align: center;
}

.file-icon.img { color: #ec4899; }
.file-icon.zip { color: #f59e0b; }
.file-icon.pdf { color: #ef4444; }
.file-icon.doc { color: #3b82f6; }
.file-icon.txt { color: #10b981; }
.file-icon.default { color: #9ca3af; }

.file-name-cell {
  font-weight: 500;
  color: var(--text-primary);
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.actions-col {
  text-align: right;
  width: 140px;
}

/* Action Buttons inside Table */
.action-btn-group {
  display: inline-flex;
  gap: 0.4rem;
}

.action-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.85rem;
}

.action-btn:hover {
  transform: scale(1.05);
}

.btn-download:hover {
  background: var(--success-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.btn-delete:hover {
  background: var(--danger-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
}

/* Footer styling */
.footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  border-top: 1px solid rgba(255, 255, 255, 0.03);
  margin-top: auto;
  z-index: 10;
}
