/**
 * Sharelink Styles
 * All theme values are set via CSS variables from database
 */

/* CSS Variables - Default values (overridden by JS from database) */
:root {
  --primary-color: #6366f1;
  --secondary-color: #8b5cf6;
  --background-color: #0f172a;
  --text-color: #f8fafc;
  --card-color: #1e293b;
  --font-family: 'Inter', sans-serif;
  --border-radius: 12px;
  --button-style: solid;
  --background-image: '';
  --background-overlay: rgba(0, 0, 0, 0.5);
}

/* Reset & Base */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  background-color: var(--background-color);
  color: var(--text-color);
  min-height: 100vh;
  line-height: 1.6;
}

/* Background Image Support */
body.has-background {
  background-image: var(--background-image);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
}

body.has-background::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--background-overlay);
  z-index: -1;
}

/* Container */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Loading State */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  gap: 1rem;
}

.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid var(--card-color);
  border-top-color: var(--primary-color);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* Content */
.content {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2rem;
  animation: fadeIn 0.5s ease;
}

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

/* Profile Section */
.profile {
  text-align: center;
  padding: 1rem 0;
}

.profile-image-wrapper {
  display: inline-block;
  padding: 4px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: 50%;
  margin-bottom: 1rem;
}

.profile-image {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid var(--background-color);
}

.profile-name {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-color);
}

.profile-description {
  font-size: 0.95rem;
  opacity: 0.85;
  max-width: 400px;
  margin: 0 auto;
  color: var(--text-color);
}

/* Social Links Section */
.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background-color: var(--card-color);
  border-radius: 50%;
  color: var(--text-color);
  text-decoration: none;
  transition: all 0.2s ease;
}

.social-link:hover {
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  transform: translateY(-2px);
}

.social-link svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* Links Section */
.links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Solid Button Style */
.link-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  width: 100%;
  padding: 1rem 1.5rem;
  background-color: var(--card-color);
  color: var(--text-color);
  text-decoration: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  font-size: 0.95rem;
  transition: all 0.2s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
}

.link-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Gradient hover effect */
.link-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: -1;
}

.link-button:hover::before {
  opacity: 1;
}

/* Outline Button Style */
.link-button.outline {
  background-color: transparent;
  border-color: var(--card-color);
}

.link-button.outline:hover {
  border-color: var(--primary-color);
  background-color: var(--primary-color);
}

/* Glass Button Style */
.link-button.glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.link-button.glass:hover {
  background: rgba(255, 255, 255, 0.2);
}

.link-button .icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.link-button .icon svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 2rem;
  text-align: center;
  font-size: 0.8rem;
  opacity: 0.6;
}

.footer a {
  color: var(--text-color);
  text-decoration: none;
}

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

/* Error State */
.error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  gap: 1rem;
}

.error-icon {
  font-size: 3rem;
}

.error h2 {
  font-size: 1.25rem;
}

.error p {
  opacity: 0.7;
}

.retry-button {
  padding: 0.75rem 1.5rem;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  color: white;
  border: none;
  border-radius: var(--border-radius);
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.retry-button:hover {
  transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 480px) {
  .container {
    padding: 1.5rem 1rem;
  }

  .profile-image {
    width: 80px;
    height: 80px;
  }

  .profile-name {
    font-size: 1.25rem;
  }

  .link-button {
    padding: 0.875rem 1.25rem;
    font-size: 0.9rem;
  }
}

/* Dark mode media query support */
@media (prefers-color-scheme: light) {
  /* Light mode defaults can be added here if needed */
}
