/* screen.css */

/* 1. Use a more-intuitive box-sizing model */
*, *::before, *::after {
  box-sizing: border-box;
}

/* 2. Remove default margin */
* {
  margin: 0;
}

/* 3. Enable keyword animations */
@media (prefers-reduced-motion: no-preference) {
  html {
    interpolate-size: allow-keywords;
  }
}

/* CSS Custom Properties */
:root {
  /* Modern Color Palette */
  --primary-color: #6366f1;
  --primary-hover: #4f46e5;
  --primary-light: #a5b4fc;
  --secondary-color: #64748b;
  --success-color: #10b981;
  --error-color: #ef4444;
  --warning-color: #f59e0b;
  
  /* Gradient Colors */
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --gradient-bg: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* Surface Colors */
  --background: #f8fafc;
  --surface: #ffffff;
  --surface-elevated: #ffffff;
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.2);
  
  /* Text Colors */
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: #94a3b8;
  --text-white: #ffffff;
  
  /* Border & Shadow */
  --border: #e2e8f0;
  --border-hover: #cbd5e1;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-xl: 0 25px 50px -12px rgb(0 0 0 / 0.25);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.3);
  
  /* Border Radius */
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  
  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;
  
  /* Transitions */
  --transition-fast: 0.15s ease-in-out;
  --transition-normal: 0.3s ease-in-out;
  --transition-slow: 0.5s ease-in-out;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --background: #0f172a;
    --surface: #1e293b;
    --surface-elevated: #334155;
    --glass-bg: rgba(30, 41, 59, 0.2);
    --glass-border: rgba(255, 255, 255, 0.15);
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: #334155;
    --border-hover: #475569;
  }
}

/* Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

body {
  /* 4. Add accessible line-height */
  line-height: 1.6;
  /* 5. Improve text rendering */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-family: var(--font-family);
  background: var(--gradient-bg);
  background-attachment: fixed;
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

/* Animated background elements */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: 
    radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
    radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.2) 0%, transparent 50%);
  animation: backgroundFloat 20s ease-in-out infinite;
  z-index: -1;
}

@keyframes backgroundFloat {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33% { transform: translateY(-20px) rotate(1deg); }
  66% { transform: translateY(10px) rotate(-1deg); }
}

/* 6. Improve media defaults */
img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
}

/* Layout */
header {
  background-color: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand h1 {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-white);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nav-links {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav-links a {
  color: var(--text-white);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: var(--radius);
  transition: var(--transition-fast);
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
}


@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

main {
  flex: 1;
  padding: 2rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  z-index: 1;
}

.container {
  max-width: 700px;
  margin: 0 auto;
  position: relative;
}

/* Hero Section */
.hero {
  text-align: center;
  margin-bottom: 2rem;
  padding: 2rem 1.5rem;
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
}

.hero h2 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-white);
  margin-bottom: 0.75rem;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero p {
  font-size: 1rem;
  color: var(--text-white);
  margin: 0;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

/* URL Shortener */
.url-shortener {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-xl);
  margin-bottom: 4rem;
  border: 1px solid var(--glass-border);
  position: relative;
  overflow: hidden;
}

.url-shortener::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-secondary);
}

.url-form {
  margin-bottom: 2rem;
}

.input-group {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.input-group input {
  flex: 1;
  min-width: 300px;
}

/* Form Elements */
input[type="url"],
input[type="text"] {
  padding: 1rem 1.25rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-family: inherit;
  background: var(--surface);
  color: var(--text-primary);
  transition: all var(--transition-normal);
  box-shadow: var(--shadow);
}

input[type="url"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: var(--shadow-glow), var(--shadow-lg);
  transform: translateY(-2px);
}

input[type="url"]::placeholder {
  color: var(--text-secondary);
  font-weight: 400;
}

/* Buttons */
.btn {
  padding: 1rem 2rem;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all var(--transition-normal);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  min-width: 120px;
  position: relative;
  overflow: hidden;
}

.btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left var(--transition-slow);
}

.btn:hover::before {
  left: 100%;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

.btn-primary {
  background: var(--gradient-primary);
  color: var(--text-white);
  box-shadow: var(--shadow-lg);
  border: 2px solid transparent;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl), var(--shadow-glow);
}

.btn-secondary {
  background: var(--surface);
  color: var(--text-primary);
  border: 2px solid var(--border);
  box-shadow: var(--shadow);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-elevated);
  border-color: var(--primary-color);
  transform: translateY(-3px);
  box-shadow: var(--shadow-xl);
}


.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Loading Spinner */
.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Result Section */
.result {
  background: var(--gradient-success);
  border: 2px solid var(--success-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
}

.result::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-success);
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.result-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.result-content h3 {
  color: var(--text-white);
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.close-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: 0.2s;
}

.close-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.short-url-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.short-url-input {
  flex: 1;
  min-width: 200px;
  background: var(--surface);
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-primary);
  border: 2px solid rgba(255, 255, 255, 0.3);
  box-shadow: var(--shadow);
}

.copy-btn {
  min-width: 100px;
  background: var(--gradient-secondary);
  color: var(--text-white);
  border: none;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-lg);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all var(--transition-normal);
  box-shadow: var(--shadow);
}

.copy-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.original-url {
  font-size: 0.875rem;
  color: var(--text-secondary);
  word-break: break-all;
}

/* Error Section */
.error {
  background: var(--gradient-secondary);
  border: 2px solid var(--error-color);
  border-radius: var(--radius-xl);
  padding: 2rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow-xl);
  position: relative;
  overflow: hidden;
  animation: slideIn 0.5s ease-out;
}

.error::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--gradient-secondary);
}

.error-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 1.5rem;
}

.error-content h3 {
  color: var(--text-white);
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.error-content p {
  color: var(--text-white);
  margin-bottom: 1.5rem;
  font-weight: 500;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* Footer */
footer {
  background: var(--glass-bg);
  backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  padding: 2rem;
  text-align: center;
  color: var(--text-white);
  font-size: 0.875rem;
  margin-top: 4rem;
  position: relative;
  z-index: 1;
}

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--gradient-primary);
}

/* Accessibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive Design */
@media (max-width: 768px) {
  main {
    padding: 1rem;
  }
  
  .nav {
    padding: 1rem;
  }
  
  .hero h2 {
    font-size: 2rem;
  }
  
  .hero p {
    font-size: 1rem;
  }
  
  .url-shortener {
    padding: 1.5rem;
  }
  
  .input-group {
    flex-direction: column;
  }
  
  .input-group input {
    min-width: auto;
  }
  
  .short-url-container {
    flex-direction: column;
  }
  
  .short-url-input {
    min-width: auto;
  }
  
  .features {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .feature {
    padding: 1.5rem 1rem;
  }
}

@media (max-width: 480px) {
  .hero h2 {
    font-size: 1.75rem;
  }
  
  .url-shortener {
    padding: 1rem;
  }
  
  .btn {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
  }
}

/* Admin Panel Styles */
.admin-panel {
  display: flex;
}

.admin-nav {
  position: fixed;
  left: 0;
  top: 0;
  height: 100vh;
  width: 250px;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 1000;
  transition: transform 0.3s ease-in-out;
}

.admin-nav h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.admin-nav ul {
  list-style: none;
  padding: 0;
}

.admin-nav li {
  margin-bottom: 0.5rem;
}

.admin-nav a {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius);
  transition: var(--transition-fast);
}

.admin-nav a:hover {
  background: var(--primary-light);
  color: var(--primary-color);
}

.admin-content {
  margin-left: 250px;
  flex: 1;
  padding: 2rem;
}
.hamburger {
  display: none;
  position: fixed;
  top: 1rem;
  left: 1rem;
  background: #1e293b;
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 999;
  transition: background 0.3s ease;
}

.hamburger:hover {
  background: #334155; /* lighter navy */
}

/* Mobile view */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .admin-nav {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
  }

  .admin-nav.open {
    transform: translateX(0);
  }

  .admin-content {
    padding-top: 4rem;
  }
}

/* Sidebar transition for smoother open/close */
.admin-sidebar {
  transition: transform 0.3s ease-in-out, box-shadow 0.3s ease-in-out;
}

.admin-sidebar.open {
  transform: translateX(0);
  box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}




.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.stat-card {
  background: var(--gradient-primary);
  color: var(--text-white);
  padding: 1.5rem;
  border-radius: var(--radius);
  text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  transition: transform 0.2s;
}

.stat-card:hover {
  transform: translateY(-5px);
}

.stat-card h4 {
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}

.stat-number {
  font-size: 2rem;
  font-weight: 700;
  margin: 0;
}

.recent-activity h3 {
  color: var(--text-primary);
  margin-bottom: 1rem;
  font-size: 1.125rem;
  font-weight: 600;
}

.activity-list {
  color: var(--text-secondary);
}

.admin-actions {
    position: fixed;
  bottom: 0;
  left: 57%;
  transform: translateX(-50%);
  display: flex;
  gap: 1rem;
  justify-content: center;
  padding: 1rem;
  z-index: 1000;
}

/* Profile Styles */
.profile-section {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
  margin: 2rem 0;
}

.profile-info,
.urls-section {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.profile-info h3,
.urls-section h3 {
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  font-size: 1.25rem;
  font-weight: 600;
}

.profile-form .form-group {
  margin-bottom: 1rem;
}

.profile-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.profile-form input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.profile-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.profile-form input[readonly] {
  background: var(--background);
  color: var(--text-muted);
}

.urls-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.url-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 0.5rem;
}

.url-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.short-url {
  font-weight: 600;
  color: var(--primary-color);
  font-family: var(--font-mono);
}

.original-url {
  color: var(--text-secondary);
  font-size: 0.875rem;
  word-break: break-all;
}

.clicks {
  color: var(--text-muted);
  font-size: 0.75rem;
}

.url-actions {
  display: flex;
  gap: 0.5rem;
}

.profile-actions {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
  justify-content: center;
}

/* Auth Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
  margin: 2rem 0;
}

.auth-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 400px;
}

.auth-card h2 {
  color: var(--text-primary);
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.5rem;
  font-weight: 600;
}

.auth-card p {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.auth-form .form-group {
  margin-bottom: 1rem;
}

.auth-form label {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  font-weight: 500;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-primary);
  transition: var(--transition-fast);
}

.auth-form input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.auth-form small {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-top: 0.25rem;
  display: block;
}

.checkbox-label {
  display: flex !important;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: auto !important;
  margin: 0;
}

.full-width {
  width: 100%;
}

.auth-links {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.auth-links p {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.auth-links a {
  color: var(--primary-color);
  text-decoration: none;
  font-weight: 500;
}

.auth-links a:hover {
  text-decoration: underline;
}

.auth-actions {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
}

/* Button Variants */
.btn.small {
  padding: 0.5rem 0.75rem;
  font-size: 0.75rem;
}

.btn.danger {
  background: var(--error-color);
  color: var(--text-white);
}

.btn.danger:hover {
  background: #dc2626;
}

.btn.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
}

.btn.btn-outline:hover {
  background: var(--primary-color);
  color: var(--text-white);
}

/* Admin Section on Homepage */
.admin-section {
  margin-top: 4rem;
  padding: 2rem 0;
  border-top: 1px solid var(--glass-border);
}

.admin-info {
  text-align: center;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  color: var(--text-white);
}

.admin-info h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.admin-info p {
  margin-bottom: 1.5rem;
  opacity: 0.9;
}

.admin-links {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

/* Responsive Design for Admin */
@media (max-width: 768px) {
  .admin-nav {
    transform: translateX(-100%);
  }
  .admin-nav.open {
    transform: translateX(0);
  }

  .admin-content {
    margin-left: 0;
    padding-top: 4rem;
  }
}
 

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
  
  .admin-actions,
  .profile-actions,
  .auth-actions {
    flex-direction: column;
    align-items: center;
  }
}
