/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
  }
  
  body {
    font-family: "Helvetica Neue", sans-serif;
    background: #fdfdfd;
    color: #222;
    transition: background 0.4s ease, color 0.4s ease;
  }

  main {
    padding: 2rem;
  }
  
  .content-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
  }  
  
  html.dark-mode body {
    background: #121212;
    color: #f5f5f5;
  }
  
  html {
    scroll-behavior: smooth;
  }
  
  /* Fade-in Animation */
  .fade-in {
    opacity: 0;
    transform: translateY(15px);
    animation: fadeIn 1s forwards;
    animation-delay: 0.2s;
  }
  
  @keyframes fadeIn {
    to {
      opacity: 1;
      transform: none;
    }
  }
  
  /* Navbar */
  .navbar {
    background: var(--header-background, #ffffff);
    padding: 10px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    height: 60px;
    transition: background 0.4s ease, color 0.4s ease; /* <-- ADD THIS */
  }
  
  .nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
    max-width: 1300px; /* <-- Add this */
    margin: 0 auto; /* <-- Center the nav content */
    width: 100%; /* <-- Make sure it stays responsive */
    padding: 0 1rem; /* <-- Small breathing room on left/right */
  }  
  
  .right-group {
    display: flex;
    align-items: center;
  }  
  
  .left-group {
    display: flex;
    align-items: center;
  }
  
  .logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #000; /* Black by default */
    transition: color 0.4s ease;
  }
  
  html.dark-mode .logo {
    color: #fff; /* White in dark mode */
  }
  
  .back-button {
    font-size: 1.5rem;
    margin-right: 1rem;
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
  }
  
  .back-button:hover {
    color: #0070f3;
  }
  
  html.dark-mode .back-button:hover {
    color: #3399ff;
  }
  
  .theme-toggle {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
  }
  
  html.dark-mode .navbar {
    background: #1e1e1e;
  }
  
  /* Page Header */
  .page-header {
    text-align: center;
    padding: 2rem;
  }
  
  .page-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
  }
  
  .page-header h1 span {
    color: #0070f3;
  }
  
  .page-header p {
    font-size: 1.1rem;
    color: #666;
  }
  
  html.dark-mode .page-header p {
    color: #aaa;
  }
  
  /* Content Container */
  .content-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
  }
  
  @media (max-width: 768px) {
    .content-container {
      flex-direction: column;
      align-items: center;
    }
  }
  
  /* Form Section */
  .form-container {
    flex: 1;
  }
  
  .form-group {
    margin-bottom: 1.5rem;
    text-align: left;
  }
  
  label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: bold;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="url"],
  input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ccc;
    border-radius: 8px;
    font-size: 1rem;
    background: #f9f9f9;
    transition: background 0.4s ease, color 0.4s ease, border-color 0.4s ease; /* <-- ADD THIS */
  }
  
  input[type="file"] {
    background: none;
  }
  
  html.dark-mode input[type="text"],
  html.dark-mode input[type="email"],
  html.dark-mode input[type="url"],
  html.dark-mode input[type="file"] {
    background: #1f1f1f;
    border: 1px solid #444;
    color: #eee;
  }
  
  /* Generate Button */
  #generatePass {
    background: #0070f3;
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 8px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: background 0.3s;
  }
  
  #generatePass:disabled {
    background: #ccc;
    cursor: not-allowed;
  }
  
  #generatePass:hover:not(:disabled) {
    background: #0057c2;
  }
  
  /* Preview Section */
  .preview-container {
    flex: 1;
    display: flex;
    justify-content: center;
  }
  
  .pass-preview {
    -webkit-touch-callout: none; /* Prevent long-press context menu */
    -webkit-user-select: none;   /* Prevent selection */
    user-select: none;
    width: 300px;
    padding: 2rem;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    text-align: center;
    transition: background 0.4s, box-shadow 0.4s, transform 0.3s;
  }
  
  .pass-preview a {
    pointer-events: none; 
    color: inherit;
    text-decoration: none;
  }
  
  /* Only apply hover lift effect for screens wider than 768px (i.e., desktops) */
  @media (min-width: 768px) {
    .pass-preview:hover {
      transform: translateY(-8px);
      box-shadow: 0 8px 20px rgba(0,0,0,0.2);
    }
  }  
  
  html.dark-mode .pass-preview {
    background: #1f1f1f;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }
  
  .preview-photo {
    width: 80px;
    height: 80px;
    background: #ddd;
    border-radius: 50%;
    margin: 0 auto 1rem auto;
  }
  
  .pass-preview h2 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
  }
  
  .pass-preview p {
    margin-bottom: 0.5rem;
    font-size: 1rem;
  }
  
  .qr-placeholder {
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #aaa;
  }
  
  /* Footer */
  .footer {
    margin-top: 3rem;
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
    color: #777;
  }
  
  html.dark-mode .footer {
    color: #aaa;
  }
  
  /* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .modal-content {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
  }
  
  #cropperImage {
    max-width: 90vw;
    max-height: 70vh;
  }
  
  .modal-buttons {
    margin-top: 1rem;
  }
  
  .modal-buttons button {
    margin: 0 0.5rem;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    background: #0070f3;
    color: white;
  }
  
  .modal-buttons button:hover {
    background: #0057c2;
  }
  
  /* True hidden for Modal (display: none) */
  .modal.hidden {
    display: none;
  }

  .qr-wrapper {
    background: #ffffff;
    padding: 10px;
    border-radius: 12px;
    display: inline-block;
    opacity: 0;
    visibility: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin-top: 1rem;
    width: fit-content;
    height: fit-content;
    text-align: center;
  }
  
  html.dark-mode .qr-wrapper {
    background: #ffffff;
  }
  
  #previewQR {
    width: 120px;
    height: 120px;
    display: block;
    margin: 0 auto;
  }

  /* --- Field Toggle (Switch Cards) --- */
.field-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f9f9f9;
    padding: 0.6rem 1rem;
    margin: 0.5rem 0;
    border-radius: 8px;
    width: 220px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    font-weight: bold;
    transition: background 0.3s ease, color 0.3s ease;
  }
  
  html.dark-mode .field-toggle {
    background: #1f1f1f;
    color: #eee;
  }
  
  /* Switch Styling */
  .switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
  }
  
  .switch input {
    opacity: 0;
    width: 0;
    height: 0;
  }
  
  .slider {
    position: absolute;
    cursor: pointer;
    top: 0; left: 0;
    right: 0; bottom: 0;
    background-color: #ccc;
    border-radius: 24px;
    transition: 0.4s;
  }
  
  .slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.4s;
  }
  
  .switch input:checked + .slider {
    background-color: #0070f3;
  }
  
  .switch input:checked + .slider:before {
    transform: translateX(20px);
  }
  
  
  /* --- Field Settings (Dropdowns) --- */
  .field-settings select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    margin-left: 0.5rem;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  }
  
  .field-settings select:hover {
    background: #f0f0f0;
    border-color: #0070f3;
  }
  
  html.dark-mode .field-settings select {
    background: #1f1f1f;
    color: #eee;
    border: 1px solid #555;
  }
  
  html.dark-mode .field-settings select:hover {
    background: #2a2a2a;
    border-color: #3399ff;
  }

  .alignment-group {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.3rem;
  }
  
  .alignment-button {
    background: #f9f9f9;
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  }
  
  .alignment-button:hover {
    background: #f0f0f0;
    border-color: #0070f3;
  }
  
  .alignment-button.selected {
    background: #0070f3;
    color: white;
    border-color: #0070f3;
  }
  
  html.dark-mode .alignment-button {
    background: #1f1f1f;
    border: 1px solid #555;
    color: #eee;
  }
  
  html.dark-mode .alignment-button:hover {
    background: #2a2a2a;
    border-color: #3399ff;
  }
  
  html.dark-mode .alignment-button.selected {
    background: #3399ff;
    color: white;
    border-color: #3399ff;
  }
  
  .fade-field {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  
  .fade-field.hidden {
    opacity: 0;
    visibility: hidden;
  }
  
  .fade-qr {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }
  
  .fade-qr.fade-hidden {
    opacity: 0;
    visibility: hidden;
  }

  .pickr .pcr-button {
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.15);
    border: 1px solid #ccc;
    transition: box-shadow 0.3s ease;
}

.pickr .pcr-button:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}



