* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: #ffffff;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.container {
  text-align: center;
  max-width: 600px;
  width: 100%;
}

h1 {
  color: #333;
  font-size: 36px;
  margin-bottom: 50px;
  font-weight: 600;
}

.button-group {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-width: 400px;
  margin: 0 auto;
  margin-top: 30px;
}

button {
  padding: 15px 30px;
  font-size: 16px;
  font-weight: 500;
  /* Default to transparent border to avoid layout shift;
     specific landing CTAs will set a visible border color below. */
  border: 2px solid transparent;
  border-radius: 8px;
  background: white;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
}

/* Landing primary CTAs: bring back a visible border */
.button-group button,
.input-group>button {
  border-color: #ddd;
}

button:hover {
  background: #444;
  color: white;
}

.button-group button:hover,
.input-group>button:hover {
  border-color: #444;
}

.input-group {
  max-width: 400px;
  margin: 0 auto;
  display: none;
}

.input-group.show {
  display: block;
}

input {
  width: 100%;
  padding: 15px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 16px;
  margin-bottom: 15px;
}

input:focus {
  outline: none;
  border-color: #333;
}

.back-link {
  color: #666;
  text-decoration: none;
  font-size: 14px;
  display: inline-block;
  margin-top: 20px;
  cursor: pointer;
}

.back-link:hover {
  color: #333;
}

/* Profile Section */
.profile-section {
  margin-bottom: 30px;
  max-width: 400px;
  margin-left: auto;
  margin-right: auto;
}

.profile-container {
  display: flex;
  align-items: center;
  gap: 15px;
}

.profile-image-wrapper {
  position: relative;
  width: 60px;
  height: 60px;
  flex-shrink: 0;
}

.profile-image {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #ddd;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s ease;
}

.profile-image:hover {
  border-color: #333;
}

.profile-upload-btn {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #444;
  color: white;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
}

.profile-upload-btn:hover {
  background: #666;
  transform: scale(1.1);
}

.user-name-input {
  flex: 1 1 auto;
  /* In a flex row, global `input { width: 100% }` can cause overflow.
     Let the input size to remaining space instead. */
  width: auto;
  min-width: 0;
  max-width: none;
  margin-bottom: 0;
}

/* Responsive Styles */
@media (max-width: 768px) {
  body {
    padding: 15px;
  }

  h1 {
    font-size: 28px;
    margin-bottom: 30px;
  }

  .button-group {
    max-width: 100%;
    margin-top: 20px;
    gap: 12px;
  }

  button {
    padding: 12px 24px;
    font-size: 15px;
  }

  .profile-section {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .profile-container {
    gap: 12px;
  }

  .profile-image-wrapper {
    width: 50px;
    height: 50px;
  }

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

  .profile-upload-btn {
    width: 20px;
    height: 20px;
  }

  .profile-upload-btn svg {
    width: 12px;
    height: 12px;
  }

  .user-name-input {
    font-size: 14px;
    padding: 12px;
  }

  input {
    padding: 12px;
    font-size: 15px;
  }

  .input-group {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  h1 {
    font-size: 24px;
    margin-bottom: 25px;
  }

  .button-group {
    gap: 10px;
  }

  button {
    padding: 10px 20px;
    font-size: 14px;
  }

  .profile-image-wrapper {
    width: 45px;
    height: 45px;
  }

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

  .user-name-input {
    font-size: 13px;
    padding: 10px;
  }
}

/* Payment Modal */
.payment-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.payment-modal.show {
  opacity: 1;
  visibility: visible;
}

.payment-modal-content {
  background: white;
  border-radius: 16px;
  padding: 30px;
  max-width: 400px;
  width: 90%;
  text-align: center;
  position: relative;
  transform: scale(0.9);
  transition: transform 0.3s ease;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.payment-modal.show .payment-modal-content {
  transform: scale(1);
}

.payment-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 32px;
  height: 32px;
  border: none;
  background: rgba(0, 0, 0, 0.14);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.2s ease;
  color: #333;
}

.payment-close-btn:hover {
  background: rgba(0, 0, 0, 0.26);
  transform: scale(1.1);
}

.payment-close-btn svg {
  width: 18px;
  height: 18px;
}

.payment-modal-content h2 {
  color: #333;
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 20px;
  margin-top: 0;
}

.qr-code-container {
  margin: 20px 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

.qr-code-image {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  border: 2px solid #ddd;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.payment-note {
  color: #666;
  font-size: 14px;
  margin-top: 20px;
  margin-bottom: 0;
}

/* Responsive styles for payment modal */
@media (max-width: 768px) {
  .payment-modal-content {
    padding: 25px 20px;
    max-width: 90%;
  }

  .payment-modal-content h2 {
    font-size: 20px;
    margin-bottom: 15px;
  }

  .payment-note {
    font-size: 13px;
    margin-top: 15px;
  }
}

@media (max-width: 480px) {
  .payment-modal-content {
    padding: 20px 15px;
  }

  .payment-modal-content h2 {
    font-size: 18px;
  }

  .payment-close-btn {
    width: 28px;
    height: 28px;
    top: 10px;
    right: 10px;
  }

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

/* Settings Modal */
.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.settings-modal.show {
  opacity: 1;
  visibility: visible;
}

.settings-modal-content {
  background: linear-gradient(145deg, rgba(30, 30, 35, 0.95), rgba(20, 20, 25, 0.95));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 90%;
  max-width: 550px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transform: scale(0.95) translateY(10px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.settings-modal.show .settings-modal-content {
  transform: scale(1) translateY(0);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 30px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
}

.settings-header h2 {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.close-settings-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.close-settings-btn:hover {
  color: #fff;
}

.settings-body {
  padding: 20px 30px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Custom Scrollbar for Settings Body */
.settings-body::-webkit-scrollbar {
  width: 6px;
}

.settings-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.settings-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 3px;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.settings-section h3 {
  color: #57a8ff;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: flex;
  align-items: center;
  gap: 10px;
}

.settings-section h3 .badge {
  background: rgba(255, 59, 48, 0.15);
  color: #ff453a;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  padding: 16px 20px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s, border-color 0.2s;
  /* Ensure children elements are not blocked by absolute slider */
  z-index: 1;
}

.setting-item:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.1);
}

.setting-item.password-input-container {
  padding: 0;
  background: transparent;
  border: none;
  margin-top: -8px;
}

.setting-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.setting-title {
  color: #fff;
  font-size: 16px;
  font-weight: 500;
}

.setting-desc {
  color: rgba(255, 255, 255, 0.5);
  font-size: 13px;
  line-height: 1.4;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
  flex-shrink: 0;
  z-index: 2;
  /* Increased z-index */
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-switch .slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.2);
  transition: .4s;
  border-radius: 34px;
}

.toggle-switch .slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.toggle-switch input:checked+.slider {
  background-color: #34c759;
}

.toggle-switch input:checked+.slider:before {
  transform: translateX(20px);
}

.toggle-switch input:disabled+.slider {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Buttons inside settings */
.settings-action-btn {
  background: rgba(255, 255, 255, 0.1);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 8px 16px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
  /* Increased z-index */
}

.settings-action-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.settings-action-btn.danger {
  color: #ff453a;
  background: rgba(255, 69, 58, 0.1);
  border-color: rgba(255, 69, 58, 0.3);
}

.settings-action-btn.danger:hover {
  background: rgba(255, 69, 58, 0.2);
}

/* Inputs */
.settings-input {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: white;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
  z-index: 2;
  /* Increased z-index */
}

.settings-input:focus {
  border-color: #57a8ff;
}

.settings-input.small-input {
  width: 80px;
  text-align: center;
}

.support-item {
  background: linear-gradient(135deg, rgba(87, 168, 255, 0.1), rgba(70, 136, 230, 0.05));
  border-color: rgba(87, 168, 255, 0.2);
}

/* ===================== Recordings Modal ===================== */
.recordings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.recordings-modal.show {
  opacity: 1;
  visibility: visible;
}

.recordings-modal-content {
  background: linear-gradient(145deg, rgba(22, 22, 30, 0.97), rgba(14, 14, 20, 0.97));
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 24px;
  width: 90%;
  max-width: 620px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(255, 255, 255, 0.05) inset;
  transform: scale(0.95) translateY(12px);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  overflow: hidden;
}

.recordings-modal.show .recordings-modal-content {
  transform: scale(1) translateY(0);
}

.recordings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.02);
  flex-shrink: 0;
}

.recordings-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #ff6b6b;
}

.recordings-header-left h2 {
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}

.recordings-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.45);
  font-size: 28px;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
  padding: 0;
}

.recordings-close-btn:hover {
  color: #fff;
  background: transparent;
}

.recordings-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}

.recordings-body::-webkit-scrollbar {
  width: 6px;
}

.recordings-body::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.1);
}

.recordings-body::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.18);
  border-radius: 3px;
}

.recordings-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Loading spinner */
.recordings-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 50px 0;
  color: rgba(255, 255, 255, 0.45);
  font-size: 14px;
}

.recordings-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(255, 255, 255, 0.12);
  border-top-color: #ff6b6b;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

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

/* Empty state */
.recordings-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 50px 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 14px;
  text-align: center;
}

.recordings-empty svg {
  opacity: 0.4;
}

/* Error state */
.recordings-error {
  text-align: center;
  padding: 40px 0;
  color: #ff6b6b;
  font-size: 14px;
  opacity: 0.9;
}

/* Recording card */
.recording-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 14px;
  padding: 14px 18px;
  transition: background 0.2s, border-color 0.2s, transform 0.15s;
}

.recording-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.14);
  transform: translateY(-1px);
}

.recording-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 107, 107, 0.2), rgba(255, 60, 60, 0.1));
  border: 1px solid rgba(255, 107, 107, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #ff6b6b;
}

.recording-info {
  flex: 1;
  min-width: 0;
}

.recording-name {
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.recording-meta {
  display: flex;
  gap: 12px;
  color: rgba(255, 255, 255, 0.4);
  font-size: 12px;
}

.recording-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recording-count-badge {
  background: rgba(255, 107, 107, 0.15);
  color: #ff6b6b;
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: 20px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 10px;
  letter-spacing: 0;
  text-transform: none;
  vertical-align: middle;
}

/* Download button */
.recording-download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.2);
  color: #ff6b6b;
  flex-shrink: 0;
  text-decoration: none;
  transition: background 0.2s, border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}

.recording-download-btn:hover {
  background: rgba(255, 107, 107, 0.22);
  border-color: rgba(255, 107, 107, 0.45);
  transform: scale(1.08);
  box-shadow: 0 0 12px rgba(255, 107, 107, 0.25);
}

.recording-download-btn:active {
  transform: scale(0.96);
}


/* Responsive */
@media (max-width: 600px) {
  .recordings-modal-content {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    max-height: 90vh;
    margin-top: auto;
    align-self: flex-end;
  }

  .recordings-modal {
    align-items: flex-end;
  }

  .recordings-header {
    padding: 18px 20px;
  }

  .recordings-body {
    padding: 16px 16px;
  }
}