/* src/views/app/app.css */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-background: #0f172a;
  --color-background-top: #1e293b;
  --color-surface: #1e293b;
  --color-surface-inner: #0f172a;
  --color-border: #334155;
  --color-primary: #fff;
  --color-accent: #06c;
  --color-accent-hover: #0052a3;
  --color-text: #f1f5f9;
  --color-text-muted: #94a3b8;
  --color-text-label: #64748b;
  --color-copy-bg: #334155;
  --color-copy-hover: #475569;
  --color-success: #22c55e;
}

body {
  background: linear-gradient(180deg, var(--color-background-top) 0%, var(--color-background) 40%);
  color: var(--color-text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  line-height: 1.6;
}

.top-nav {
  display: flex;
  justify-content: flex-end;
  align-items:  center;
  padding: 1rem 2rem;
}

.user-dropdown {
  position: relative;
  display: none;
}

.user-toggle {
  border: 1px solid var(--color-border);
  cursor: pointer;
  display: flex;
  background: none;
  border-radius: 50%;
  justify-content: center;
  align-items:  center;
  padding: .5rem;
  transition: all .2s;
}

.user-toggle:hover {
  border-color: var(--color-text-muted);
  background: var(--color-surface);
}

.user-icon {
  color: var(--color-text-muted);
  width: 20px;
  height: 20px;
}

.dropdown-menu {
  position: absolute;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  display: none;
  overflow: hidden;
  border-radius: 8px;
  flex-direction: column;
  min-width: 160px;
  top: calc(100% + .5rem);
  right: 0;
  box-shadow: 0 10px 30px #0000004d;
}

.dropdown-menu.show {
  display: flex;
}

.dropdown-item {
  color: var(--color-text);
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  padding: .75rem 1rem;
  transition: background .2s;
  font-size: .875rem;
}

.dropdown-item:hover {
  background: var(--color-surface-inner);
}

.logout-item {
  color: #ef4444;
  border-top: 1px solid var(--color-border);
}

.logout-item:hover {
  background: #ef44441a;
}

.login-link {
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color .2s;
  font-size: .875rem;
  font-weight: 500;
}

.login-link:hover {
  color: var(--color-text);
}

main {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: center;
  align-items:  center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.5rem;
}

.hero h1 {
  letter-spacing: -.01em;
  margin-bottom: .75rem;
  font-size: 2.5rem;
  font-weight: 700;
  line-height: 1.2;
}

.hero p {
  color: var(--color-text-muted);
  max-width: 500px;
  margin: 0 auto;
  font-size: 1rem;
}

.shortener-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  width: 100%;
  max-width: 600px;
  padding: 2rem;
}

.input-group {
  display: flex;
  gap: .75rem;
}

.url-input {
  background: var(--color-surface-inner);
  border: 1px solid var(--color-border);
  color: var(--color-text);
  outline: none;
  border-radius: 8px;
  flex: 1;
  padding: .875rem 1rem;
  transition: border-color .2s;
  font-size: .9375rem;
}

.url-input:focus {
  border-color: var(--color-accent);
}

.url-input::placeholder {
  color: var(--color-text-muted);
}

.btn-shorten {
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  border: none;
  border-radius: 8px;
  align-items:  center;
  gap: .5rem;
  padding: .875rem 1.5rem;
  transition: background-color .2s;
  font-size: .9375rem;
  font-weight: 600;
}

.btn-shorten svg {
  width: 16px;
  height: 16px;
}

.btn-shorten:hover {
  background: var(--color-accent-hover);
}

.result-container {
  background: var(--color-surface-inner);
  border: 1px solid var(--color-border);
  border-radius: 8px;
  margin-top: 1rem;
  padding: 1.25rem;
}

.result-container.show {
  animation: fadeIn .2s ease-out;
  display: block !important;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

.result-label {
  color: var(--color-text-label);
  display: block;
  letter-spacing: .05em;
  margin-bottom: .375rem;
  font-size: .6875rem;
  font-weight: 500;
}

.result-url {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  gap: .75rem;
}

.shortened-url {
  color: var(--color-text);
  text-decoration: none;
  word-break: break-all;
  font-size: 1.125rem;
  font-weight: 600;
}

.btn-copy {
  background: var(--color-copy-bg);
  color: var(--color-text);
  cursor: pointer;
  white-space: nowrap;
  display: flex;
  border: none;
  border-radius: 6px;
  align-items:  center;
  gap: .5rem;
  padding: .5rem 1rem;
  transition: background-color .2s;
  font-size: .8125rem;
  font-weight: 500;
}

.copy-icon {
  width: 14px;
  height: 14px;
}

.btn-copy:hover {
  background: var(--color-copy-hover);
}

.btn-copy.copied {
  background: var(--color-success);
  color: #fff;
}

@media (width <= 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: .9375rem;
  }

  .input-group {
    flex-direction: column;
  }

  .shortener-card {
    padding: 1.5rem;
  }

  .result-url {
    flex-direction: column;
    align-items: stretch;
  }

  .btn-copy {
    justify-content: center;
    width: 100%;
  }
}
