/*
 * secure-lock.css — Styles for secure_lock encrypted content blocks.
 * Replicates the HackTheBox lock-screen UI with Chirpy theme variable support.
 */

/* ── Wrapper ─────────────────────────────────────────────────────────── */

.secure-content-wrapper {
  font-family: inherit;
  position: relative;
  margin: 2rem 0;
  z-index: 1;

  /* Override --link-color to match the site's purple accent (#B026FF) */
  --link-color: #b026ff;
}

.secure-content-wrapper *,
.secure-content-wrapper *::before,
.secure-content-wrapper *::after {
  box-sizing: border-box;
}

/* ── Lock Section Card ───────────────────────────────────────────────── */

.secure-lock-section {
  background: var(--card-bg);
  border: 1px solid var(--main-border-color);
  border-radius: 12px;
  padding: 2rem;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    border-color 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.secure-lock-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--link-color) 10%, transparent),
    transparent
  );
  transition: left 0.5s ease;
}

.secure-lock-section:hover::before {
  left: 100%;
}

.secure-lock-section:hover {
  border-color: var(--link-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--link-color) 15%, transparent);
}

/* ── Security Badge ──────────────────────────────────────────────────── */

.secure-security-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: color-mix(in srgb, var(--link-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--link-color) 30%, transparent);
  border-radius: 20px;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--link-color);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.secure-badge-unlocked {
  background: rgba(176, 38, 255, 0.2);
  border-color: rgba(176, 38, 255, 0.5);
}

/* ── Header (icon + text) ────────────────────────────────────────────── */

.secure-lock-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.secure-lock-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  background: var(--link-color);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.secure-lock-section:hover .secure-lock-icon {
  transform: scale(1.1) rotate(-5deg);
}

.secure-lock-info h3 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--heading-color);
  letter-spacing: 0.5px;
  margin: 0 0 0.25rem 0;
}

.secure-lock-info p {
  font-size: 0.875rem;
  color: var(--text-muted-color);
  font-weight: 400;
  margin: 0;
}

.secure-lock-info a {
  color: var(--link-color);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.secure-lock-info a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ── Input Group ─────────────────────────────────────────────────────── */

.secure-input-group {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}

.secure-password-input {
  flex: 1;
  min-width: 280px;
  padding: 0.875rem 1rem;
  background: var(--main-bg) !important;
  border: 1px solid var(--main-border-color) !important;
  border-radius: 8px;
  color: var(--text-color) !important;
  font-size: 1rem;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease;
  outline: none !important;
}

.secure-password-input:focus {
  border-color: var(--link-color) !important;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 15%, transparent) !important;
}

.secure-password-input::placeholder {
  color: var(--text-muted-color) !important;
  opacity: 1;
}

/* ── Unlock Button ───────────────────────────────────────────────────── */

.secure-unlock-button {
  padding: 0.875rem 1.5rem;
  background: var(--link-color) !important;
  color: var(--main-bg) !important;
  border: none !important;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition:
    transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
    box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  outline: none !important;
}

.secure-unlock-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.5s ease;
}

.secure-unlock-button:hover::before {
  left: 100%;
}

.secure-unlock-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--link-color) 30%, transparent) !important;
}

.secure-unlock-button:active {
  transform: translateY(0);
}

.secure-unlock-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Loading spinner (inside button) ─────────────────────────────────── */

.secure-loading {
  position: relative;
  min-width: 140px;
  min-height: 44px;
}

.secure-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 20px;
  height: 20px;
  border: 2px solid transparent;
  border-top: 2px solid currentColor;
  border-radius: 50%;
  animation: secure-spin 1s linear infinite;
}

@keyframes secure-spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* ── Status Message ──────────────────────────────────────────────────── */

.secure-status-message {
  margin-top: 1.25rem;
  padding: 1rem 1.25rem;
  border-radius: 8px;
  font-weight: 500;
  font-size: 0.875rem;
  transition: opacity 0.3s ease;
  display: none;
}

.secure-status-message.secure-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  display: block;
}

.secure-status-message.secure-success {
  background: color-mix(in srgb, var(--link-color) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--link-color) 30%, transparent);
  color: var(--link-color);
  display: block;
}

/* ── Social Links ────────────────────────────────────────────────────── */

.secure-social-section {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--main-border-color);
}

.secure-social-text {
  font-size: 0.875rem;
  color: var(--text-muted-color);
  margin-bottom: 1rem;
  text-align: center;
}

.secure-social-links {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.secure-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  background: var(--main-bg);
  border: 1px solid var(--main-border-color);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text-color);
  font-size: 0.875rem;
  font-weight: 500;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease,
    border-color 0.3s ease,
    color 0.3s ease;
}

.secure-social-link:hover {
  border-color: var(--link-color);
  color: var(--link-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--link-color) 15%, transparent);
}

.secure-social-link i {
  font-size: 1.1rem;
}

/* ── Animations ──────────────────────────────────────────────────────── */

@keyframes secure-shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.secure-shake {
  animation: secure-shake 0.5s ease-in-out;
}

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

.secure-unlocked {
  animation: secure-fadeIn 0.6s ease-in;
}

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .secure-lock-section {
    padding: 1.5rem;
  }

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

  .secure-password-input {
    min-width: auto;
  }

  .secure-unlock-button {
    width: 100%;
  }

  .secure-lock-header {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
  }

  .secure-security-badge {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
  }
}
