/* Base Layout */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #1e1e1e;
    color: white;
}

:root {
    --font-lilita: 'Lilita One', cursive;
  }  

/* App container: Sidebar (left) + Main Panel (right) */
.app-container {
    display: flex;
    height: 100%;
    width: 100%;
}

/* Main panel: holds header, content, and footer vertically */
.main-panel {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Header and footer stick to top/bottom */
#header, #footer {
    flex-shrink: 0;
}

footer {
    background-color: #222;
    color: white;
    text-align: center;
    padding: 5px;
    width: 100%;
    box-shadow: 0px -4px 8px rgba(0, 0, 0, 0.2);
    font-size:12px;
}

/* Main content area expands to fill remaining space */
.main-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    transition: margin-left 0.3s ease;
    text-align: center;
}

/* Input and UI Components */
.input-container {
    margin-bottom: 20px;
}

/* Gradient Text Preview */
#preview {
    font-family: var(--font-lilita);
    font-size: 30px;
    font-weight: bold;
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    display: inline-block;
    white-space: nowrap;
    background-size: 300% 100%;
    background-position: 100% 50%;
    animation: moveGradient 5s linear infinite;
    -webkit-text-stroke: 0.1px black;
    text-align: center;
    padding: 10px;
    z-index: 1;
}

@keyframes moveGradient {
    0% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Preview background container */
#preview-container {
    position: relative;
    width: 100%;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: black;
    border-radius: 10px;
    margin: 10px auto;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.3);
}

/* Color Management UI */
#colorList {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.color-item {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #333;
    padding: 10px;
    border-radius: 5px;
    width: 100%;
    justify-content: space-between;
    cursor: grab;
}

.drag-handle {
    font-size: 20px;
    cursor: grab;
    color: white;
    padding: 5px;
}

.color-box {
    width: 25px;
    min-width: 25px;
    border-radius: 5px;
    border: 2px solid white;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    padding: 0;
    background: transparent;
}

.hex-code {
    color: white;
    font-size: 16px;
    flex-grow: 1;
    text-align: left;
}

.delete-btn {
    background: none;
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
}

.add-color-btn:disabled {
    background-color: #777;
    cursor: not-allowed;
}

/* === Color Generator Input/Select Styles === */
.colorGen-Input,
.colorGen-Select {
  width: 100%;
  padding: 10px 0px 10px 15px;
  background-color: #2a2a2a;
  color: #ffffff;
  border: 1px solid #555;
  border-radius: 6px;
  transition: border-color 0.3s, box-shadow 0.3s;
  appearance: none;
  outline: none;
}

.colorGen-Input:focus,
.colorGen-Select:focus {
  border-color: #7289da;
  box-shadow: 0 0 0 2px rgba(114, 137, 218, 0.3);
}

/* Optional: Style the dropdown arrow for select */
.colorGen-Select {
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg width='10' height='5' viewBox='0 0 10 5' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 0L5 5L10 0H0Z' fill='white'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px;
}

.hex-code-input {
    flex-grow: 1;
    min-width:20px;
    font-size: 14px;
    padding: 6px;
    border: 1px solid #888;
    border-radius: 4px;
    background-color: #222;
    color: white;
}

.manage-colors-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
    margin-bottom: 10px;
}
  
.manage-colors-row h2 {
    margin: 0;
    font-size: 20px;
}
  
.color-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
  
.color-actions button {
    padding: 5px 8px;
    font-size: 12px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}
  
.color-actions button:hover {
    background-color: #666;
}

.lock-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: white;
    cursor: pointer;
    margin-left: 6px;
}

.lock-btn:hover {
    color: #00ffcc;
}

.duplicate-btn {
    background: none;
    border: none;
    font-size: 16px;
    color: white;
    cursor: pointer;
}

.duplicate-btn:disabled {
    color: #777;
    cursor: not-allowed;
}

.duplicate-btn:hover:enabled {
    color: #00ffcc;
}

.percent-input {
    width: 50px;
    padding: 5px;
    font-size: 14px;
    background: #222;
    color: white;
    border: 1px solid #888;
    border-radius: 4px;
  }

.color-item-detail{
    font-size: 12px;
}

.content-wrapper {
    width: 45%;
    min-width:450px;
    max-width: 650px;
    margin: auto;
    padding: 20px;
    text-align: left;
    border: 1px solid #333;
  }

  .mobile-sidebar-toggle {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 1001;
    background: #333;
    color: white;
    border: none;
    font-size: 24px;
    padding: 10px 14px;
    border-radius: 6px;
    cursor: pointer;
  }

  .page-wrapper {
    display: flex;
    flex-direction: column;
    height: 100%;
  }
  
  .mobile-header {
    display: none; /* Hidden on desktop */
    background-color: #1e1e1e;
    padding: 10px 15px;
    z-index: 1001;
  }
  
  .mobile-toggle-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: white;
    cursor: pointer;
  }

  .multi-input-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  
  .btn-primary {
    padding: 8px 12px;
    font-size: 14px;
    background-color: #444;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    text-decoration: none;
  }

  .action-buttons {
    padding-top: 20px;
    max-width:650px;
    margin: auto;
    text-align: left;
    justify-content: center;
    display: flex;
    gap:5px;
    flex-wrap: wrap;
  }

  .overlay {
    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: 999;
  }
  
  .overlay-content {
    background: #1e1e1e;
    padding: 20px;
    border-radius: 8px;
    max-width: 600px;
    color: white;
    height: fit-content;
    max-height:60vh;
    overflow-y: auto;
    position: relative;
  }
  
  .overlay-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    border: none;
    font-size: 20px;
    color: white;
    cursor: pointer;
    z-index: 10;
  }
  
  .overlay-close-btn:hover {
    color: #ff5e5e;
  }

  .overlay-input{
    padding: 10px 0px 10px 15px;
    margin-bottom:10px;
    background-color: #2a2a2a;
    color: #fff;
    border: 1px solid #555;
    border-radius: 6px;
    appearance: none;
    outline: none;
  }

  .range-slider {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    border-radius: 4px;
    background: #444;
    background-image: linear-gradient(to right, #aaa, #aaa);
    background-size: 0% 100%;
    background-repeat: no-repeat;
    outline: none;
    cursor: pointer;
    transition: background-size 0.3s ease;
  }
  
  /* WebKit Thumb */
  .range-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: #ccc;
    border: 2px solid #666;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
    transition: background 0.2s, border 0.2s;
  }
  
  .range-slider::-webkit-slider-thumb:hover {
    background: #eee;
    border-color: #888;
  }
  
  /* Firefox Thumb */
  .range-slider::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: #ccc;
    border: 2px solid #666;
    border-radius: 50%;
    box-shadow: 0 0 2px rgba(255, 255, 255, 0.1);
    transition: background 0.2s, border 0.2s;
  }
  
  .range-slider::-moz-range-thumb:hover {
    background: #eee;
    border-color: #888;
  }
  
  /* Firefox Track */
  .range-slider::-moz-range-track {
    background: #444;
    height: 8px;
    border-radius: 4px;
  }
  
  /* IE Track and Thumb (legacy support) */
  .range-slider::-ms-track {
    background: transparent;
    border-color: transparent;
    color: transparent;
    height: 8px;
  }
  .range-slider::-ms-fill-lower {
    background: #aaa;
    border-radius: 4px;
  }
  .range-slider::-ms-fill-upper {
    background: #444;
    border-radius: 4px;
  }
  .range-slider::-ms-thumb {
    width: 16px;
    height: 16px;
    background: #ccc;
    border: 2px solid #666;
    border-radius: 50%;
  }
  
  .sys-msg {
    position:relative;
    width: 90%;
    max-width: 650px;
    min-width:300px;
    margin:auto;
  }

  .sys-msg-close {
    position:absolute;
    top:3px;
    right:3px;
    background:none;
    border:none;
    color: rgb(164, 52, 52);
    font-weight: bold;
  }
  .sys-msg p {
    padding:0;
    margin:0;
  }

  .sys-msg .info{
    border-left: 3px solid rgb(38, 0, 255);
    background-color: rgba(155, 131, 250, 0.124);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    margin-bottom: 10px;
    color: rgb(255, 255, 255);
    text-align: left;
  }

  .sys-msg .note{
    border-left: 3px solid rgb(183, 0, 255);
    background-color: rgba(214, 131, 250, 0.124);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    margin-bottom: 10px;
    color: rgb(255, 255, 255);
    text-align: left;
  }

  .sys-msg .error{
    border-left: 3px solid rgb(255, 0, 0);
    background-color: rgba(250, 131, 131, 0.124);
    border-radius: 0 6px 6px 0;
    padding: 8px 12px;
    margin-bottom: 10px;
    color: rgb(255, 255, 255);
    text-align: left;
  }

  .sys-msg-button{
    background: #2a2a2a;
    border-radius:6px;
    border:1px solid #555;
    color: #fff;
    margin-top:5px;
    margin-right:5px;
    cursor:pointer;
  }

/* Checkbox Styling */
.dark-checkbox-label input[type="checkbox"]{
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 2px solid #888;
  border-radius: 50%;
  background-color: #1e1e1e;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
  display: grid;
  place-content: center;
  padding: 0;
}

.dark-checkbox-label{
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ccc;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  user-select: none;
}

.dark-checkbox-label input[type="checkbox"]::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: #ccc;
  transform: scale(0);
  transition: transform 0.2s ease;
}

.dark-checkbox-label input[type="checkbox"]:checked::before {
  transform: scale(1);
}

.purple-tip {
  border-left: 3px solid purple; 
  border-radius: 12px;
  background-color: rgba(128, 0, 128, 0.25);
  padding:8px;
  font-size:11px;
}

.spinner {
  width: 40px;
  height: 40px;
  margin: 10px auto;
  border: 4px solid #ccc;
  border-top-color: #1e1e1e;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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