/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background-color: #f6f8fa;
  color: #333;
  padding: 2rem;
  line-height: 1.5;
}

/* Centered container for all pages */
.container {
  max-width: 1000px;
  margin: auto;
  background: white;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Headings */
h1 {
  text-align: center;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
  color: #222;
}

h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: #222;
}

/* Forms */
form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

input[type="text"],
input[type="password"],
input[type="url"] {
  padding: 0.75rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}

button {
  padding: 0.75rem;
  background-color: #0066ff;
  color: white;
  font-weight: bold;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

button:hover {
  background-color: #004fd1;
}

/* Dashboard layout */
.dashboard-wrapper {
  display: flex;
  flex-direction: row;
  gap: 2rem;
  flex-wrap: wrap;
}

.sidebar {
  flex: 1;
  min-width: 220px;
}

.main-content {
  flex: 2;
  min-width: 300px;
}

/* Sidebar list of links */
.link-dropdown {
  display: flex;
  flex-direction: column;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 1rem;
  background: #f5f5f5;
  max-height: 70vh;
  overflow-y: auto;
}

.link-dropdown button {
  background: none;
  border: none;
  text-align: left;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0066cc;
  cursor: pointer;
  border-radius: 4px;
}

.link-dropdown button:hover {
  background: #e6f0ff;
}

/* Detail display for selected shortlink */
.selected-link {
  margin-top: 1rem;
  background: #eef6ff;
  border-radius: 8px;
  padding: 1rem;
  font-size: 1rem;
  word-break: break-word;
  overflow-wrap: break-word;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.selected-link p {
  margin: 0.5rem 0;
}

.selected-link button {
  margin-top: 0.5rem;
  margin-right: 0.5rem;
  font-size: 0.95rem;
  padding: 0.5rem 1rem;
  background: #0066cc;
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.selected-link button:hover {
  background: #004fa3;
}

/* Link shortener form on dashboard */
.shorten-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f0f0f0;
  padding: 1.5rem;
  border-radius: 8px;
}

.shorten-form input,
.shorten-form button {
  padding: 0.85rem;
  font-size: 1.1rem;
  border-radius: 6px;
}

.shorten-form button {
  background-color: #0066ff;
  color: white;
  border: none;
  cursor: pointer;
}

.shorten-form button:hover {
  background-color: #004fcc;
}

/* Link display blocks (used on older dashboard layout) */
.link-row {
  background-color: #f0f4ff;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
}

.link-row a {
  word-break: break-all;
  color: #0066cc;
  text-decoration: none;
}

.link-row a:hover {
  text-decoration: underline;
}

.link-row button {
  margin-top: 0.5rem;
  padding: 0.4rem 0.75rem;
  font-size: 0.9rem;
  background-color: #e53935;
  border-radius: 4px;
  border: none;
}

.link-row button:hover {
  background-color: #c62828;
  color: white;
}

/* Footer / navigation links */
.footer-links {
  text-align: center;
  margin-top: 2rem;
  font-size: 0.9rem;
}

.footer-links a {
  margin: 0 0.5rem;
  color: #444;
  text-decoration: none;
}

.footer-links a:hover {
  text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
  .dashboard-wrapper {
    flex-direction: column;
  }

  .link-dropdown {
    max-height: unset;
  }

  .container {
    padding: 1rem;
  }

  h1 {
    font-size: 1.5rem;
  }

  input, button {
    font-size: 1rem;
  }
}
