/* Global Styles */
:root {
  --blue: #2563EB;
  --light-blue: #3B82F6;
  --dark-blue: #1D4ED8;
  --gray: #F3F4F6;
  --dark-gray: #6B7280;
  --white: #FFFFFF;
  --black: #000000;
  --red: #EF4444;
  --red-light: #FEE2E2;
  --transition: all 0.3s ease;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --radius: 0.5rem;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
}

body {
  line-height: 1.6;
  color: #333;
  background-color: var(--white);
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none !important;
}

.animate-fadeIn {
  animation: fadeIn 0.5s ease-out forwards;
}

/* Header Styles */
.header {
  width: 100%;
  padding: 1.5rem 0;
  background-color: var(--white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.logo-icon {
  height: 2rem;
  width: 2rem;
  border-radius: 9999px;
  background: linear-gradient(to right, var(--blue), var(--light-blue));
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-icon span {
  color: var(--white);
  font-weight: bold;
  font-size: 0.875rem;
}

.logo h1 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1F2937;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 1.5rem;
}

.nav-link {
  color: #6B7280;
  text-decoration: none;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--blue);
}

/* Hero Styles */
.hero {
  padding: 4rem 0;
  background: linear-gradient(to bottom right, var(--blue), var(--dark-blue));
  color: var(--white);
}

.hero-content {
  max-width: 48rem;
  margin: 0 auto;
  text-align: center;
}

.hero-content h1 {
  font-size: 2.25rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
}

.hero-content p {
  font-size: 1.125rem;
  opacity: 0.9;
}

@media (min-width: 768px) {
  .hero-content h1 {
    font-size: 3rem;
  }
  
  .hero-content p {
    font-size: 1.25rem;
  }
}

/* Form Styles */
.url-form-section {
  padding: 3rem 0;
  background-color: var(--gray);
}

.form-container {
  max-width: 48rem;
  margin: 0 auto;
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

.form-container h2 {
  font-size: 1.5rem;
  font-weight: bold;
  margin-bottom: 1.5rem;
  text-align: center;
  color: #1F2937;
}

.url-form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: #4B5563;
}

.input {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid #D1D5DB;
  border-radius: var(--radius);
  outline: none;
  transition: var(--transition);
}

.input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.input.error {
  border-color: var(--red);
}

.error-message {
  color: var(--red);
  font-size: 0.875rem;
  margin-top: 0.25rem;
  display: none;
}

.error-message.visible {
  display: block;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 2.5rem;
  padding: 0 1rem;
  font-weight: 500;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.875rem;
  gap: 0.25rem;
}

.primary-button {
  background-color: var(--blue);
  color: var(--white);
}

.primary-button:hover {
  background-color: var(--dark-blue);
}

.outline-button {
  background-color: transparent;
  border: 1px solid #D1D5DB;
  color: #374151;
}

.outline-button:hover {
  background-color: #F9FAFB;
}

.danger-outline-button {
  background-color: transparent;
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--red);
}

.danger-outline-button:hover {
  background-color: var(--red-light);
}

/* Result Container */
.result-container {
  margin-top: 2rem;
  padding: 1rem;
  background-color: #EFF6FF;
  border-radius: var(--radius);
  border: 1px solid #DBEAFE;
}

.result-label {
  font-size: 0.875rem;
  color: #6B7280;
  margin-bottom: 0.5rem;
}

.result-url-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.short-url {
  color: var(--blue);
  font-weight: 500;
  word-break: break-all;
  text-decoration: none;
}

.short-url:hover {
  text-decoration: underline;
}

/* History Styles */
.history-section {
  padding: 3rem 0;
  background-color: var(--white);
}

.history-container {
  max-width: 64rem;
  margin: 0 auto;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.history-header h2 {
  font-size: 1.5rem;
  font-weight: bold;
  color: #1F2937;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: 400px; /* Set a fixed height */
  overflow-y: auto; /* Make it scrollable */
  padding-right: 0.5rem; /* Add padding for scrollbar */
}

/* Add custom scrollbar styling */
.history-list::-webkit-scrollbar {
  width: 6px;
}

.history-list::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb {
  background: var(--light-blue);
  border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
  background: var(--blue);
}

.history-item {
  background-color: var(--white);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow);
}

.history-item-header {
  padding: 1rem;
  background-color: #F9FAFB;
  border-bottom: 1px solid #F3F4F6;
  margin: -1rem -1rem 1rem -1rem;
}

.history-item-title {
  font-size: 1.125rem;
  color: #4B5563;
}

.history-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.history-item-content > div {
  padding-bottom: 0.5rem;
}

.history-item-content > div:not(:last-child) {
  border-bottom: 1px solid #F3F4F6;
}

.history-url-label {
  font-size: 0.875rem;
  color: #6B7280;
  margin-bottom: 0.25rem;
}

.history-long-url {
  color: #374151;
  word-break: break-all;
}

.history-short-url-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.history-short-url-content {
  flex: 1;
}

.history-short-url {
  color: var(--blue);
  font-weight: 500;
  word-break: break-all;
  text-decoration: none;
}

.history-short-url:hover {
  text-decoration: underline;
}

/* Footer Styles */
.footer {
  padding: 2rem 0;
  background-color: #1F2937;
  color: var(--white);
}

.footer-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
}

@media (min-width: 768px) {
  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-section h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
}

.footer-section p {
  color: #D1D5DB;
}

.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-links a {
  color: #D1D5DB;
  text-decoration: none;
  transition: var(--transition);
}

.footer-links a:hover {
  color: var(--white);
}

.contact-email {
  color: var(--light-blue);
  text-decoration: none;
  transition: var(--transition);
}

.contact-email:hover {
  color: var(--white);
}

.copyright {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #374151;
  text-align: center;
  color: #9CA3AF;
}

/* Toast Styles */
.toastify {
  border-radius: var(--radius) !important;
  font-family: inherit !important;
}
