/* =========================================
   APPLET VIEWER LAYOUT
   ========================================= */

body.applet-viewer {
  font-family: "Calibri", "Segoe UI", sans-serif;
  color: #fff;

}

/* Left panel (inputs) */
body.applet-viewer .applet-left-panel {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 300px;
  max-width: 600px;
  height: calc(100vh - 140px);
  background: #11100e;
  border: 1px solid #3f3d38;
  border-radius: 9px;
  padding: 20px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.4);
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.applet-viewer .applet-left-panel::-webkit-scrollbar {
  width: 0;
  background: transparent;
}

/* Viewer area (3D canvas) */
body.applet-viewer .applet-viewer-main {
  position: fixed;
  top: 120px;
  left: 340px;
  right: 340px;
  bottom: 20px;
  border: 1px solid #3f3d38;
  border-radius: 9px;

  overflow: hidden;
  z-index: 10;
}

#three-canvas {
  width: 100%;
  height: 100%;
  display: block;
  right:0px;
  position: absolute;
}

/* =========================================
   INPUT CONTROLS
   ========================================= */

.param-group {
  margin-bottom: 25px;
}

.param-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.param-label label {
  color: #aaa;
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 1px;
  font-weight: 500;
}

.param-value {
  color: #fff;
  font-weight: bold;
  font-size: 13px;
  background: #1a1917;
  padding: 2px 8px;
  border-radius: 4px;
}

/* Sliders */
.applet-left-panel input[type="range"] {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #3a3a3a;
  border-radius: 10px;
  outline: none;
  cursor: pointer;
}

.applet-left-panel input[type="range"]::-webkit-slider-thumb,
.applet-left-panel input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #667eea;
  border: none;
  transition: transform 0.2s ease;
}

.applet-left-panel input[type="range"]::-webkit-slider-thumb:hover,
.applet-left-panel input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
}

/* =========================================
   OUTPUTS PANEL (Scrollable)
   ========================================= */

#appletOutputPanel {
  display: block;
  transition: transform 0.3s ease-in-out;
  position: fixed;
  top: 120px;
  right: 20px;
  width: 300px;
  max-width: 600px;
  height: calc(100vh - 280px);
  background: #11100e;
  z-index: 1000;
  border-radius: 9px 9px 9px 9px;
  overflow-y: auto;
  padding: 20px;
  border: 1px solid #3f3d38;
  border-bottom: none;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#appletOutputPanel::-webkit-scrollbar {
  width: 0;
  background: transparent;
}


.outputs-section {
  padding-top: 5px;
}

.output-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #2a2a2a;
}

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

.output-label {
  color: #999;
  font-size: 12px;
}

.output-value {
  color: #fff;
  font-weight: 600;
  font-size: 12px;
}


/* Desktop: sort width controlled by sortBar container (300px - 20px padding = 280px) */
body.layout-desktop .sort {
  width: 300px;
  max-width: 300px;
}

/* Mobile Horizontal: sort should be narrower to fit half screen */
body.layout-mobile-h .sort {
  width: calc((100vw - 40px) / 2 ) !important;
  max-width: calc((100vw - 40px) / 2 ) !important;
}

/* Mobile Vertical: sort uses full width minus margins and padding */
body.layout-mobile-v .sort {
  width: calc(100vw - 40px) !important;
  max-width: calc(100vw - 40px) !important;
}

/* =========================================
   DOWNLOADS PANEL (Fixed Bottom)
   =========================================     background-color: #2b3035;*/

#appletDownloadsPanel {
  position: fixed;
  width: 300px;
  max-width: 600px;
  right: 20px;
  bottom: 20px;
  border: 1px solid #3f3d38;
  border-radius: 9px 9px 9px 9px;
  background: #11100e; 
  z-index: 1000;
  display: block;
  padding: 15px 20px 15px 20px;


    overflow-y: auto;
    scroll-behavior: smooth;
    scroll-behavior: auto !important;

}

#appletDownloadsPanel::-webkit-scrollbar
{
    width: none; /* Hide scrollbar width */
    background: transparent; /* Optional: Make the background fully transparent */
}

.download-section {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.download-price {
  font-size: 14px;
  font-weight: 600;
  width: 60px;
  text-align: right;
  color: var(--text-color, #fff);
}

.download-row .download-btn {
  width: 90px;
  height: 44px;
  display: flex;
  justify-content: center;
  align-items: center;
}

[data-bs-theme="light"] .applet-right-panel {
  background-color: snow ;
}
[data-bs-theme="light"] .applet-left-panel{
  background-color: snow ;
}


[data-bs-theme="light"] #appletDownloadsPanel,
[data-bs-theme="light"] .appletDownloadsPanel{
  background-color: snow ;
}



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

.download-btn {
  position: relative;
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  height: 70px;
  width: 70px;
  padding: 10px;
  border-radius: 9px;
  border: 1px solid #3f3d38;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  overflow: hidden;
  background: radial-gradient(#3398CC, #32332c);
}




.download-btn:hover {
  border-color: skyblue;
  background: radial-gradient(#3398CC, #32332c);
  transform: translateY(-2px);
}

.download-btn:active {
  border-color: black;
  background: radial-gradient(#eefffd, #59c9ec);
  transform: translateY(0);
}

.download-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-top {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
}

.file-icon {
  width: 20px;
  height: 20px;
  filter: brightness(1);
  transition: filter 0.3s ease;
}

.download-btn:hover .file-icon {
  filter: brightness(1.5) saturate(1.5);
}

.download-btn:active .file-icon {
  filter: brightness(0.3);
}

.file-type {
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  transition: color 0.3s ease;
  white-space: nowrap;
}

.download-btn:hover .file-type {
  color: skyblue;
}

.download-btn:active .file-type {
  color: black;
}

.btn-bottom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.btn-cost {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  transition: color 0.3s ease;
}

.download-btn:hover .btn-cost {
  color: skyblue;
}

.download-btn:active .btn-cost {
  color: black;
}
.download-price::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  bottom: 10px;
  background-image: url('/static/images/token.svg');
  background-size: contain;
  background-repeat: no-repeat;
  margin-left: 4px;
  filter: brightness(1);
    vertical-align: middle;
}

/* =========================================
   TOKEN ICON SVG
   ========================================= */

.btn-cost::after {
  content: '';
  display: inline-block;
  width: 14px;
  height: 14px;
  background-image: url('/static/images/token.svg');
  background-size: contain;
  background-repeat: no-repeat;
  margin-left: 5px;
  vertical-align: bottom;
  filter: brightness(1);
  transition: filter 0.3s ease;
}

.download-btn:hover .btn-cost::after {
  filter: brightness(1.5) saturate(1.5);
}

.download-btn:active .btn-cost::after {
  filter: brightness(0.3);
}

.token-value::after {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url('/static/images/token.svg');
  background-size: contain;
  background-repeat: no-repeat;
  margin-left: 6px;
  vertical-align: bottom;
}





/* =========================================
   TOKEN BALANCE SECTION
   ========================================= */

.token-balance {
  border-top: 1px solid #3f3d38;
  padding-top: 12px;
  margin-top: 8px;
}

.token-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding: 8px 0;
}

.token-label {
  color: #999;
  font-size: 12px;
}

.token-amount {
  color: #8ab4f8;
  font-weight: 600;
  font-size: 14px;
}

.token-value {
  font-size: 16px;
  transition: color 0.5s ease;
}

.token-btn {
  width: 100%;
  height: 38px;
  padding: 10px;
  background: #2a2a2a;
  border: 1px solid #3f3d38;
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
}

.token-btn:hover {
  border-color: skyblue;
  color: skyblue;
  background: radial-gradient(#3398CC, #32332c);
}

.token-btn:active {
  border-color: black;
  color: black;
  background: radial-gradient(#eefffd, #59c9ec);
}

.token-btn-icon {
  font-size: 16px;
  font-weight: bold;
}

/* Pulse animation for Add Tokens button */
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); background: #3398CC; }
}

/* Add this to your applet_viewer.css file */

.applet-title-overlay {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100; /* Higher than appletViewerMain */
    pointer-events: none; /* Allow clicking through to canvas */
}

.applet-title-overlay h1 {
    margin: 0;
    font-size: 3rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.15);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

@media (max-width: 768px) {
    .applet-title-overlay h1 {
        font-size: 2rem;
    }
}
[data-bs-theme="dark"] .token-btn, 
[data-bs-theme="dark"] .download-btn {
  background: radial-gradient(#070706,#302d26);
}
[data-bs-theme="light"] .token-btn ,
[data-bs-theme="light"] .download-btn {
  background: radial-gradient(#d3f2fc, skyblue);
}

[data-bs-theme="light"] .token-balance,
[data-bs-theme="light"] .token-value,
[data-bs-theme="light"] .token-amount ,
[data-bs-theme="light"] .token-label, 
[data-bs-theme="light"] .token-header,
[data-bs-theme="light"] .token-btn-icon, 
[data-bs-theme="light"] .token-btn,
[data-bs-theme="light"] .btn-cost,
[data-bs-theme="light"] .download-btn,
[data-bs-theme="light"] .file-type
{
  color: black !important;

}                  
[data-bs-theme="light"] .download-btn {
  background: rgba(255,255,255,0.7) !important;
  border-color: rgba(0,0,0,0.15) !important;
  color: black !important;
}

#smallButtonsGroup {
position: relative; 
 top: 0px;
  width: 80px;
  height: 80px;
}

#smallButtonsGroup button {
  position: absolute;
 top: -60px;
  left: 0;
}
.search-bar-container {
margin-top: 56px;
}
/* =========================================
   LOADING & ERROR
   ========================================= */

.loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 20;
}

.loading-overlay.hidden {
  display: none;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 4px solid #3a3a3a;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

.error-message {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #ff4444;
  color: white;
  padding: 12px 24px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
  z-index: 30;
  font-size: 13px;
}

.error-message.hidden {
  display: none;
}

/* =========================================
   MOBILE RESPONSIVE
   ========================================= */
/* Mobile adjustments */
@media (max-width: 640px) {
  body.applet-viewer .applet-viewer-main {
    left: 20px !important;
    right: 20px !important;
    top: 120px;
    bottom: 20px;
  }
  
  body.applet-viewer .applet-left-panel {
    position: fixed;
    left: 20px;
    right: 20px;
    top: 120px;
    bottom: 20px;
    width: auto;
    height: auto;
    max-width: none;
    overflow-y: auto;
  }
  

  #appletOutputPanel {
    position: fixed;
    left: 20px;
    right: 20px;
    top: 120px;
    bottom: 80px;
    width: auto;
    height: auto;
    z-index: 2000;
    overflow-y: auto;
  }
  
  #appletDownloadsPanel {
    position: fixed;
    left: 20px;
    right: 20px;
    bottom: 20px;
    width: auto;
    height: auto;
    max-width: none;
    z-index: 2000;
  }


/* Add these styles to applet_viewer.css */

/* Landing Page Styles */
.applets-landing-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.applets-header {
    text-align: center;
    margin-bottom: 60px;
}

.applets-header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    color: #333;
}

.applets-hero-image {
    width: 100%;
    max-width: 800px;
    height: 400px;
    margin: 40px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.applets-hero-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.applets-description {
    font-size: 1.2rem;
    line-height: 1.8;
    color: #555;
    max-width: 800px;
    margin: 0 auto 60px;
    text-align: left;
}

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

.applet-card {
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s, box-shadow 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.applet-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.applet-card h3 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.5rem;
}

.applet-card p {
    margin: 0;
    color: #666;
    line-height: 1.6;
}

@media (max-width: 768px) {
    .applets-header h1 {
        font-size: 2rem;
    }
    
    .applets-description {
        font-size: 1rem;
    }
    
    .applets-grid {
        grid-template-columns: 1fr;
    }
}

/* EULA Agreement Checkbox */
.eula-agreement {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 15px;
}

.eula-checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    color: #333;
}

.eula-checkbox-label input[type="checkbox"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
}

.eula-checkbox-label a {
    color: #007bff;
    text-decoration: none;
}

.eula-checkbox-label a:hover {
    text-decoration: underline;
}

/* EULA Modal */
.eula-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.eula-modal.hidden {
    display: none;
}

.eula-modal-content {
    background: white;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.eula-modal-header {
    padding: 20px 30px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.eula-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #333;
}

.eula-close-btn {
    background: none;
    border: none;
    font-size: 2rem;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.eula-close-btn:hover {
    color: #333;
}

.eula-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
    color: #555;
    line-height: 1.6;
}

.eula-modal-footer {
    padding: 20px 30px;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.eula-btn-secondary {
    padding: 10px 24px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

.eula-btn-secondary:hover {
    background: #5a6268;
}

/* Disable download buttons when EULA not accepted */
.download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}



.download-eula-tooltip {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(50,50,50,0.95);
  color: white;
  padding: 12px 16px;
  border-radius: 8px;
  z-index: 999999;
  display: none;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}

html[data-bs-theme="light"] .download-eula-tooltip {
  background: rgba(255,255,255,0.95);
  color: black;
}

.download-eula-tooltip .tooltip-ok-btn {
  margin-left: 12px;
  border: 1px solid #999;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}



.tooltip-arrow {
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-top: 10px solid rgba(50,50,50,0.95);
  margin: 0 auto;
}

html[data-bs-theme="light"] .tooltip-arrow {
  border-top-color: rgba(255,255,255,0.95);
}
@keyframes shake {
  0% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  50% { transform: translateX(4px); }
  75% { transform: translateX(-3px); }
  100% { transform: translateX(0); }
}

.shake {
  animation: shake 0.4s;
}






}