/* Captchadly Unified Styles */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, -apple-system, Arial, sans-serif;
  background: #f6f7fb;
  margin: 0;
  padding: 0;
  line-height: 1.6;
  color: #1f2937;
}

/* ===================
   DASHBOARD LAYOUT
   =================== */

.dashboard-container {
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: 260px;
  background: #1f2937;
  color: white;
  padding: 20px 0;
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
}

.sidebar-header {
  padding: 0 20px 20px;
  border-bottom: 1px solid #374151;
  margin-bottom: 20px;
}

.sidebar-header h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0;
  color: #60a5fa;
}

.sidebar-menu {
  list-style: none;
  padding: 0;
  margin: 0;
}

.sidebar-menu li {
  margin: 0;
}

.sidebar-menu a {
  display: flex;
  align-items: center;
  padding: 15px 20px;
  color: #d1d5db;
  text-decoration: none;
  transition: all 0.3s;
  gap: 12px;
}

.sidebar-menu a:hover {
  background: #374151;
  color: white;
}

.sidebar-menu a.active {
  background: #2563eb;
  color: white;
}

.sidebar-menu .icon {
  font-size: 18px;
  width: 20px;
  text-align: center;
}

/* Main Content */
.main-content {
  margin-left: 260px;
  padding: 20px;
  flex: 1;
  min-height: 100vh;
}

.page-header {
  background: white;
  padding: 25px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
}

.page-header h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px 0;
  color: #1f2937;
}

.page-header p {
  color: #6b7280;
  margin: 0;
  font-size: 16px;
}

/* Dashboard Header (for dashboard-home) */
.dashboard-header {
  background: white;
  padding: 20px 30px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.dashboard-title h1 {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
  color: #1f2937;
}

.dashboard-title p {
  color: #6b7280;
  margin: 5px 0 0;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.user-avatar {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 600;
}

.logout-btn {
  background: #ef4444;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s;
}

.logout-btn:hover {
  background: #dc2626;
}

/* ===================
   CONTENT CONTAINERS
   =================== */

.content-card {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  margin-bottom: 20px;
}

.demo-container {
  background: white;
  padding: 50px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  max-width: 900px;
  margin: 0 auto;
}

.admin-container {
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* ===================
   FORM STYLES
   =================== */

/* Demo Form - Two Column Layout */
.demo-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  align-items: start;
}

.form-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 8px;
  font-weight: 600;
  color: #374151;
  font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 10px;
  font-size: 16px;
  transition: all 0.3s ease;
  font-family: inherit;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Single Column Forms */
.single-form {
  max-width: 500px;
  margin: 0 auto;
}

.single-form .form-group {
  margin-bottom: 20px;
}

/* File Upload */
.file-upload {
  position: relative;
  display: inline-block;
  cursor: pointer;
  width: 100%;
}

.file-upload input[type="file"] {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.file-upload-label {
  display: block;
  padding: 12px 16px;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  transition: all 0.3s;
}

.file-upload:hover .file-upload-label {
  border-color: #2563eb;
  background: #eff6ff;
  color: #2563eb;
}

.file-preview {
  margin-top: 15px;
  text-align: center;
}

.file-preview img {
  max-width: 200px;
  max-height: 100px;
  border-radius: 8px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* ===================
   CAPTCHA STYLES
   =================== */

.captcha-section {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  padding: 40px;
  border-radius: 20px;
  border: 2px solid #e2e8f0;
  margin: 30px 0;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.captcha-section.grid-full {
  grid-column: 1 / -1;
}

.captcha-header {
  margin-bottom: 30px;
}

.captcha-header h3 {
  color: #475569;
  font-weight: 700;
  font-size: 20px;
  margin: 0 0 10px 0;
}

.captcha-header p {
  color: #64748b;
  font-size: 16px;
  margin: 0;
}

#bannerWrapper {
  position: relative;
  width: 300px;
  height: 120px;
  border-radius: 15px;
  overflow: hidden;
  margin: 0 auto;
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
  background: white;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

canvas {
  display: block;
  width: 300px;
  height: 120px;
  border-radius: 15px;
}

#movable {
  position: absolute;
  width: 48px;
  height: 48px;
  border-radius: 10px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.25);
  cursor: grab;
  z-index: 20;
  background-size: cover;
  background-position: center;
  touch-action: none;
  transition: all 0.1s ease;
  border: 3px solid white;
}

#movable:active {
  cursor: grabbing;
  transform: scale(1.05);
}

#controls {
  margin-top: 25px;
  display: flex;
  justify-content: center;
  gap: 15px;
  flex-wrap: wrap;
}

#controls button {
  width: 50px;
  height: 50px;
  padding: 0;
  font-size: 18px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

#controls button:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.4);
}

#controls button:active {
  transform: translateY(-1px);
}

#submitCaptcha {
  background: linear-gradient(135deg, #10b981, #059669) !important;
  width: 120px !important;
  border-radius: 25px !important;
  font-size: 16px !important;
}

#result {
  height: 40px;
  margin-top: 20px;
  font-weight: 600;
  text-align: center;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===================
   BUTTONS
   =================== */

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.3);
}

.btn-success {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-success:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(16, 185, 129, 0.3);
}

.btn-secondary {
  background: #6b7280;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-secondary:hover {
  background: #4b5563;
  transform: translateY(-1px);
}

.btn-danger {
  background: #ef4444;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-danger:hover {
  background: #dc2626;
  transform: translateY(-1px);
}

button:disabled,
.btn-primary:disabled,
.btn-success:disabled {
  background: linear-gradient(135deg, #9ca3af, #6b7280) !important;
  cursor: not-allowed !important;
  transform: none !important;
  box-shadow: none !important;
}

.submit-btn {
  width: 100%;
  padding: 18px;
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  border: none;
  border-radius: 15px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-top: 30px;
}

.submit-btn.grid-full {
  grid-column: 1 / -1;
}

/* ===================
   STATS & CARDS
   =================== */

.stats-grid,
.overview-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.stat-card,
.overview-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s;
}

.stat-card:hover,
.overview-card:hover {
  transform: translateY(-2px);
}

.overview-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.overview-card h3,
.stat-card h3 {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.overview-card .icon,
.stat-card .icon {
  font-size: 24px;
}

.stat-number,
.overview-value {
  font-size: 2em;
  font-weight: 700;
  color: #2563eb;
  margin-bottom: 5px;
}

.stat-label {
  color: #666;
  font-size: 14px;
}

.overview-change {
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.overview-change.positive {
  color: #10b981;
}

.overview-change.negative {
  color: #ef4444;
}

/* ===================
   BANNER MANAGEMENT
   =================== */

.banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.banner-item {
  background: white;
  border-radius: 15px;
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  transition: transform 0.2s ease;
  border: 2px solid #f3f4f6;
}

.banner-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.banner-preview {
  width: 100%;
  height: 120px;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 15px;
  border: 1px solid #e5e7eb;
}

.banner-info h4 {
  margin: 0 0 8px 0;
  font-weight: 600;
  color: #1f2937;
  font-size: 16px;
}

.banner-info p {
  color: #6b7280;
  margin: 0 0 4px 0;
  font-size: 14px;
}

.banner-stats {
  display: flex;
  justify-content: space-between;
  color: #6b7280;
  font-size: 12px;
  margin-top: 15px;
  padding-top: 15px;
  border-top: 1px solid #f3f4f6;
}

.banner-actions {
  margin-top: 15px;
  display: flex;
  gap: 10px;
}

.banner-actions button {
  padding: 8px 15px;
  font-size: 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s;
}

/* Device type indicators */
.device-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
}

.device-badge.desktop {
  background: #dbeafe;
  color: #1e40af;
}

.device-badge.mobile {
  background: #dcfce7;
  color: #166534;
}

/* ===================
   CHARTS
   =================== */

.chart-container {
  width: 100%;
  margin: 30px 0;
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chart-card {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.chart-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 20px 0;
  color: #1f2937;
}

.charts-section {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
  margin-bottom: 30px;
}

/* ===================
   TABLES
   =================== */

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 20px;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

th, td {
  padding: 12px 15px;
  text-align: left;
  border-bottom: 1px solid #f3f4f6;
}

th {
  background: #f8fafc;
  color: #374151;
  font-weight: 600;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

tr:hover {
  background: #f8fafc;
}

/* ===================
   MESSAGES & ALERTS
   =================== */

.instructions {
  background: linear-gradient(135deg, #fef3c7, #fde68a);
  border: 2px solid #f59e0b;
  border-radius: 15px;
  padding: 25px;
  margin-bottom: 40px;
}

.instructions h3 {
  color: #92400e;
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 700;
}

.instructions ul {
  color: #78350f;
  margin: 0;
  padding-left: 20px;
  line-height: 1.6;
}

.instructions li {
  margin-bottom: 8px;
  font-size: 14px;
}

.success-message {
  background: linear-gradient(135deg, #d1fae5, #a7f3d0);
  border: 2px solid #10b981;
  color: #065f46;
  padding: 25px;
  border-radius: 15px;
  margin-top: 25px;
  text-align: center;
  font-weight: 600;
  font-size: 16px;
  display: none;
}

.success-message.grid-full {
  grid-column: 1 / -1;
}

.error-message {
  background: #fef2f2;
  color: #991b1b;
  padding: 15px;
  border-radius: 8px;
  margin-top: 15px;
  text-align: center;
  font-weight: 500;
  display: none;
  border: 1px solid #fecaca;
}

.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  padding: 30px;
  border-radius: 15px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  max-width: 500px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal h3 {
  margin: 0 0 20px 0;
  color: #1f2937;
  font-size: 20px;
  font-weight: 700;
}

/* ===================
   ACTIVITY FEED
   =================== */

.recent-activity {
  background: white;
  padding: 25px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.activity-item {
  display: flex;
  align-items: center;
  padding: 15px 0;
  border-bottom: 1px solid #f3f4f6;
  gap: 15px;
}

.activity-item:last-child {
  border-bottom: none;
}

.activity-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: white;
}

.activity-icon.success {
  background: #10b981;
}

.activity-icon.info {
  background: #2563eb;
}

.activity-icon.warning {
  background: #f59e0b;
}

.activity-content {
  flex: 1;
}

.activity-title {
  font-weight: 600;
  color: #1f2937;
  margin: 0 0 5px 0;
}

.activity-time {
  font-size: 14px;
  color: #6b7280;
  margin: 0;
}

/* ===================
   QUICK ACTIONS
   =================== */

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 15px;
  margin-bottom: 30px;
}

.quick-action {
  background: white;
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  text-align: center;
  text-decoration: none;
  color: #1f2937;
  transition: all 0.3s;
}

.quick-action:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.quick-action .icon {
  font-size: 32px;
  margin-bottom: 10px;
  display: block;
}

.quick-action h4 {
  margin: 0 0 5px 0;
  font-size: 16px;
  font-weight: 600;
}

.quick-action p {
  margin: 0;
  font-size: 14px;
  color: #6b7280;
}

/* ===================
   RESPONSIVE DESIGN
   =================== */

@media (max-width: 1024px) {
  .demo-form {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .demo-container {
    padding: 30px;
  }
  
  .charts-section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  
  .sidebar.open {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
    padding: 15px;
  }
  
  .demo-container,
  .admin-container {
    margin: 0 10px;
    padding: 25px;
  }
  
  .dashboard-header,
  .page-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
    padding: 20px;
  }
  
  .demo-title {
    font-size: 24px;
  }
  
  .demo-subtitle {
    font-size: 16px;
  }
  
  /* MOBILE SQUARE BANNER SUPPORT - 320x320px */
  #bannerWrapper {
    width: 320px;
    height: 320px; /* Square format for mobile */
  }
  
  canvas {
    width: 320px !important;
    height: 320px !important; /* Square format for mobile */
  }
  
  /* Larger puzzle piece for mobile square banners */
  #movable {
    width: 60px !important;
    height: 60px !important;
  }
  
  /* More spacing for square banner controls */
  #controls {
    margin-top: 30px;
    gap: 12px;
  }
  
  /* Larger control buttons for mobile */
  #controls button {
    width: 50px;
    height: 50px;
    font-size: 18px;
  }
  
  /* Adjusted submit captcha button */
  #submitCaptcha {
    width: 120px !important;
    font-size: 16px !important;
    padding: 0 20px !important;
  }
  
  /* Captcha section padding adjustment for square banners */
  .captcha-section {
    padding: 30px 20px;
  }
  
  /* Result message positioning */
  #result {
    height: 40px;
    margin-top: 25px;
  }
  
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }
  
  .banner-grid {
    grid-template-columns: 1fr;
  }
  
  /* Banner preview adjustments for mobile */
  .banner-preview {
    max-width: 100%;
    height: auto;
  }
  
  .banner-item[data-device="Mobile"] .banner-preview,
  .banner-item[data-device="mobile"] .banner-preview {
    aspect-ratio: 1 / 1; /* Square aspect ratio for mobile previews */
  }
  
  .banner-item[data-device="Desktop"] .banner-preview,
  .banner-item[data-device="desktop"] .banner-preview {
    aspect-ratio: 300 / 120; /* Rectangle aspect ratio for desktop */
  }
  
  /* Demo form adjustments for square mobile captcha */
  .demo-form {
    grid-template-columns: 1fr;
  }
  
  .captcha-section.grid-full {
    grid-column: 1;
  }
}

/* Extra small devices (phones < 400px) */
@media (max-width: 400px) {
  #bannerWrapper {
    width: 280px;
    height: 280px;
  }
  
  canvas {
    width: 280px !important;
    height: 280px !important;
  }
  
  #movable {
    width: 55px !important;
    height: 55px !important;
  }
  
  #controls {
    gap: 10px;
  }
  
  #controls button {
    width: 45px;
    height: 45px;
    font-size: 16px;
  }
  
  #submitCaptcha {
    width: 100px !important;
    font-size: 14px !important;
  }
}

/* Very small devices (phones < 360px) */
@media (max-width: 360px) {
  #bannerWrapper {
    width: 260px;
    height: 260px;
  }
  
  canvas {
    width: 260px !important;
    height: 260px !important;
  }
  
  #movable {
    width: 50px !important;
    height: 50px !important;
  }
  
  #controls {
    gap: 8px;
  }
  
  #controls button {
    width: 40px;
    height: 40px;
    font-size: 14px;
  }
  
  #submitCaptcha {
    width: 90px !important;
    font-size: 13px !important;
  }
}

/* ===================
   CAPTCHADLY STANDALONE WIDGET
   =================== */

/* Captchadly widget mobile adjustments */
.captchadly-widget {
  background: linear-gradient(135deg, #f8fafc, #e2e8f0);
  padding: 25px;
  border-radius: 15px;
  border: 2px solid #e2e8f0;
  margin: 20px 0;
  text-align: center;
  font-family: system-ui, -apple-system, sans-serif;
}

.captchadly-canvas-wrapper {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  margin: 20px auto;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  background: white;
  flex-shrink: 0;
  transition: all 0.3s ease;
}

@media (max-width: 768px) {
  .captchadly-canvas-wrapper {
    width: 320px !important;
    height: 320px !important;
  }
  
  .captchadly-canvas {
    width: 320px !important;
    height: 320px !important;
  }
  
  .captchadly-piece {
    width: 60px !important;
    height: 60px !important;
  }
  
  .captchadly-controls {
    gap: 15px !important;
    margin-top: 25px !important;
  }
  
  .captchadly-btn {
    width: 50px !important;
    height: 50px !important;
    font-size: 16px !important;
  }
  
  .captchadly-check {
    width: 120px !important;
    font-size: 16px !important;
  }
}

@media (max-width: 400px) {
  .captchadly-canvas-wrapper {
    width: 280px !important;
    height: 280px !important;
  }
  
  .captchadly-canvas {
    width: 280px !important;
    height: 280px !important;
  }
  
  .captchadly-piece {
    width: 55px !important;
    height: 55px !important;
  }
  
  .captchadly-btn {
    width: 45px !important;
    height: 45px !important;
    font-size: 14px !important;
  }
  
  .captchadly-check {
    width: 100px !important;
    font-size: 14px !important;
  }
}

@media (max-width: 360px) {
  .captchadly-canvas-wrapper {
    width: 260px !important;
    height: 260px !important;
  }
  
  .captchadly-canvas {
    width: 260px !important;
    height: 260px !important;
  }
  
  .captchadly-piece {
    width: 50px !important;
    height: 50px !important;
  }
  
  .captchadly-controls {
    gap: 8px !important;
  }
  
  .captchadly-btn {
    width: 40px !important;
    height: 40px !important;
    font-size: 14px !important;
  }
  
  .captchadly-check {
    width: 90px !important;
    font-size: 13px !important;
  }
}

/* Platform toggle button adjustments for mobile */
.platform-toggle {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.platform-btn {
  padding: 12px 24px;
  border: 2px solid #e5e7eb;
  background: white;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  color: #6b7280;
  transition: all 0.3s;
}

.platform-btn.active,
.platform-btn:hover {
  background: #2563eb;
  color: white;
  border-color: #2563eb;
}

@media (max-width: 768px) {
  .platform-toggle {
    flex-direction: column;
    width: 100%;
  }
  
  .platform-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ===================
   UTILITIES
   =================== */

.text-center {
  text-align: center;
}

.mt-20 {
  margin-top: 20px;
}

.mb-20 {
  margin-bottom: 20px;
}

.p-20 {
  padding: 20px;
}

.hidden {
  display: none !important;
}

.flex {
  display: flex;
}

.flex-center {
  display: flex;
  justify-content: center;
  align-items: center;
}

.flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.gap-10 {
  gap: 10px;
}

.gap-20 {
  gap: 20px;
}

/* Loading States */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading-spinner {
  display: none;
  width: 20px;
  height: 20px;
  border: 2px solid #ffffff;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-right: 8px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading .loading-spinner {
  display: inline-block;
}

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

.fade-in {
  animation: fadeIn 0.3s ease-in;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

.pulse {
  animation: pulse 2s infinite;
}

/* Form Validation */
.form-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.error-text {
  color: #ef4444;
  font-size: 12px;
  margin-top: 4px;
}

.success {
  color: #0b7a3f;
}

.error {
  color: #b91c1c;
}

/* Code Block */
pre {
  background: #111;
  color: #0f0;
  padding: 15px;
  border-radius: 10px;
  overflow-x: auto;
  text-align: left;
  font-family: 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.4;
}

/* Partner Code Display */
.partner-code {
  background: #f8fafc;
  border: 2px solid #e2e8f0;
  border-radius: 12px;
  padding: 20px;
  margin: 20px 0;
}

.partner-code h3 {
  color: #374151;
  margin: 0 0 15px 0;
  font-size: 16px;
  font-weight: 600;
}

.partner-code pre {
  background: #1f2937;
  color: #d1d5db;
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
}

.copy-button {
  background: #10b981;
  color: white;
  border: none;
  padding: 8px 16px;
  border-radius: 6px;
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
  transition: all 0.3s;
}

.copy-button:hover {
  background: #059669;
}

/* Integration Status */
.integration-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 15px 0;
}

.status-indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
}

.status-indicator.active {
  background: #10b981;
}

.status-indicator.inactive {
  background: #ef4444;
}

.status-indicator.pending {
  background: #f59e0b;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 1001;
  background: #2563eb;
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: block;
  }
}

/* ===================
   ADDITIONAL MOBILE OPTIMIZATIONS
   =================== */

/* Ensure proper aspect ratio is maintained */
@media (max-width: 768px) {
  #bannerWrapper,
  .captchadly-canvas-wrapper {
    aspect-ratio: 1 / 1; /* Square for mobile */
  }
}

/* Touch-friendly adjustments */
@media (hover: none) and (pointer: coarse) {
  /* Larger touch targets for mobile */
  #controls button,
  .captchadly-btn {
    min-width: 48px;
    min-height: 48px;
  }
  
  /* Better touch feedback */
  #movable,
  .captchadly-piece {
    cursor: grab;
  }
  
  #movable:active,
  .captchadly-piece:active {
    cursor: grabbing;
    transform: scale(1.1);
  }
}

/* Landscape mobile adjustments */
@media (max-width: 768px) and (orientation: landscape) {
  #bannerWrapper,
  .captchadly-canvas-wrapper {
    width: 280px;
    height: 280px;
  }
  
  canvas,
  .captchadly-canvas {
    width: 280px !important;
    height: 280px !important;
  }
  
  .captcha-section {
    padding: 20px;
  }
  
  #controls,
  .captchadly-controls {
    margin-top: 20px;
    gap: 10px;
  }
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  canvas,
  .captchadly-canvas {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
  /* Add dark mode styles here if needed */
}

/* DODAJ TO NA KONIEC TWOJEGO styles.css */

/* ===================
   MOBILE PUZZLE FIX - RESPONSYWNE PROPORCJE
   =================== */

/* Override dla mobile - kwadratowy banner z proporcjonalnym puzzlem */
@media (max-width: 768px) {
  /* Banner wrapper - kwadrat */
  #bannerWrapper {
    width: 320px !important;
    height: 320px !important;
    aspect-ratio: 1 / 1;
  }
  
  /* Canvas - kwadrat */
  canvas {
    width: 320px !important;
    height: 320px !important;
    object-fit: cover; /* WAŻNE: zachowuje proporcje obrazka */
  }
  
  /* Puzzle piece - proporcjonalnie większy dla kwadratu */
  #movable {
    width: 64px !important;
    height: 64px !important;
  }
  
  /* Captchadly widget - jeśli używasz */
  .captchadly-canvas-wrapper {
    width: 320px !important;
    height: 320px !important;
    aspect-ratio: 1 / 1;
  }
  
  .captchadly-canvas {
    width: 320px !important;
    height: 320px !important;
    object-fit: cover;
  }
  
  .captchadly-piece {
    width: 64px !important;
    height: 64px !important;
  }
}

/* Średnie telefony */
@media (max-width: 400px) {
  #bannerWrapper,
  .captchadly-canvas-wrapper {
    width: 280px !important;
    height: 280px !important;
  }
  
  canvas,
  .captchadly-canvas {
    width: 280px !important;
    height: 280px !important;
  }
  
  #movable,
  .captchadly-piece {
    width: 56px !important;
    height: 56px !important;
  }
}

/* Małe telefony */
@media (max-width: 360px) {
  #bannerWrapper,
  .captchadly-canvas-wrapper {
    width: 260px !important;
    height: 260px !important;
  }
  
  canvas,
  .captchadly-canvas {
    width: 260px !important;
    height: 260px !important;
  }
  
  #movable,
  .captchadly-piece {
    width: 52px !important;
    height: 52px !important;
  }
}

/* Landscape na mobile */
@media (max-width: 768px) and (orientation: landscape) {
  #bannerWrapper,
  .captchadly-canvas-wrapper {
    width: 280px !important;
    height: 280px !important;
  }
  
  canvas,
  .captchadly-canvas {
    width: 280px !important;
    height: 280px !important;
  }
}

/* Desktop - zachowaj prostokąt */
@media (min-width: 769px) {
  #bannerWrapper {
    width: 300px !important;
    height: 120px !important;
    aspect-ratio: 300 / 120;
  }
  
  canvas {
    width: 300px !important;
    height: 120px !important;
  }
  
  #movable {
    width: 48px !important;
    height: 48px !important;
  }
}

/* FORCE SQUARE ON MOBILE - OVERRIDE WSZYSTKICH INNYCH REGUŁ */
@media (max-width: 768px) {
    #bannerWrapper,
    .captchadly-canvas-wrapper {
        width: 320px !important;
        height: 320px !important;
        max-width: 320px !important;
        max-height: 320px !important;
    }
    
    canvas,
    .captchadly-canvas {
        width: 320px !important;
        height: 320px !important;
        max-width: 320px !important;
        max-height: 320px !important;
    }
}

/* DODAJ TO NA KOŃCU styles.css */
@media (max-width: 768px) {
    #bannerWrapper,
    .captchadly-canvas-wrapper {
        width: 320px !important;
        height: 320px !important;
    }
    
    canvas,
    .captchadly-canvas {
        width: 320px !important;
        height: 320px !important;
    }
    
  
}

@media (max-width: 400px) {
    #bannerWrapper,
    .captchadly-canvas-wrapper {
        width: 280px !important;
        height: 280px !important;
    }
    
    canvas,
    .captchadly-canvas {
        width: 280px !important;
        height: 280px !important;
    }
    
    
}

@media (max-width: 360px) {
    #bannerWrapper,
    .captchadly-canvas-wrapper {
        width: 260px !important;
        height: 260px !important;
    }
    
    canvas,
    .captchadly-canvas {
        width: 260px !important;
        height: 260px !important;
    }
    
    #movable,
    .captchadly-piece {
        width: 65px !important;
        height: 65px !important;
    }
}