/* Modern Dashboard Styles */
:root {
  --primary-color: #4f46e5;
  --primary-hover: #4338ca;
  --secondary-color: #10b981;
  --text-primary: #1f2937;
  --text-secondary: #6b7280;
  --bg-primary: #f9fafb;
  --card-bg: #ffffff;
  --border-radius: 12px;
  --glass-bg: rgba(255, 255, 255, 0.7);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --text-color: #1f2937;
  --text-light: #ffffff;
  --card-background: #ffffff;
  --background-color: #f6f8ff;
  --border-color: #e2e8f0;
  --accent-color: #10b981;
  --footer-bg: #f9fafb;
  --footer-text: #1f2937;
}

body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background: linear-gradient(135deg, var(--background-color) 0%, var(--secondary-color) 20%);
  margin: 0;
  padding: 0;
  transition: background 0.3s ease, color 0.3s ease;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1; /* Allow main content to grow and push footer down */
}

.page-container {
  max-width: 100%;
  overflow-x: hidden;
  padding: 0;
}

/* Navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.5rem 5%;
  background-color: var(--background-color);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--primary-color);
}

.logo i {
  margin-right: 0.5rem;
  font-size: 1.75rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover {
  color: var(--primary-color);
}

.login-btn {
  padding: 0.5rem 1.25rem;
  background-color: var(--secondary-color);
  border-radius: var(--border-radius);
  font-weight: 600;
}

.login-btn:hover {
  background-color: var(--border-color);
}
.user-section {
  display: flex;
  align-items: center;
  gap: 1rem;
}

#userInfo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--text-primary);
}

.username {
  font-weight: 500;
}

.btn-login {
  padding: 0.5rem 1rem;
  background-color: var(--primary-color);
  color: white;
  border-radius: var(--border-radius);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

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

/* Dropdown Styles */
.dropdown {
  position: relative;
  display: inline-block;
}

.user-menu-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem; /* Slightly larger icon */
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.user-menu-btn i.fa-caret-down {
  font-size: 0.8rem; /* Smaller caret */
}

.dropdown-content {
  display: none;
  position: absolute;
  right: 0;
  background-color: var(--card-bg);
  min-width: 160px;
  box-shadow: var(--shadow-md);
  border-radius: 8px; /* Rounded corners */
  z-index: 1;
  overflow: hidden; /* Ensure border-radius applies */
  border: 1px solid var(--glass-border); /* Subtle border */
}

.dropdown-content a {
  color: var(--text-primary);
  padding: 12px 16px;
  text-decoration: none;
  display: flex; /* Use flex for icon alignment */
  align-items: center;
  gap: 0.75rem; /* Space between icon and text */
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.dropdown-content a i {
  width: 16px; /* Fixed width for icons */
  text-align: center;
  color: var(--text-secondary);
}

.dropdown-content a:hover {
  background-color: rgba(0, 0, 0, 0.05); /* Subtle hover */
}

.dark-theme .dropdown-content {
  background-color: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.dark-theme .dropdown-content a {
  color: var(--text-color);
}

.dark-theme .dropdown-content a:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.dropdown-content.show {
  display: block;
}

/* Dark theme adjustments for user section */
.dark-theme #userInfo,
.dark-theme .user-menu-btn {
  color: var(--text-light);
}

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

.logo-icon {
  font-size: 2rem;
  color: var(--primary-color);
}

/* Main content container */
.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 3rem;
}

.app-title {
  font-size: 2rem;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 600;
}

.highlight {
  color: var(--primary-color);
}

.tagline {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2.5rem;
}

/* Upload area styling */
.upload-area {
  padding: 3rem;
  text-align: center;
  border: 2px dashed var(--primary-color);
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  cursor: pointer;
  transition: var(--transition);
}

.upload-area:hover {
  background: rgba(79, 70, 229, 0.05);
  transform: translateY(-5px);
}

.upload-icon-container {
  font-size: 4rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.upload-title {
  font-size: 1.2rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.upload-subtitle {
  color: var(--text-secondary);
}

/* Progress bar */
.progress-container {
  margin-top: 2rem;
}

.progress-bar {
  height: 8px;
  background: #e5e7eb;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-bar::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  animation: progress-animation 2s linear infinite;
  border-radius: 4px;
}

@keyframes progress-animation {
  0% {
    background-position: 0% 50%;
  }
  100% {
    background-position: 100% 50%;
  }
}

.progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
}

/* File info */
.file-info {
  display: flex;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 2rem;
  align-items: center;
}

.file-icon {
  font-size: 2rem;
  margin-right: 1rem;
  color: var(--primary-color);
}

.file-details {
  flex: 1;
}

.file-details p {
  margin: 0.25rem 0;
}

/* Options styling */
.options-container {
  margin-bottom: 2rem;
}

.options-title {
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
  color: var(--text-primary);
}

.option-row {
  display: flex;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-group {
  flex: 1;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  position: relative;
}

.option-icon {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  color: var(--primary-color);
  font-size: 1.2rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

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

.input-suffix {
  margin-left: 0.5rem;
  color: var(--text-secondary);
}

.modern-input,
.modern-select {
  width: 100%;
  margin: 0 auto; 
  box-sizing: border-box;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  background: rgba(255, 255, 255, 0.5);
  font-family: 'Poppins', sans-serif;
  font-size: 1rem;
  transition: var(--transition);
}

.modern-input:focus,
.modern-select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.2);
}

/* Button styling */
.glass-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 1rem 2rem;
  border-radius: 10px;
  border: none;
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
  color: white;
  width: 100%;
  margin-bottom: 1.5rem;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(79, 70, 229, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.8);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
  padding: 0.75rem 1.5rem;
}

.btn-secondary:hover {
  background: rgba(79, 70, 229, 0.1);
}

/* Result styling */
.result {
  text-align: center;
  padding: 2rem;
  animation: fadeIn 0.5s ease;
}

.success-icon {
  font-size: 3rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
}

.link-container {
  background: rgba(0, 0, 0, 0.05);
  padding: 1rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  word-break: break-all;
  color: var(--primary-color);
  font-weight: 500;
}

.details-container {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-secondary);
}

/* Animation classes */
.animated-section {
  animation: fadeIn 0.5s ease;
}

.pulse {
  animation: pulse 2s infinite;
}

.bounce {
  animation: bounce 2s infinite;
}

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

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

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

/* Theme toggle button */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-background, #ffffff);
  border: 1px solid var(--border-color, #e5e7eb);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
  transform: rotate(30deg);
  background: var(--primary-color);
  color: white;
}

/* Footer styling */
footer {
  margin-top: auto; /* Keep footer at the bottom */
  background-color: #1f2937; /* Keep dark background for visibility */
  color: white;
  padding: 1.5rem 5% 1rem; /* Reduced top and bottom padding */
}

.footer-content {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center; /* Align items vertically */
  margin-bottom: 1rem; /* Reduced margin */
  gap: 1rem;
}
.footer-links {
  display: flex;
  gap: 2rem;
}
.footer-links a {
  color: #d1d5db; /* Light gray for better visibility */
  text-decoration: none;
  transition: color 0.3s ease;
}
.footer-links a:hover {
  color: white; /* Change to white on hover */
}
.footer-social {
  display: flex;
  gap: 1rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background-color: #374151;
  color: white;
  transition: var(--transition);
}

.footer-social a:hover {
  background-color: var(--primary-color);
}
.copyright {
  text-align: center;
  padding-top: 1rem; /* Reduced padding */
  border-top: 1px solid #374151;
  color: #9ca3af;
}

/* Responsive styling */
@media (max-width: 768px) {
  .option-row {
    flex-direction: column;
    gap: 1rem;
  }
  
  .details-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .footer-content {
    flex-direction: column;
    gap: 1rem;
  }
}

/* Download Tracking Styles */
.section-header {
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  border-radius: var(--border-radius);
  position: relative;
}

.section-header h3 {
  font-size: 1.25rem;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.section-header .subtitle {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.downloads-container {
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  box-shadow: var(--glass-shadow);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.downloads-container h4 {
  font-size: 1.1rem;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.downloads-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.download-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: var(--transition);
}

.dark-theme .download-item {
  background: rgba(31, 41, 55, 0.3);
  border: 1px solid rgba(75, 85, 99, 0.2);
}

.download-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.dark-theme .download-item:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.download-icon {
  font-size: 1.5rem;
  color: var(--primary-color);
  flex-shrink: 0;
}

.download-info {
  flex: 1;
}

.download-title {
  font-weight: 500;
  margin: 0 0 0.25rem 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 200px;
}

.download-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.download-progress-wrapper {
  flex: 1;
  max-width: 250px;
}

.download-progress {
  height: 8px;
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.dark-theme .download-progress {
  background: rgba(255, 255, 255, 0.1);
}

.download-progress-bar {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.download-percentage {
  font-size: 0.85rem;
  font-weight: 500;
  margin-top: 0.25rem;
  text-align: right;
}

.download-status {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary-color);
}

.download-status.pending {
  background: rgba(245, 158, 11, 0.1);
  color: #f59e0b;
}

.download-status.active {
  background: rgba(79, 70, 229, 0.1);
  color: var(--primary-color);
}

.download-status.completed {
  background: rgba(16, 185, 129, 0.1);
  color: var(--secondary-color);
}

.download-status.failed {
  background: rgba(239, 68, 68, 0.1);
  color: #ef4444;
}

.no-downloads-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  color: var(--text-secondary);
  text-align: center;
  gap: 0.5rem;
}

.no-downloads-message i {
  font-size: 2rem;
  margin-bottom: 1rem;
  opacity: 0.5;
}

/* Responsive styles for download tracking */
@media (max-width: 768px) {
  .download-item {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .download-progress-wrapper {
    max-width: 100%;
    width: 100%;
    margin-top: 1rem;
  }
  
  .download-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* File download container */
.file-download-container {
  display: flex;
  padding: 2rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  gap: 2rem;
}

@media (max-width: 768px) {
  .file-download-container {
    flex-direction: column;
  }
}

.file-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 200px;
  min-height: 200px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.file-preview .file-icon {
  font-size: 4rem;
  color: var(--primary-color);
}

.file-preview-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.file-preview-content img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.file-info-download {
  flex: 1;
}

.file-info-download h3 {
  margin-top: 0;
  margin-bottom: 1rem;
  font-size: 1.4rem;
  word-break: break-word;
}

.progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  transition: width 0.3s ease;
}

.download-actions {
  margin-top: 1.5rem;
}

.transfer-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  text-align: center;
  color: #ef4444;
  margin-bottom: 1.5rem;
}

.transfer-error i {
  font-size: 3rem;
  margin-bottom: 1rem;
}

#retryButton {
  margin-top: 1rem;
}

/* Progress bar animations and enhancements */
.progress-bar-fill {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* Add pulsing animation for progress bar */
.pulse-animation {
  animation: pulse 1.5s ease-in-out infinite;
  background: linear-gradient(
    to right,
    var(--primary-color),
    var(--secondary-color),
    var(--primary-color)
  );
  background-size: 200% 100%;
  animation: pulse-bg 2s ease infinite;
}

@keyframes pulse-bg {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

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

/* Success pulse animation for completed downloads */
.success-pulse {
  animation: success-pulse 1.5s ease-in-out;
  background: var(--secondary-color) !important;
}

@keyframes success-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
  }
}

/* Completed progress bar style */
.completed {
  background: var(--secondary-color) !important;
}

/* Loading dots animation for status messages */
.loading-dots {
  display: inline-block;
  width: 15px;
  text-align: left;
}

.loading-dots:after {
  content: '.';
  animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
  0%, 20% {
    content: '.';
  }
  40% {
    content: '..';
  }
  60% {
    content: '...';
  }
  80%, 100% {
    content: '';
  }
}

/* Wait time indicator styling */
.wait-time {
  display: flex;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-top: 0.5rem;
  gap: 0.5rem;
}

.wait-time i {
  color: var(--primary-color);
}

/* Download actions styling */
.download-actions {
  margin-top: 1.5rem;
  display: flex;
  justify-content: center;
}

/* Download complete info section */
.download-complete-info {
  margin-top: 2rem;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  margin-bottom: 1.5rem;
  transition: var(--transition);
  animation: slideUp 0.5s ease;
}

.download-complete-info h4 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

.download-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.1);
  color: var(--text-secondary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.download-note i {
  color: var(--primary-color);
}

/* Section transitions */
.animated-section {
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.slide-in {
  animation: slideIn 0.5s ease;
}

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

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

/* Transfer error styling improvements */
.transfer-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem;
  text-align: center;
  color: #ef4444;
  margin-bottom: 1.5rem;
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Dark theme adjustments */
.dark-theme .download-complete-info {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
}

.dark-theme .download-note {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Dark theme overrides for dashboard */
.dark-theme {
  --bg-primary: #2d3748;
  --card-bg: #2d3748;
  --glass-bg: rgba(31, 41, 55, 0.7);
  --glass-border: rgba(75, 85, 99, 0.5);
  --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --text-primary: #ffffff;
  --text-secondary: #6b7280;
  --text-color: #ffffff;
  --text-light: #ffffff;
  --card-background: #2d3748;
  --background-color: #2d3748;
  --border-color: #4f46e5;
  --accent-color: #10b981;
  --footer-bg: #2d3748;
  --footer-text: #ffffff;
}

.dark-theme body {
  background: linear-gradient(135deg, var(--background-color) 0%, #2d3748 100%);
}

.dark-theme .glass-card,
.dark-theme .glass-effect {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.dark-theme .glass-header {
  background: rgba(31, 41, 55, 0.8);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.dark-theme .upload-area {
  border: 2px dashed var(--primary-color);
}

.dark-theme .upload-area:hover {
  background: rgba(99, 102, 241, 0.1);
}
.logo-link {
  text-decoration: none;
  color: inherit;
}
.dark-theme .modern-input,
.dark-theme .modern-select {
  background: rgba(31, 41, 55, 0.5);
  border: 1px solid var(--border-color);
  color: var(--text-color);
  width: 100%; /* Ensure it adapts to smaller screens */
  margin: 0 auto; /* Center the input field */
  box-sizing: border-box; /* Include padding and border in width */
}

.dark-theme .modern-input:focus,
.dark-theme .modern-select:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.3);
}

.dark-theme .link-container {
  background: rgba(255, 255, 255, 0.1);
  color: var(--accent-color);
}

.dark-theme .btn-secondary {
  background: rgba(31, 41, 55, 0.8);
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.dark-theme .btn-secondary:hover {
  background: rgba(99, 102, 241, 0.2);
}

.dark-theme .detail-item {
  color: var(--text-light);
}

.dark-theme footer {
  background: var(--footer-bg, #1f2937); /* Use variable or fallback */
  color: var(--footer-text, white);
  /* Padding is inherited from the main footer rule */
}

.dark-theme .footer-links a {
    color: #d1d5db; /* Ensure links are visible in dark mode */
}

.dark-theme .footer-links a:hover {
    color: white;
}

.dark-theme .footer-social a {
    background-color: #374151;
    color: white;
}

.dark-theme .footer-social a:hover {
    background-color: var(--primary-color);
}

.dark-theme .copyright {
    border-top: 1px solid #374151;
    color: #9ca3af;
}

/* CSS for the share link input */
.link-container {
    margin: 15px 0;
    position: relative;
    width: 100%;
}

.share-link-input {
    width: 100%;
    border-radius: 1px;
    border: 1px solid var(--border-color);
    background-color: var(--input-bg);
    color: var(--text-color);
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    outline: none;
    text-align: center;
}

.share-link-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.2);
}

.share-link-input:read-only {
    cursor: pointer;
    background-color: var(--card-bg);
}

/* Make sure the input looks good in dark mode */
[data-theme="dark"] .share-link-input {
    background-color: var(--card-bg);
    border-color: var(--border-color-dark);
}

[data-theme="dark"] .share-link-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(var(--primary-rgb), 0.3);
}

/* Fix alignment for the result section */
.result {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
  padding: 2rem;
}

.result .link-container {
  width: 100%;
  max-width: 500px;
  margin: 1rem auto;
}

.result .details-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.result .details-container .detail-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Fix alignment for the download activity section */
.downloads-container {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: var(--border-radius);
  background: var(--glass-bg);
  box-shadow: var(--glass-shadow);
}

.no-downloads-message {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-secondary);
  gap: 0.5rem;
}

.no-downloads-message i {
  font-size: 2rem;
  opacity: 0.7;
}

/* Fix alignment for the buttons */
.btn-primary,
.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  max-width: 300px;
  margin: 1rem auto;
}

/* Refined transfer workspace */
body {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(37, 99, 235, 0.08), transparent 42%),
    var(--background-color);
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
}

.page-container {
  min-height: 100vh;
}

.navbar {
  min-height: 72px;
  padding: 0.8rem max(5%, calc((100% - 1160px) / 2));
  border-bottom: 1px solid var(--border-color);
  background: color-mix(in srgb, var(--card-background) 94%, transparent);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
}

.logo {
  gap: 0.1rem;
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 1.15rem;
  letter-spacing: -0.04em;
}

.logo i {
  color: var(--primary-color);
}

.username {
  color: var(--text-color);
  font-size: 0.9rem;
}

.user-menu-btn {
  width: 38px;
  height: 38px;
  justify-content: center;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--card-background);
  color: var(--text-color);
}

.user-menu-btn i:first-child {
  font-size: 1.05rem;
}

.dropdown-content {
  top: calc(100% + 8px);
  border: 1px solid var(--border-color);
  border-radius: 11px;
  background: var(--card-background);
  box-shadow: var(--shadow-md);
}

.dropdown-content a:hover {
  background: var(--secondary-color);
}

.btn-login {
  padding: 0.6rem 1rem;
  border-radius: 9px;
  background: var(--primary-color);
  font-size: 0.9rem;
}

.container.glass-card {
  box-sizing: border-box;
  width: calc(100% - 2rem);
  max-width: 880px;
  margin: 3.25rem auto 4rem;
  padding: clamp(1.2rem, 4vw, 2.6rem);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: var(--card-background);
  box-shadow: var(--shadow-lg);
}

.app-title {
  margin-bottom: 0.4rem;
  color: var(--text-color);
  font-size: clamp(1.75rem, 4vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.055em;
  text-align: left;
}

.highlight {
  color: var(--primary-color);
}

.tagline {
  margin-bottom: 2rem;
  color: var(--text-light);
  font-size: 0.98rem;
  text-align: left;
}

.upload-area {
  margin-bottom: 1.7rem;
  padding: clamp(1.7rem, 5vw, 2.7rem);
  border: 1.5px dashed #a9bdd6;
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(37, 99, 235, 0.035), rgba(15, 159, 145, 0.025));
  cursor: pointer;
}

.upload-area:hover,
.upload-area.active {
  transform: translateY(-2px);
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.065);
}

.upload-icon-container {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  margin: 0 auto 1rem;
  border-radius: 18px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  font-size: 1.8rem;
}

.upload-icon-container .bounce {
  animation: none;
}

.upload-title {
  color: var(--text-color);
  font-size: 1.08rem;
  font-weight: 600;
}

.upload-subtitle {
  color: var(--text-light);
  font-size: 0.9rem;
}

.glass-effect {
  border: 1px solid var(--border-color);
  background: var(--card-background);
  box-shadow: var(--shadow-sm);
}

.file-info {
  gap: 1rem;
  border: 1px solid var(--border-color);
  background: var(--secondary-color);
}

.file-icon {
  display: grid;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  place-items: center;
  margin: 0;
  border-radius: 13px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  font-size: 1.25rem;
}

.file-details p {
  color: var(--text-light);
  font-size: 0.9rem;
  overflow-wrap: anywhere;
}

.file-details strong {
  color: var(--text-color);
}

.options-container {
  margin-bottom: 1.5rem;
}

.options-title {
  margin-bottom: 1rem;
  color: var(--text-color);
  font-size: 1.03rem;
  font-weight: 650;
}

.option-row {
  gap: 1rem;
  margin-bottom: 1rem;
}

.form-group.glass-effect {
  padding: 1.15rem;
  border-radius: 13px;
  background: var(--card-background);
  box-shadow: none;
}

.form-group label {
  margin-bottom: 0.55rem;
  color: var(--text-color);
  font-size: 0.88rem;
  font-weight: 600;
}

.option-icon {
  top: 1.2rem;
  right: 1.2rem;
  color: var(--primary-color);
  font-size: 0.95rem;
}

.modern-input,
.modern-select,
.share-link-input {
  min-height: 44px;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--border-color);
  border-radius: 9px;
  background: var(--background-color);
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 0.92rem;
  box-shadow: none;
}

.modern-input:focus,
.modern-select:focus,
.share-link-input:focus {
  border-color: var(--primary-color);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.input-suffix {
  flex: 0 0 auto;
  color: var(--text-light);
  font-size: 0.83rem;
}

.glass-button {
  min-height: 48px;
  border-radius: 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
}

#generateBtn.btn-primary {
  width: 100%;
  max-width: none;
  margin: 0;
  background: var(--primary-color);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.2);
}

#generateBtn.btn-primary:hover {
  transform: translateY(-1px);
  background: var(--primary-hover);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.26);
}

.result.glass-card {
  margin: 1.5rem 0 0;
  padding: 1.6rem;
  border: 1px solid rgba(5, 150, 105, 0.22);
  border-radius: 15px;
  background: rgba(5, 150, 105, 0.035);
  box-shadow: none;
}

.success-icon {
  margin-bottom: 0.2rem;
  color: var(--success-color);
}

.result h3 {
  color: var(--text-color);
}

.result > p {
  color: var(--text-light);
}

.result .link-container {
  max-width: none;
  margin: 0.5rem 0;
  padding: 0;
  border-radius: 9px;
  background: transparent;
}

.share-link-input {
  text-align: left;
  cursor: text;
}

.result .details-container {
  gap: 0.7rem;
  margin: 0.4rem 0;
}

.result .detail-item {
  padding: 0.45rem 0.7rem;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: var(--card-background);
  color: var(--text-light);
  font-size: 0.83rem;
}

.result .btn-secondary,
.download-actions .btn-primary,
#retryButton {
  width: auto;
  max-width: 100%;
  min-width: 155px;
  margin: 0.35rem auto 0;
}

.btn-secondary {
  border: 1px solid var(--border-color);
  background: var(--card-background);
  color: var(--text-color);
}

.btn-secondary:hover {
  border-color: var(--primary-color);
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary-color);
}

.section-header,
.downloads-container,
.file-download-container,
.transfer-error,
.download-complete-info {
  border: 1px solid var(--border-color);
  border-radius: 14px;
  background: var(--card-background);
  box-shadow: var(--shadow-sm);
}

.section-header {
  padding: 1.3rem;
}

.section-header h3,
.downloads-container h4,
.file-info-download h3 {
  color: var(--text-color);
}

.section-header .subtitle,
.download-meta,
.download-details,
.wait-time {
  color: var(--text-light);
}

.downloads-container {
  gap: 0.8rem;
}

.download-item {
  border-color: var(--border-color);
  border-radius: 10px;
  background: var(--background-color);
}

.download-item:hover {
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: var(--shadow-sm);
}

.download-title {
  color: var(--text-color);
}

.download-progress {
  background: var(--secondary-color);
}

.download-progress-bar,
.progress-bar-fill {
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.file-download-container {
  align-items: center;
}

footer {
  background: var(--footer-bg);
  color: var(--footer-text);
}

.download-status,
.download-status.completed {
  color: var(--success-color);
}

.completed,
.success-pulse {
  background: var(--success-color) !important;
}

.file-preview {
  border: 1px solid var(--border-color);
  border-radius: 13px;
  background: var(--background-color);
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: var(--secondary-color);
}

.progress-bar::before {
  background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
}

.progress-bar-fill {
  border-radius: 999px;
}

.progress-text {
  color: var(--text-light);
}

.transfer-error {
  color: var(--error-color);
}

.theme-toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1000;
}

.dark-theme body {
  background:
    radial-gradient(ellipse at 50% -20%, rgba(96, 165, 250, 0.09), transparent 42%),
    var(--background-color);
}

.dark-theme .upload-area {
  border-color: #435a78;
  background: linear-gradient(145deg, rgba(96, 165, 250, 0.07), rgba(45, 212, 191, 0.035));
}

.dark-theme .modern-input,
.dark-theme .modern-select,
.dark-theme .share-link-input {
  border-color: var(--border-color);
  background: #0b1626;
  color: var(--text-color);
}

.dark-theme .file-info {
  background: #17253a;
}

.dark-theme .result.glass-card {
  background: rgba(5, 150, 105, 0.08);
}

.dark-theme .result .detail-item,
.dark-theme .user-menu-btn,
.dark-theme .dropdown-content {
  background: var(--card-background);
}

.dark-theme .download-item {
  border-color: var(--border-color);
  background: #0d1828;
}

.dark-theme .file-preview,
.dark-theme .progress-bar {
  background: #0b1626;
}

@media (max-width: 768px) {
  .container.glass-card {
    width: calc(100% - 1.25rem);
    margin: 1.5rem auto 2.5rem;
    padding: 1.25rem;
    border-radius: 16px;
  }

  .option-row {
    flex-direction: column;
    gap: 0.75rem;
  }

  .file-download-container {
    padding: 1.2rem;
    gap: 1.2rem;
  }

  .file-preview {
    min-width: 0;
    min-height: 160px;
  }

  .theme-toggle {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 0.75rem 1rem;
  }

  .user-section {
    gap: 0.5rem;
  }

  .username {
    max-width: 110px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .details-container {
    align-items: stretch;
  }

  .result .detail-item {
    justify-content: center;
  }
}

/* Receiver download view */
.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.progress-percent {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--primary-color);
  font-variant-numeric: tabular-nums;
}

#downloadView .progress-bar {
  height: 14px;
}

.download-ps {
  margin-top: 1.5rem;
  padding: 0.85rem 1rem;
  border-left: 3px solid var(--primary-color);
  border-radius: 6px;
  background: rgba(99, 102, 241, 0.08);
  font-size: 0.85rem;
  line-height: 1.5;
  opacity: 0.9;
}

#downloadActions {
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
}

.download-fallback-text {
  font-size: 0.9rem;
  opacity: 0.85;
}

.save-target-prompt {
  margin-top: 1rem;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}