/* src/views/profile/profile.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;
  --color-danger: #ef4444;
  --color-danger-hover: #dc2626;
}

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

.home-bar {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-background-top);
  justify-content: end;
  align-items:  center;
  padding: 0 2rem;
}

.home-link {
  display: inline-flex;
  color: var(--color-text-muted);
  text-decoration: none;
  align-items:  center;
  gap: .5rem;
  transition: color .2s;
  font-size: .875rem;
  font-weight: 500;
}

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

.home-link svg {
  width: 16px;
  height: 16px;
}

.logout-btn {
  color: var(--color-text-muted);
  cursor: pointer;
  background: none;
  border: none;
  padding: .5rem 1rem;
  transition: all .2s;
  font-size: .875rem;
  font-weight: 500;
}

.logout-btn:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
}

.profile-container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem;
}

.profile-header {
  display: flex;
  justify-content: space-between;
  align-items:  center;
  margin-bottom: 2rem;
}

.profile-info {
  display: flex;
  align-items:  center;
  gap: 1rem;
}

.profile-avatar {
  border: 2px solid var(--color-border);
  border-radius: 50%;
  width: 56px;
  height: 56px;
}

.profile-name {
  margin-bottom: .25rem;
  font-size: 1.5rem;
  font-weight: 700;
}

.profile-username {
  color: var(--color-text-muted);
  font-size: .875rem;
}

.profile-stats {
  display: flex;
  gap: 1rem;
}

.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  text-align: center;
  border-radius: 12px;
  min-width: 120px;
  padding: 1rem 1.5rem;
}

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

.stat-value {
  display: block;
  color: var(--color-text);
  font-size: 1.5rem;
  font-weight: 700;
}

.create-link-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  margin-bottom: 2rem;
  padding: 1.5rem;
}

.card-title {
  margin-bottom: .25rem;
  font-size: 1rem;
  font-weight: 600;
}

.card-subtitle {
  color: var(--color-text-muted);
  margin-bottom: 1rem;
  font-size: .8125rem;
}

.shorten-form {
  margin-bottom: 0;
}

.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: .75rem 1rem;
  transition: border-color .2s;
  font-size: .875rem;
}

.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: .75rem 1.25rem;
  transition: background-color .2s;
  font-size: .875rem;
  font-weight: 600;
}

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

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

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

.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: 1rem;
  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;
}

.links-section {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  border-radius: 12px;
}

.links-header {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  justify-content: space-between;
  align-items:  center;
  padding: 1rem 1.5rem;
}

.section-title {
  font-size: 1rem;
  font-weight: 600;
}

.btn-filter {
  background: var(--color-surface-inner);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  border-radius: 6px;
  align-items:  center;
  gap: .5rem;
  padding: .5rem .75rem;
  transition: all .2s;
  font-size: .8125rem;
}

.btn-filter:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.btn-filter svg {
  width: 14px;
  height: 14px;
}

.links-table-container {
  overflow-x: auto;
}

.modal {
  position: fixed;
  display: flex;
  z-index: 1000;
  background: #000000b3;
  justify-content: center;
  align-items:  center;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
}

.modal-content {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  overflow: hidden;
  border-radius: 12px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
}

.modal-header {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  justify-content: space-between;
  align-items:  center;
  padding: 1rem 1.5rem;
}

.modal-title {
  font-size: 1rem;
  font-weight: 600;
}

.modal-close {
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  background: none;
  border: none;
  border-radius: 6px;
  justify-content: center;
  align-items:  center;
  padding: .25rem;
  transition: all .2s;
}

.modal-close:hover {
  color: var(--color-text);
  background: #ffffff1a;
}

.modal-close svg {
  width: 20px;
  height: 20px;
}

.modal-body {
  overflow-y: auto;
  max-height: 60vh;
  padding: 1rem 1.5rem;
}

.click-item {
  display: flex;
  border-bottom: 1px solid var(--color-border);
  flex-direction: column;
  gap: .25rem;
  padding: .75rem 0;
}

.click-item:last-child {
  border-bottom: none;
}

.click-ip {
  color: var(--color-text);
  font-size: .875rem;
  font-weight: 600;
}

.click-agent {
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
}

.click-time {
  color: var(--color-text-label);
  font-size: .6875rem;
}

.no-clicks {
  text-align: center;
  color: var(--color-text-muted);
  padding: 2rem;
}

.links-table {
  border-collapse: collapse;
  width: 100%;
}

.links-table th {
  text-align: left;
  color: var(--color-text-label);
  letter-spacing: .05em;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-inner);
  padding: .75rem 1.5rem;
  font-size: .6875rem;
  font-weight: 600;
}

.links-table td {
  border-bottom: 1px solid var(--color-border);
  padding: 1rem 1.5rem;
  font-size: .875rem;
}

.links-table tbody tr:last-child td {
  border-bottom: none;
}

.links-table tbody tr {
  transition: background .2s;
}

.links-table tbody tr:hover {
  background: #ffffff05;
}

.short-link-cell {
  color: var(--color-accent);
  text-decoration: none;
  font-weight: 600;
}

.short-link-cell:hover {
  text-decoration: underline;
}

.original-url-cell {
  color: var(--color-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 250px;
}

.clicks-cell {
  color: var(--color-text);
  font-weight: 600;
}

.actions-cell {
  display: flex;
  gap: .5rem;
}

.btn-action {
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  cursor: pointer;
  display: flex;
  background: none;
  border-radius: 6px;
  justify-content: center;
  align-items:  center;
  padding: .375rem;
  transition: all .2s;
}

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

.btn-action:hover {
  color: var(--color-text);
  border-color: var(--color-text-muted);
}

.btn-action.delete:hover {
  color: var(--color-danger);
  border-color: var(--color-danger);
  background: #ef44441a;
}

.empty-state {
  text-align: center;
  color: var(--color-text-muted);
  padding: 3rem 1.5rem;
}

.empty-state svg {
  opacity: .5;
  width: 48px;
  height: 48px;
  margin-bottom: 1rem;
}

.empty-state p {
  font-size: .875rem;
}

@media (width <= 768px) {
  .profile-container {
    padding: 1rem;
  }

  .profile-header {
    flex-direction: column;
    align-items:  flex-start;
    gap: 1.5rem;
  }

  .profile-stats {
    width: 100%;
  }

  .stat-card {
    flex: 1;
  }

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

  .btn-shorten {
    justify-content: center;
  }

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

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

  .links-table th:nth-child(2), .links-table td:nth-child(2) {
    display: none;
  }
}
