:root {
      --primary: #4361ee;
      --primary-dark: #3a56d4;
      --secondary: #7209b7;
      --accent: #f72585;
      --light: #f8f9fa;
      --dark: #212529;
      --gray: #6c757d;
      --light-gray: #e9ecef;
      --border-radius: 12px;
      --box-shadow: 0 8px 30px rgba(0, 0, 0, 0.08);
      --transition: all 0.3s ease;
    }

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

    body {
      font-family: 'Poppins', sans-serif;
      background: linear-gradient(135deg, var(--light) 0%, #f0f4ff 100%);
      color: var(--dark);
      line-height: 1.6;
      min-height: 100vh;
      transition: var(--transition);
      display: flex;
      flex-direction: column;
    }

    .container {
      max-width: 1200px;
      margin: 0 auto;
      padding: 20px;
      flex: 1;
      width: 100%;
    }

    header {
      text-align: center;
      padding: 40px 0 20px;
      margin-bottom: 30px;
    }

    .logo {
      font-size: 3.5rem;
      margin-bottom: 15px;
      color: var(--primary);
      display: inline-block;
      animation: pulse 2s infinite;
    }

    @keyframes pulse {
      0% { transform: scale(1); }
      50% { transform: scale(1.05); }
      100% { transform: scale(1); }
    }

    h1 {
      font-size: 2.8rem;
      margin-bottom: 10px;
      font-weight: 700;
      color: var(--dark);
      background: linear-gradient(90deg, var(--primary), var(--secondary));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
    }

    .tagline {
      font-size: 1.3rem;
      color: var(--gray);
      max-width: 700px;
      margin: 0 auto 25px;
    }

    .card {
      background: var(--light);
      border-radius: var(--border-radius);
      box-shadow: var(--box-shadow);
      padding: 30px;
      margin-bottom: 30px;
      transition: var(--transition);
    }

    .card:hover {
      transform: translateY(-5px);
      box-shadow: 0 12px 35px rgba(0, 0, 0, 0.1);
    }

    h2 {
      font-size: 1.8rem;
      margin-bottom: 25px;
      color: var(--dark);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 10px;
      justify-content: center;
    }

    h2 i {
      color: var(--primary);
    }

    h3 {
      font-size: 1.4rem;
      margin: 20px 0 15px;
      color: var(--dark);
      font-weight: 600;
      display: flex;
      align-items: center;
      gap: 8px;
      justify-content: center;
    }

    .tabs {
      display: flex;
      justify-content: center;
      margin: 0 0 30px;
      gap: 10px;
      flex-wrap: wrap;
    }

    .tab {
      padding: 12px 25px;
      cursor: pointer;
      background: var(--light-gray);
      border-radius: 50px;
      font-weight: 500;
      transition: var(--transition);
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 1rem;
    }

    .tab.active {
      background: var(--primary);
      color: white;
    }

    .tab:hover:not(.active) {
      background: #dbe4ff;
    }

    .tab-content {
      display: none;
    }

    .tab-content.active {
      display: block;
      animation: fadeIn 0.4s ease;
    }

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

    input, select, button, textarea {
      margin: 0.5em auto;
      padding: 15px;
      width: 100%;
      font-size: 1rem;
      border-radius: 10px;
      border: 1px solid var(--light-gray);
      background: var(--light);
      display: block;
      transition: var(--transition);
      font-family: 'Poppins', sans-serif;
    }

    input:focus, select:focus, textarea:focus {
      outline: none;
      border-color: var(--primary);
      box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.2);
    }

    button {
      background: var(--primary);
      color: white;
      border: none;
      cursor: pointer;
      font-weight: 600;
      padding: 15px 20px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
    }

    button:hover {
      background: var(--primary-dark);
      transform: translateY(-2px);
      box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    }

    button.secondary {
      background: var(--light);
      color: var(--primary);
      border: 2px solid var(--primary);
    }

    button.secondary:hover {
      background: #f0f4ff;
    }

    canvas {
      margin: 1.5em auto;
      display: block;
      max-width: 100%;
      border-radius: 12px;
      background: var(--light);
      padding: 15px;
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
      border: 1px solid var(--light-gray);
    }

    .color-group {
      display: flex;
      justify-content: center;
      gap: 25px;
      margin: 1.5em 0;
      flex-wrap: wrap;
    }

    .color-input {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      flex: 1;
      max-width: 200px;
    }

    .color-input label {
      font-weight: 500;
      color: var(--dark);
    }

    .color-input input[type="color"] {
      width: 60px;
      height: 60px;
      padding: 5px;
      cursor: pointer;
      border-radius: 12px;
      border: 2px solid var(--light-gray);
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    .color-input input[type="color"]::-webkit-color-swatch {
      border: none;
      border-radius: 8px;
    }

    .logo-upload-area {
      border: 2px dashed var(--light-gray);
      border-radius: var(--border-radius);
      padding: 30px;
      margin: 1.5em auto;
      cursor: pointer;
      transition: var(--transition);
      background: #fafbff;
      text-align: center;
      position: relative;
    }

    .logo-upload-area:hover, .logo-upload-area.drag-over {
      border-color: var(--primary);
      background: #f0f4ff;
    }

    .logo-upload-area i {
      font-size: 3rem;
      color: var(--primary);
      margin-bottom: 15px;
    }

    .logo-preview {
      width: 120px;
      height: 120px;
      margin: 1em auto;
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      border-radius: 12px;
      border: 1px solid var(--light-gray);
      background: var(--light);
      box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    }

    .logo-preview img {
      max-width: 100%;
      max-height: 100%;
      object-fit: contain;
    }

    .loading {
      display: none;
      text-align: center;
      padding: 30px;
    }

    .spinner {
      border: 4px solid rgba(0, 0, 0, 0.1);
      border-left-color: var(--primary);
      border-radius: 50%;
      width: 50px;
      height: 50px;
      animation: spin 1s linear infinite;
      margin: 0 auto 20px;
    }

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

    .error {
      color: #e74c3c;
      padding: 15px;
      background: rgba(231, 76, 60, 0.1);
      border-radius: var(--border-radius);
      margin: 20px 0;
      display: none;
      border-left: 4px solid #e74c3c;
    }

    .success {
      color: #27ae60;
      padding: 15px;
      background: rgba(39, 174, 96, 0.1);
      border-radius: var(--border-radius);
      margin: 20px 0;
      display: none;
      border-left: 4px solid #27ae60;
    }

    .scanner-container {
      position: relative;
      width: 100%;
      height: 350px;
      border-radius: var(--border-radius);
      overflow: hidden;
      margin: 1.5em auto;
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
      background: #000;
    }

    #scanner-video {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .scanner-overlay {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      display: flex;
      justify-content: center;
      align-items: center;
      background: rgba(0, 0, 0, 0.4);
    }

    .scanner-box {
      width: 250px;
      height: 250px;
      border: 3px solid white;
      box-shadow: 0 0 0 1000px rgba(0, 0, 0, 0.4);
    }

    .size-group {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 1.5em 0;
    }

    .size-controls {
      display: flex;
      align-items: center;
      gap: 20px;
      width: 100%;
      max-width: 500px;
      margin: 0.5em auto;
    }

    .size-slider {
      flex: 1;
      height: 8px;
      border-radius: 4px;
      background: var(--light-gray);
      outline: none;
      -webkit-appearance: none;
    }

    .size-slider::-webkit-slider-thumb {
      -webkit-appearance: none;
      width: 22px;
      height: 22px;
      border-radius: 50%;
      background: var(--primary);
      cursor: pointer;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
      transition: var(--transition);
    }

    .size-slider::-webkit-slider-thumb:hover {
      transform: scale(1.2);
    }

    .size-value {
      min-width: 80px;
      text-align: center;
      font-weight: 600;
      font-size: 1.1rem;
      color: var(--primary);
    }

    .border-controls {
      display: flex;
      justify-content: center;
      gap: 25px;
      margin: 1.5em 0;
      flex-wrap: wrap;
    }

    .border-control {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 8px;
      flex: 1;
      max-width: 200px;
    }

    .border-control label {
      font-weight: 500;
      color: var(--dark);
    }

    .border-control input[type="range"] {
      width: 100%;
    }

    .border-control input[type="color"] {
      width: 60px;
      height: 60px;
      padding: 5px;
      cursor: pointer;
      border-radius: 12px;
      border: 2px solid var(--light-gray);
      box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    }

    .border-control input[type="color"]::-webkit-color-swatch {
      border: none;
      border-radius: 8px;
    }

    .file-upload-container {
      position: relative;
      width: 100%;
      margin: 1.5em auto;
    }

    .file-upload-label {
      display: block;
      padding: 25px;
      background: #fafbff;
      border: 2px dashed var(--light-gray);
      border-radius: var(--border-radius);
      cursor: pointer;
      transition: var(--transition);
      text-align: center;
    }

    .file-upload-label:hover {
      border-color: var(--primary);
      background: #f0f4ff;
    }

    .file-upload-label i {
      color: var(--primary);
      font-size: 2.5rem;
      margin-bottom: 15px;
    }

    .file-upload-input {
      position: absolute;
      width: 100%;
      height: 100%;
      top: 0;
      left: 0;
      opacity: 0;
      cursor: pointer;
    }

    .visually-hidden {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      border: 0;
    }

    /* UPDATED: Features grid - 2 cards per row */
    .features {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 20px;
      margin: 30px 0;
    }

    .feature {
      background: var(--light);
      border-radius: var(--border-radius);
      padding: 25px;
      text-align: center;
      box-shadow: var(--box-shadow);
      transition: var(--transition);
    }

    .feature:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    }

    .feature i {
      font-size: 2.5rem;
      margin-bottom: 15px;
      color: var(--primary);
    }

    .sister-tools-section {
      margin: 40px auto;
      text-align: center;
    }

    .sister-tools-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr); /* Force 2 columns */
      gap: 25px;
      margin-top: 25px;
    }

    .sister-tool {
      background: var(--light);
      border-radius: var(--border-radius);
      padding: 25px;
      text-align: center;
      box-shadow: var(--box-shadow);
      transition: var(--transition);
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .sister-tool:hover {
      transform: translateY(-5px);
      box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    }

    .sister-tool i {
      font-size: 2.5rem;
      color: var(--primary);
      margin-bottom: 20px;
      background: #f0f4ff;
      width: 80px;
      height: 80px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      margin: 0 auto 20px;
    }

    .sister-tool h3 {
      font-size: 1.4rem;
      margin-bottom: 15px;
      color: var(--dark);
    }

    .sister-tool p {
      margin-bottom: 20px;
      color: var(--gray);
      flex-grow: 1;
    }

    .sister-tool-btn {
      display: inline-block;
      background: var(--primary);
      color: white;
      padding: 12px 25px;
      border-radius: 50px;
      text-decoration: none;
      font-weight: 600;
      transition: var(--transition);
      margin-top: auto;
      align-self: center;
    }

    .sister-tool-btn:hover {
      background: var(--primary-dark);
      transform: translateY(-3px);
      box-shadow: 0 4px 15px rgba(67, 97, 238, 0.3);
    }

    .guide-section {
      background: var(--light);
      border-radius: var(--border-radius);
      padding: 40px;
      margin: 40px auto;
      box-shadow: var(--box-shadow);
      text-align: center;
    }

    .guide-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 30px;
      margin-top: 25px;
    }

    .guide-item {
      padding: 25px;
      background: #f8f9ff;
      border-radius: var(--border-radius);
      text-align: center;
      font-size: 14px;
    }

    .guide-item h3 {
      font-size: 1.5rem;
      margin-bottom: 15px;
      color: var(--primary);
      display: flex;
      align-items: center;
      gap: 10px;
      justify-content: center;
    }

    .guide-item h3 i {
      font-size: 1.8rem;
    }

    .guide-item p {
      font-size: 1rem;
      color: var(--gray);
    }

    .uses-section {
      background: linear-gradient(135deg, #4361ee, #7209b7);
      color: white;
      border-radius: var(--border-radius);
      padding: 40px;
      margin: 40px auto;
      box-shadow: var(--box-shadow);
      text-align: center;
    }

    /* UPDATED: Ensure text and icons are pure white */
    .uses-section h2,
    .uses-section p {
      color: white !important;
    }

    .uses-section h2 i {
      color: white !important;
    }

    .uses-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
      gap: 20px;
      margin-top: 25px;
    }

    .use-item {
      background: rgba(255, 255, 255, 0.1);
      border-radius: var(--border-radius);
      padding: 25px;
      text-align: center;
      backdrop-filter: blur(5px);
    }

    .use-item i {
      font-size: 2.5rem;
      margin-bottom: 20px;
      color: white !important;
    }

    .use-item h3 {
      font-size: 1.3rem;
      margin-bottom: 15px;
      color: white !important;
    }

    .use-item p {
      color: rgba(255, 255, 255, 0.9) !important;
    }

    .creator-credit {
      font-weight: 500;
      color: var(--dark);
      font-size: 1rem;
    }

    .qr-type-fields {
      display: none;
      margin: 1em 0;
    }

    .qr-type-fields.active {
      display: block;
    }

    .input-type-toggle {
      display: flex;
      gap: 15px;
      margin: 20px 0;
      justify-content: center;
    }

    .input-type-toggle label {
      display: flex;
      align-items: center;
      gap: 8px;
      cursor: pointer;
      padding: 10px 20px;
      background: var(--light-gray);
      border-radius: 50px;
      transition: var(--transition);
    }

    .input-type-toggle label.active {
      background: var(--primary);
      color: white;
    }

    .input-type-toggle input[type="radio"] {
      display: none;
    }

    .range-controls {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 15px;
      margin: 20px 0;
    }

    .border-preview {
      position: relative;
      width: 120px;
      height: 120px;
      margin: 0 auto;
      border-radius: 12px;
      background: var(--light);
      display: flex;
      align-items: center;
      justify-content: center;
      overflow: hidden;
      border: 1px solid var(--light-gray);
    }

    .border-preview .logo-placeholder {
      width: 70%;
      height: 70%;
      background: #4361ee;
      border-radius: 8px;
    }

    .border-preview .border-indicator {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      border: 0px solid #000;
      box-sizing: border-box;
      pointer-events: none;
    }

    .border-note {
      font-size: 0.85rem;
      color: var(--gray);
      text-align: center;
      margin-top: 10px;
      font-style: italic;
    }

    .border-active {
      background: rgba(67, 97, 238, 0.05);
      border: 2px dashed var(--primary);
    }

    .toggle-container {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 15px;
      margin: 1em 0;
      padding: 10px;
      border-radius: 50px;
      background: #f0f4ff;
      max-width: 300px;
      margin-left: auto;
      margin-right: auto;
    }

    .toggle-label {
      font-weight: 500;
      color: var(--dark);
      font-size: 1rem;
    }

    .toggle-switch-visual {
      position: relative;
      display: inline-block;
      width: 60px;
      height: 30px;
    }

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

    .toggle-slider {
      position: absolute;
      cursor: pointer;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background-color: #ccc;
      transition: .4s;
      border-radius: 34px;
    }

    .toggle-slider:before {
      position: absolute;
      content: "";
      height: 22px;
      width: 22px;
      left: 4px;
      bottom: 4px;
      background-color: white;
      transition: .4s;
      border-radius: 50%;
    }

    input:checked + .toggle-slider {
      background-color: var(--primary);
    }

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

    .everytool-card {
      grid-column: 1 / -1;
      display: flex;
      flex-direction: row;
      align-items: center;
      gap: 25px;
      padding: 30px;
      text-align: left;
      background: linear-gradient(135deg, #4361ee, #7209b7);
      color: white;
    }

    .everytool-card i {
      font-size: 4rem;
      color: white;
      background: rgba(255, 255, 255, 0.15);
      width: 100px;
      height: 100px;
      display: flex;
      align-items: center;
      justify-content: center;
      border-radius: 50%;
      margin: 0;
    }

    .everytool-content {
      flex: 1;
    }

    .everytool-card h3 {
      font-size: 1.8rem;
      color: white;
      margin-bottom: 10px;
      justify-content: flex-start;
    }

    .everytool-card p {
      margin-bottom: 20px;
      font-size: 1.1rem;
      opacity: 0.9;
      font-weight: bold;
      color: white;
    }

    .everytool-btn {
      display: inline-block;
      background: white;
      color: var(--primary);
      padding: 12px 25px;
      border-radius: 50px;
      text-decoration: none;
      font-weight: 600;
      transition: var(--transition);
    }

    .everytool-btn:hover {
      background: rgba(255, 255, 255, 0.9);
      transform: translateY(-3px);
      box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }

    .logo-options-container {
      margin: 1.5em 0;
      border: 1px solid var(--light-gray);
      border-radius: var(--border-radius);
      padding: 20px;
      background: #fafbff;
    }

    .logo-options-header {
      display: flex;
      align-items: center;
      gap: 10px;
      margin-bottom: 15px;
      justify-content: center;
    }

    .logo-options-header i {
      color: var(--primary);
      font-size: 1.5rem;
    }

    .logo-options-content {
      display: flex;
      flex-wrap: wrap;
      gap: 20px;
      justify-content: center;
    }

    .logo-upload-container {
      flex: 1;
      min-width: 300px;
    }

    .border-controls-container {
      flex: 1;
      min-width: 300px;
    }

    /* New scanner status styles */
    .scanner-status {
      position: absolute;
      top: 10px;
      left: 0;
      width: 100%;
      text-align: center;
      color: white;
      font-weight: bold;
      text-shadow: 0 1px 3px rgba(0,0,0,0.8);
      z-index: 10;
    }

    .scanner-success {
      color: #4ade80;
    }

    .scanner-error {
      color: #f87171;
    }

    .scanner-loading {
      color: #60a5fa;
    }

    .scanner-guides {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      pointer-events: none;
    }

    .guide-line {
      position: absolute;
      background: rgba(255, 255, 255, 0.5);
    }

    .guide-line.horizontal {
      width: 100%;
      height: 1px;
      left: 0;
    }

    .guide-line.vertical {
      width: 1px;
      height: 100%;
      top: 0;
    }

    /* Button group for better alignment */
    .btn-group {
      display: flex;
      gap: 15px;
      justify-content: center;
      margin: 20px 0;
      flex-wrap: wrap;
    }

    .btn-group button {
      width: auto;
      min-width: 200px;
    }

    /* Scan result styling */
    .scan-result {
      background: var(--light);
      border-radius: var(--border-radius);
      padding: 20px;
      margin-top: 20px;
      text-align: center;
      border-left: 4px solid var(--primary);
    }

    /* Responsive adjustments */
    @media (max-width: 992px) {
      .features {
        grid-template-columns: repeat(2, 1fr);
      }
      
      .guide-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 768px) {
      .card {
        padding: 20px;
      }
      
      h1 {
        font-size: 2rem;
      }
      
      h2 {
        font-size: 1.5rem;
      }
      
      .color-group {
        flex-direction: column;
        align-items: center;
      }
      
      .border-controls {
        flex-direction: column;
        align-items: center;
      }
      
      .btn-group {
        flex-direction: column;
      }
      
      .btn-group button {
        width: 100%;
      }
      
      .scanner-container {
        height: 280px;
      }
      
      .tab {
        padding: 10px 15px;
        font-size: 0.9rem;
      }
      
      .guide-section, .uses-section {
        padding: 25px;
      }
      
      .guide-grid {
        grid-template-columns: 1fr;
      }
      
      .guide-item {
        min-width: 280px;
      }
      
      .uses-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      }
      
      .input-type-toggle {
        flex-direction: column;
        gap: 8px;
      }
      
      .input-type-toggle label {
        width: 100%;
        justify-content: center;
      }
      
      .everytool-card {
        flex-direction: column;
        text-align: center;
      }
      
      .logo-options-content {
        flex-direction: column;
      }
      
      .features {
        grid-template-columns: 1fr;
      }

      .sister-tools-grid {
        grid-template-columns: 1fr;
      }
    }

    @media (max-width: 480px) {
      body {
        padding: 15px;
      }
      
      header {
        padding: 20px 0 10px;
      }
      
      .logo {
        font-size: 2.2rem;
      }
      
      h1 {
        font-size: 1.8rem;
      }
      
      .guide-grid {
        grid-template-columns: 1fr;
      }
      
      .guide-item {
        min-width: 100%;
      }
      
      .range-controls {
        grid-template-columns: 1fr;
      }
    }
  
#qr-input:invalid {
    border-color: #ff4757;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.2);
}

#qr-input:focus:invalid {
    border-color: #ff4757;
    box-shadow: 0 0 0 2px rgba(255, 71, 87, 0.2);
}

.required {
    color: #ff4757;
}