/* ===== MODERN RESET & VARIABLES ===== */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
  --bg-dark: #020617;
  --card-bg: rgba(15, 23, 42, 0.6);
  --sidebar-bg: rgba(2, 6, 23, 0.95);
  --border-color: rgba(255, 255, 255, 0.08);
  --primary-accent: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.4);
  --danger: #ef4444;
  --success: #22c55e;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --glass-blur: 20px;
  --transition-speed: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --sidebar-width: 320px;
}

* { box-sizing: border-box; outline: none; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0; padding: 0;
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(at 0% 0%, hsla(253,16%,7%,1) 0, transparent 50%), 
    radial-gradient(at 50% 0%, hsla(225,39%,30%,1) 0, transparent 50%), 
    radial-gradient(at 100% 0%, hsla(339,49%,30%,1) 0, transparent 50%);
  background-attachment: fixed; background-size: cover;
  color: var(--text-main);
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  overflow-x: hidden;
}

/* ===== MAIN CONTAINER ===== */
.main-container {
  width: 100%; max-width: 520px; padding: 20px;
  position: relative; z-index: 10; margin-top: 60px;
}

.title {
  font-size: 2.5rem; font-weight: 700; text-align: center; margin-bottom: 2rem;
  background: linear-gradient(to right, #fff, #94a3b8);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* ===== GLASS CARD ===== */
.shortener-box {
  background: var(--card-bg);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--border-color); border-radius: 24px; padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  transition: transform var(--transition-speed);
}

/* ===== INPUTS ===== */
.input-group { margin-bottom: 1.25rem; position: relative; }
.input {
  width: 100%; background: rgba(30, 41, 59, 0.4);
  border: 1px solid var(--border-color); color: var(--text-main);
  padding: 16px 20px; border-radius: 12px; font-size: 1rem;
  font-family: inherit; margin-bottom: 15px;
}
.input:focus {
  background: rgba(30, 41, 59, 0.8); border-color: var(--primary-accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}
select.input { cursor: pointer; }

/* ===== BUTTONS ===== */
.button {
  width: 100%; padding: 16px; background: var(--primary-accent);
  color: white; border: none; border-radius: 12px;
  font-size: 1rem; font-weight: 600; cursor: pointer;
  transition: all var(--transition-speed);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.button:hover { background: #4f46e5; transform: translateY(-2px); }

/* ===== TOAST NOTIFICATIONS (NEW) ===== */
.toast-container {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
  z-index: 10000; display: flex; flex-direction: column; gap: 10px;
  width: 90%; max-width: 400px; pointer-events: none;
}
.toast {
  background: rgba(15, 23, 42, 0.95); backdrop-filter: blur(10px);
  color: white; padding: 16px; border-radius: 12px;
  box-shadow: 0 10px 30px -5px rgba(0,0,0,0.5);
  border: 1px solid var(--border-color);
  display: flex; align-items: center; gap: 12px;
  opacity: 0; transform: translateY(20px);
  transition: all 0.4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
}
.toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
.toast.success { border-left: 4px solid var(--success); }
.toast.error { border-left: 4px solid var(--danger); }
.toast-icon { font-size: 1.2rem; }
.toast-msg { font-size: 0.95rem; line-height: 1.4; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 0; left: 0; height: 100vh; width: var(--sidebar-width);
  background: var(--sidebar-bg); backdrop-filter: blur(15px);
  border-right: 1px solid var(--border-color);
  box-shadow: 10px 0 30px rgba(0,0,0,0.5); z-index: 2000;
  transform: translateX(-100%); transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  visibility: hidden; display: flex; flex-direction: column;
}
.sidebar.open { transform: translateX(0); visibility: visible; }
.sidebar-header { padding: 25px; border-bottom: 1px solid var(--border-color); display: flex; justify-content: space-between; }
.sidebar-content { flex: 1; overflow-y: auto; padding: 20px; }
.sidebar-footer { padding: 20px; border-top: 1px solid var(--border-color); }

/* Sidebar Links */
.link-item { background: rgba(255, 255, 255, 0.03); border-radius: 12px; padding: 15px; margin-bottom: 12px; }
.link-alias { display: block; font-weight: 600; color: var(--primary-accent); text-decoration: none; word-break: break-all; }
.link-meta { display: flex; justify-content: space-between; margin-top: 10px; font-size: 0.85rem; color: var(--text-muted); }
.action-btn { background: rgba(255,255,255,0.1); color: #fff; border:none; padding:6px 10px; border-radius:6px; margin-left:5px; cursor: pointer; }

/* ===== RESULT AREA ===== */
.result-box { margin-top: 30px; }
.og-card { background: var(--card-bg); border: 1px solid var(--border-color); border-radius: 16px; overflow: hidden; margin-bottom: 20px; }
.og-card img.preview-img { width: 100%; height: 160px; object-fit: cover; }
.og-info { padding: 20px; }
.link-display { display: flex; gap: 10px; margin-bottom: 15px; }
.link-display input { flex: 1; background: rgba(0,0,0,0.3); color: var(--primary-accent); border: 1px solid var(--border-color); padding: 10px; border-radius: 8px; }
.copy-btn { background: var(--primary-accent); color: white; border: none; padding: 0 15px; border-radius: 8px; cursor: pointer; }

/* Share Buttons */
.share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn { flex: 1; padding: 10px; text-align: center; background: rgba(255,255,255,0.05); border-radius: 8px; color: var(--text-muted); text-decoration: none; }
.qr-container { text-align: center; padding: 15px; background: white; border-radius: 12px; margin: 0 auto; width: fit-content; }

/* ===== NAV & MOBILE ===== */
.hamburger-menu {
  position: fixed; top: 15px; left: 15px; width: 44px; height: 44px;
  background: rgba(30, 41, 59, 0.8); backdrop-filter: blur(10px);
  border: 1px solid var(--border-color); border-radius: 12px;
  display: flex; justify-content: center; align-items: center;
  cursor: pointer; z-index: 1000; color: white;
}
#authButtons { position: fixed; top: 15px; right: 15px; z-index: 1000; display: flex; gap: 10px; }
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); z-index: 1900; opacity: 0; visibility: hidden; transition: 0.3s; }
#overlay.active { opacity: 1; visibility: visible; }

/* Mobile Optimizations */
@media (max-width: 600px) {
  .title { font-size: 1.8rem; margin-top: 10px; }
  .shortener-box { padding: 25px 20px; }
  #authButtons { display: none; }
  :root { --sidebar-width: 85%; }
  
  /* Fix Modal Sizing on Mobile */
  #authModal > div { width: 90% !important; padding: 25px !important; }
  
  .link-display { flex-direction: column; }
  .copy-btn { width: 100%; padding: 12px; }
}

/* ... keep all your existing CSS above ... */

/* ===== 🌀 GRAPHICAL LOADER ANIMATION ===== */
.loader-overlay {
  position: fixed; top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(2, 6, 23, 0.85); /* Dark background */
  backdrop-filter: blur(15px); /* Strong blur effect */
  z-index: 99999;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  transition: opacity 0.3s ease;
}

/* The Container for the graphic */
.loader-graphic {
  position: relative;
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.1) 0%, transparent 70%);
  box-shadow: 0 0 60px -10px var(--primary-accent); /* Glowing aura */
  display: flex; align-items: center; justify-content: center;
}

/* Outer Spinning Ring */
.loader-graphic::before {
  content: ''; position: absolute; inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--primary-accent);
  border-right-color: #a855f7; /* Purple accent */
  animation: spinLoader 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
}

/* Inner Pulsing Core */
.loader-graphic::after {
  content: ''; position: absolute;
  width: 25%; height: 25%;
  background: white;
  border-radius: 50%;
  box-shadow: 0 0 20px 5px var(--primary-accent);
  animation: pulseCore 1.5s ease-in-out infinite;
}

/* Text Below */
.loader-text {
  margin-top: 30px;
  font-family: 'Inter', sans-serif;
  font-size: 0.9rem;
  letter-spacing: 3px;
  font-weight: 700;
  text-transform: uppercase;
  background: linear-gradient(90deg, #94a3b8, #ffffff, #94a3b8);
  background-size: 200% auto;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientText 3s linear infinite;
}

/* Animations */
@keyframes spinLoader { 100% { transform: rotate(360deg); } }
@keyframes pulseCore { 
  0%, 100% { transform: scale(0.8); opacity: 0.7; } 
  50% { transform: scale(1.2); opacity: 1; } 
}
@keyframes gradientText { to { background-position: 200% center; } }


/* ... Keep existing CSS ... */

/* Sidebar Navigation Styles */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.nav-item {
    padding: 15px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 500;
    transition: 0.2s;
    border: 1px solid transparent;
}
.nav-item:hover {
    background: rgba(99, 102, 241, 0.1);
    border-color: var(--primary-accent);
    color: white;
    transform: translateX(5px);
}

/* Close Button on Modal */
.close-modal {
    position: absolute; top: 15px; right: 15px;
    font-size: 24px; color: #aaa; background: none; border: none; cursor: pointer;
}
.close-modal:hover { color: white; }

/* Date Input Fix for Dark Mode */
input[type="datetime-local"] {
    color-scheme: dark;
}
