:root {
  --primary-color: #4f46e5;
  --primary-gradient-start: #3b82f6;
  --primary-gradient-end: #4f46e5;
  --white: #ffffff;
  --black: #000000;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --red-100: #fee2e2;
  --red-500: #ef4444;
  --green-100: #dcfce7;
  --green-500: #22c55e;
  --border-radius: 0.5rem;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
    0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
    0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1),
    0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --dark-bg: #2f2f2f;
  --dark-text: #fff;
  --dark-card-bg: #444;
  --dark-card-text: #fff;
  --dark-input-bg: #555;
  --dark-input-text: #fff;
  --dark-input-border: #666;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif;
  line-height: 1.5;
  background-color: var(--gray-50);
  color: var(--gray-800);
  position: relative;
  height: 100vh;
  margin: 0;
  padding: 0;
}

.dark-mode {
  background-color: var(--dark-bg);
  color: var(--dark-text);
}

.darkbtn:hover {
  background-color: rgba(0, 0, 0, 0.1);
  transform: scale(1.1);
}
.dark-mode .hero-description {
  color: var(--dark-text);
}

.dark-mode .card {
  background-color: var(--dark-card-bg);
  color: var(--dark-card-text);

  .form-group label {
    color: #7589cc;
  }
}

.dark-mode .features {
  background-color: #2f2f2f;

  .feature-card {
    border: 2px solid var(--primary-gradient-start);
    box-shadow: var(--shadow);
    p {
      color: #7589cc;
    }
  }
}
.dark-mode .url-input {
  background-color: var(--dark-input-bg);
  color: var(--dark-input-text);
  border-color: var(--dark-input-border);
}

.dark-mode .result-content {
  background-color: var(--dark-input-bg);
}

.dark-mode .feature-card {
  background-color: var(--dark-card-bg);
  color: var(--dark-card-text);
}

.dark-mode .section-title {
  color: #9ca3af;
}

.darkbtn {
  position: fixed;
  right: 0px;
  background-color: #7589cc;
  border: none;
  margin-right: 2vh;
  padding: 10px;
  cursor: pointer;
  width: 40px;
  height: 40px; 
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
  box-shadow: var(--shadow);
  background-color: transparent;
  transition: 0.3s ease, transform 0.3s ease;
}

.dark-mode .themeToggle {
  background-color: var(--dark-input-bg);
  color: var(--dark-text);
}

.themeToggle:hover {
  background-color: var(--gray-100);
}

.dark-mode .themeToggle:hover {
  background-color: var(--gray-600);
}

.hidden {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

.gradient-text {
  background-image: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.app {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
}

.background-decorations {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: -1;
  pointer-events: none;
}

.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.1;
  animation: float 6s ease-in-out infinite;
}

.bg-blob-1 {
  top: 5rem;
  left: 25%;
  width: 16rem;
  height: 16rem;
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
}

.bg-blob-2 {
  bottom: 5rem;
  right: 25%;
  width: 18rem;
  height: 18rem;
  background: linear-gradient(to right, #f59e0b, var(--primary-gradient-end));
  animation-delay: 2s;
}

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

.header {
  width: 100%;
  display: flex;
  justify-content: center;
  opacity: 0;
  transform: translateY(-20px);
  animation: fadeInDown 0.5s forwards 0.2s;
}

@media (max-width: 486px) {
  .header {
    padding: 1rem;
    flex-direction: column;
  }
  .logo-container {
    margin-bottom: 10px;
  }
  .darkbtn {
    margin-left: 0;
  }
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-grow: 1;
}

.logo-icon {
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  border-radius: 0.5rem;
  padding: 0.5rem;
  margin-right: 0.75rem;
  box-shadow: var(--shadow-lg);
  color: white;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  -webkit-background-clip: text;
  color: transparent;
}

.main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  position: relative;
}

.hero {
  text-align: center;
  max-width: 28rem;
  margin: 0 auto 2rem;
  opacity: 0;
  transform: scale(0.95);
  animation: fadeInScale 0.5s forwards 0.4s;
}

.hero-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--gray-900);
}

.hero-description {
  color: var(--gray-600);
  margin-bottom: 1.5rem;
}

.hero-icon {
  width: 8rem;
  height: 8rem;
  margin-bottom: 2rem;
  display: none;
  color: var(--primary-color);
  animation: float 6s ease-in-out infinite;
}

.card {
  width: 100%;
  max-width: 32rem;
  background-color: var(--white);
  border-radius: 0.75rem;
  box-shadow: var(--shadow-xl);
  padding: 1.5rem;
  margin-bottom: 2rem;
  transition: all 0.5s;
}

@media (min-width: 768px) {
  .card {
    padding: 2rem;
  }
  .hero-icon {
    display: block;
  }
  .hero-title {
    font-size: 2.25rem;
  }
}

.url-form {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.5s forwards 0.6s;
  transition: all 0.3s;
}

.url-form:hover {
  box-shadow: var(--shadow-2xl);
}

.form-group {
  margin-bottom: 1rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--gray-700);
}

.input-container {
  position: relative;
  border-radius: 0.5rem;
}

.input-icon {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  padding-left: 0.75rem;
  pointer-events: none;
  color: var(--gray-400);
}

.url-input {
  width: 100%;
  padding: 0.75rem 0.75rem 0.75rem 2.5rem;
  border: 1px solid var(--gray-300);
  border-radius: 0.5rem;
  font-size: 1rem;
  color: var(--gray-900);
  transition: all 0.2s;
}

.url-input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.1);
}

.clear-button {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: none;
  align-items: center;
  padding-right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
}

.clear-button:hover {
  color: var(--gray-600);
}

.error-message {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  color: var(--red-500);
}

.submit-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.submit-button:hover {
  box-shadow: var(--shadow-lg);
}

.submit-button:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.loading-spinner {
  display: inline-block;
  margin-right: 0.5rem;
}


.result-card {
  opacity: 0;
  transform: scale(0.95);
  animation: fadeInScale 0.5s forwards;
}

.result-header,
.error-header {
  text-align: center;
  margin-bottom: 1rem;
}

.success-icon,
.error-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  margin-bottom: 1rem;
}

.success-icon {
  background-color: var(--green-100);
  color: var(--green-500);
}

.error-icon {
  background-color: var(--red-100);
  color: var(--red-500);
}

.result-header h3,
.error-header h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--gray-800);
  margin-bottom: 0.25rem;
}

.result-header p,
.error-header p {
  font-size: 0.875rem;
  color: var(--gray-500);
}

.result-content {
  background-color: var(--gray-50);
  border-radius: 0.5rem;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .result-content {
    flex-direction: row;
    flex-wrap: nowrap;
  }

  .short-url-info {
    border-top: none;
    border-left: 1px solid var(--gray-200);
    padding-top: 0;
    padding-left: 0.75rem;
  }
}

.url-info {
  flex-grow: 1;
  min-width: 0;
}

.short-url-info {
  flex-grow: 1;
  min-width: 50%;
}

.url-label {
  font-size: 0.875rem;
  color: var(--gray-500);
  margin-bottom: 0.25rem;
}

.dark-mode .url-display{
  color: whitesmoke;
}
.url-display {
  font-size: 0.875rem;
  color: #4f46e5;;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: block;
}

.short-url {
  font-weight: 500;
  text-decoration: none;
}

.short-url:hover {
  text-decoration: underline;
}

.short-url-container {
  display: flex;
}

.action-button {
  background-color: var(--primary-color);
  color: white;
  border: none;
  border-radius: 0.25rem;
  padding: 0.5rem;
  margin-left: 0.5rem;
  cursor: pointer;
  transition: background-color 0.3s;
}

.action-button:hover {
  background-color: #4338ca;
}

.result-actions,
.error-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.reset-button,
.try-again-button {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--primary-color);
  background-color: var(--white);
  color: var(--primary-color);
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.reset-button:hover {
  background-color: rgba(79, 70, 229, 0.05);
}

.share-button {
  flex: 1;
  padding: 0.75rem 1rem;
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.share-button:hover {
  box-shadow: var(--shadow-lg);
}

.try-again-button {
  width: 100%;
  padding: 0.75rem 1rem;
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  color: white;
  border: none;
}

.error-card {
  opacity: 0;
  transform: scale(0.95);
  animation: fadeInScale 0.5s forwards;
}

.features {
  padding: 3rem 1rem;
  background-color: var(--white);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 3rem;
  color: var(--gray-900);
}

.features-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .features-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .section-title {
    font-size: 1.875rem;
  }
}

.feature-card {
  padding: 1.5rem;
  border-radius: 0.5rem;
  background-color: var(--gray-50);
  transition: all 0.3s;
  opacity: 0;
  transform: translateY(20px);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
}

.feature-card:nth-child(1) {
  animation: fadeInUp 0.5s forwards 0.2s;
}

.feature-card:nth-child(2) {
  animation: fadeInUp 0.5s forwards 0.3s;
}

.feature-card:nth-child(3) {
  animation: fadeInUp 0.5s forwards 0.4s;
}

.feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 0.5rem;
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  color: white;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--black);
}

.feature-card p {
  color: var(--gray-600);
}
.logoimg img {
  max-width: 100%;
  max-height: 50px;
  height: auto;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: transparent;
  filter: drop-shadow(0 0 0.5rem rgb(249,249,249));
  mix-blend-mode: hard-light;
  animation: pulse 1.5s infinite;
}
@keyframes pulse {
  0% {
    transform: scale(1); 
  }
  50% {
    transform: scale(1.1); 
  }
  100% {
    transform: scale(1);
  }
}

.footer {
  width: 100%;
  padding: 1.5rem 1rem;
  background: linear-gradient(
    to right,
    var(--primary-gradient-start),
    var(--primary-gradient-end)
  );
  color: white;
  opacity: 0;
  animation: fadeIn 0.5s forwards 0.8s;
  position: relative;
}

.footer-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.footer-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 1rem;
}

.footer-logo i {
  margin-right: 0.5rem;
}

.footer-logo span {
  font-weight: 700;
  font-size: 1.25rem;
}

.footer-logo p {
  font-size: 0.875rem;
  opacity: 0.8;
  margin-top: 0.25rem;
  text-align: center;
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: white;
  text-decoration: none;
  transition: opacity 0.3s;
}

.footer-links a:hover {
  opacity: 0.8;
}

@media (min-width: 768px) {
  .footer-logo {
    flex-direction: row;
    margin-bottom: 0;
  }
  .footer-logo p {
    margin-top: 0;
    margin-left: 0.5rem;
    text-align: left;
  }
  .footer-container {
    flex-direction: row;
  }
}

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

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

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

.icon-mr {
  margin-right: 0.5rem;
}

.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 12px 16px;
  border-radius: 6px;
  background-color: white;
  color: #333;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  max-width: 300px;
  z-index: 1000;
  transform: translateY(30px);
  opacity: 0;
  transition: transform 0.3s, opacity 0.3s;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast i {
  margin-right: 8px;
}

.toast-success i {
  color: var(--green-500);
}

.toast-error i {
  color: var(--red-500);
}

.user-box {
  display: flex;
  flex-direction: row;
  position: absolute;
  padding: 10px;
  border: 1px solid blanchedalmond;
  border-radius: 8px;
  background: linear-gradient(to right, #0463ff, #343438);
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
  color: white;
  display: none;
  max-width: 90vw;
  min-width: 300px;
  right: 0;
  bottom: 0;
}
.user-info {
  margin: 0px 2px;
  width: 150px;
  height: 150px;
  background-image: url("/static/images/ujjwal_img.jpg");
  background-size: cover;
  background-position: center;
  border-radius: 20px;
  animation: fadeInScale 2s forwards;
}

.show-box {
  display: flex;
}
.user-details pre {
  color: #f0f0f0;
  margin: 0;
  font-family: "Courier New", monospace;
  text-align: left; 
}
#str {
  margin-left: 40px;
}

.user-details {
  p {
    color: #f0f0f0;
  }
  .var-highlight {
    color: #569cd6;
  }
  .var {
    color: #8cc4e3;
  }
  .data {
    color: burlywood;
  }
  .string-highlight {
    color: burlywood;
  }
}

.user-details pre {
  margin: 0;
  font-size: 0.9rem;
  font-family: "Courier New", Courier, monospace;
}

#typewriter {
  font-size: 1em;
  margin: 0;
  font-family: "Courier New", monospace;
  white-space: pre-wrap;
  position: relative;

  &:after {
    content: "|";
    position: absolute;
    animation: blink 500ms linear infinite alternate;
  }
}

@-webkit-keyframes blink {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@-moz-keyframes blink {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@keyframes blink {
  0% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

@media (max-width: 768px) {
  .user-box {
    flex-direction: row;
    align-items: center;
    text-align: center;
    left: 50%;
    transform: translate(-50%);
    width: 350px;
    min-height: 17vh;
  }
  .user-info {
    margin: 0 auto;
    width: 100px;
    height: 100px;
  }
  #typewriter {
    font-size: 0.5em;
  }
}
.server-status {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.server-down {
    background-color: #ff6b6b;
    color: white;
}

.server-up {
    background-color: #51cf66;
    color: white;
    display: none; /* Hide when server is up */
}
