/* --- Base layout from create-style.css --- */
.create-container {
    background: var(--card);
    padding: 30px;
    border-radius: 16px;
    margin: 0 auto;
}

.palette-live-preview {
    display: flex;
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 30px;
}

/* --- Styles for Gradient Hover Effect (from gradient-style.css) --- */
.gradient-color-step {
    flex-grow: 1;
    transition: flex-grow 0.4s cubic-bezier(0.165, 0.84, 0.44, 1), 
                background-color 0.3s; 
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
}

.gradient-color-step:hover {
    flex-grow: 3;
}

.gradient-hex-code {
    /* --- NEW POSITIONING --- */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none; /* Prevents text from stealing the mouse hover */
    /* --- END NEW --- */

    font-weight: 700;
    font-size: 14px;
    color: #ffffff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    opacity: 0; /* Hide by default */
    transition: opacity 0.2s ease-in-out;
    white-space: nowrap; /* Keep this from the previous fix */
}

.gradient-color-step:hover .gradient-hex-code {
    opacity: 1;
}

/* Override state: Dark text for light backgrounds */
.gradient-color-step.is-light-bg .gradient-hex-code {
    color: #1a1a1a;
    text-shadow: none;
}

.submit-button {
    display: block;
    width: 100%;
    padding: 15px;
    border-radius: 8px;
    border: none;
    background: var(--accent-color);
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.submit-button:hover {
    filter: brightness(1.1);
}

/* --- Styles for NEW controls, copied from gradient-style.css --- */
.gradient-controls-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr); /* FOUR columns */
  gap: 20px; /* Adjust gap as needed */
  margin-bottom: 30px;
  align-items: flex-end; /* Align items to the bottom */
}


/* --- Responsive Adjustments for Gradient Controls --- */

@media (max-width: 768px) { /* Adjust breakpoint if needed */
  .gradient-controls-grid {
    grid-template-columns: repeat(2, 1fr); /* TWO columns for mobile */
    gap: 15px; /* Slightly smaller gap for mobile */
  }

  /* Optional: Ensure labels are still readable if needed */
  .control-group label {
      /* font-size: 12px; /* Example: Slightly smaller font if needed */
  }

  /* You might not need specific order changes if the HTML order is already:
     1. Start Color
     2. End Color
     3. Steps
     4. Random Button 
     The grid will automatically place them 2x2. */
}

@media (max-width: 480px) { /* Even smaller screens */
    .gradient-controls-grid {
         gap: 10px; /* Further reduce gap */
    }
    /* You could even go to 1 column here if desired: */
    /* grid-template-columns: 1fr; */ 
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.control-group label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  padding-left: 0; /* Remove previous indent */
  margin-bottom: 6px; /* Ensure space between label and control */
  display: block; /* Make sure label takes its own line */
}
            
/* --- Styles for Palette Picker (Pickr) --- */
#palette-picker-container {
  display: flex;
  flex-wrap: wrap;
  gap: 18px; /* Increased gap to accommodate Pickr */
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  justify-content: flex-start;
}

/* Container for each Pickr button + label */
.palette-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px; 
}

/* --- Styles for Custom Pickr Button --- */

.control-group.color-control {
    /* Keep this */
    display: flex;
    flex-direction: column;
    gap: 0; 
}

/* The main button container */
.custom-color-picker-button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    height: 40px;
    padding: 0 8px 0 12px;
    background: var(--bg);
    /* border: 1px solid var(--border); */
    border-radius: 8px;
    box-sizing: border-box;
    cursor: pointer;
    transition: border-color 0.2s;
    box-shadow: inset hsl(250, 3%, 85%) 0 0 0 1px, inset white 0 0 0 100px !important;
}

.custom-color-picker-button:hover {
    border-color: var(--primary); /* Highlight on hover */
}

/* Style for the hex code text */
.color-hex-display {
    font-family: Inter, system-ui;
    font-weight: 700;
    font-size: 15px; /* Adjust size */
    color: var(--fg);
    pointer-events: none; /* Make sure clicks go to the container */
}

/* Style for the color preview swatch */
.color-preview-swatch {
    width: 24px;   /* Adjust size */
    height: 24px;  /* Adjust size */
    border-radius: 5px; /* Slightly rounded corners for swatch */
    border: 1px solid rgba(0,0,0,0.1); /* Optional subtle border */
    box-sizing: border-box;
    pointer-events: none; /* Make sure clicks go to the container */
    flex-shrink: 0; /* Prevent swatch from shrinking */
}

/* Ensure Pickr popup appears on top */
.pcr-app {
    z-index: 1000; 
}

/* Hide the hidden inputs */
.control-group input[type="hidden"] {
    display: none;
}

/* Label (P1, P2...) */
.palette-row span {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
}

.pcr-app.visible {
    border-radius: 12px !important;
}


.pcr-app .pcr-interaction .pcr-save {
    display: none;
}

.number-input-container {
    display: flex;
    align-items: center;
    position: relative;
}

.number-group input[type="number"] {
    width: 100%; /* Make it fill the grid column */
    height: 40px;
    text-align: center;
    padding-right: 25px; 
    background: var(--bg);
    border: 0px solid var(--border);
    border-radius: 8px;
    color: var(--fg);
    font-weight: 700;
    font-size: 15px;
    box-sizing: border-box;
    font-family: Inter, system-ui;
    box-shadow: inset hsl(250, 3%, 85%) 0 0 0 1px, inset white 0 0 0 100px !important;
}

.number-group input[type="number"]:focus {
    outline: none;
    border-color: none;
}

.control-group input[type=number]::-webkit-inner-spin-button,
.control-group input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.control-group input[type=number] {
  -moz-appearance: textfield;
}

.number-arrows {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    height: calc(100% - 10px); 
    justify-content: space-evenly;
}

.number-arrows button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 8px;
    line-height: 1;
    cursor: pointer;
    color: var(--muted);
}
.number-arrows button:hover {
    color: var(--fg);
}

/* --- Utility class to hide the 5 original inputs --- */
.hidden-inputs {
    display: none;
}


/* --- Modal Styles (copied from create-style.css) --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--card);
    padding: 30px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    text-align: center;
    max-width: 400px;
    width: 90%;
    transform: scale(1);
    transition: transform 0.3s ease;
}

.modal-overlay.hidden .modal-content {
    transform: scale(0.9);
}

.modal-content h3 {
    margin: 0 0 15px 0;
    font-size: 22px;
    color: var(--fg);
}

.modal-content p {
    margin: 0 0 25px 0;
    font-size: 15px;
    color: var(--muted);
    line-height: 1.6;
}

.modal-button {
    background: var(--accent-color);
    color: #fff;
    padding: 10px 30px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: filter 0.2s;
}

.modal-button:hover {
    filter: brightness(1.1);
}

/* --- Style for action buttons (from gradient-style.css) --- */
.control-group.action-group {
    padding-bottom: 0; 
}

.action-btn-outline {
    height: 40px;
    padding: 0 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border: 1px solid var(--border);
    transition: background-color 0.2s, color 0.2s;
    font-family: Inter, system-ui;
    background: var(--accent-color);
    color: #ffffff;
    width: 100%;
    box-sizing: border-box;
}

.action-btn-outline:hover {
    background: var(--chip);
}



