/* --- Gradient Generator Layout --- */
.create-container {
    background: var(--card);
    padding: 30px;
    border-radius: 16px;
    margin: 0 auto;
}

/* --- Gradient Preview --- */
.gradient-preview {
    height: 300px; 
    border-radius: 12px;
    margin-bottom: 30px;
    border: 1px solid var(--border);
    background: linear-gradient(90deg, #2278FB 0%, #6BDFDB 100%); /* Default */
}

/* --- Controls Grid --- */
.gradient-controls-grid-v2 {
    display: grid;
    grid-template-columns: repeat(4, auto); 
    gap: 15px 20px; 
    margin-bottom: 30px;
    align-items: flex-end; 
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
}

.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 */
}

.color-hex-display {
    font-family: Inter, system-ui;
    font-weight: 700;
    font-size: 15px; 
    color: var(--fg);
    pointer-events: none; 
}
.color-preview-swatch {
    width: 24px;   
    height: 24px;  
    border-radius: 5px; 
    border: 1px solid rgba(0,0,0,0.1); 
    box-sizing: border-box;
    pointer-events: none; 
    flex-shrink: 0; 
}

/* --- Input Styles --- */
input[type="number"],
select#gradientType {
    width: 100%;
    height: 40px;
    text-align: center;
    padding: 0 10px; 
    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;
    -moz-appearance: textfield;
    box-shadow: inset hsl(250, 3%, 85%) 0 0 0 1px, inset white 0 0 0 100px !important;
    
}
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
  -webkit-appearance: none; 
  margin: 0;
}


input#gradientAngle:focus {
    outline: none;
    border-color: none;
}

#gradientTypeToggleBtn {
    outline: none;
    border-color: none;
}



textarea#cssOutput:focus {
    outline: none;
    border-color: none;
}

input#stop1Pos.position-input:focus {
    outline: none;
    border-color: none;
}

input#stop2Pos.position-input:focus {
    outline: none;
    border-color: none;
}

select#gradientType:focus {
    outline: none;
    border-color: none;
}


select#gradientType {
    text-align: left; 
    padding-right: 30px; 
    cursor: pointer;
}

/* --- Action Buttons --- */
.action-btn-outline,
.action-btn-primary {
    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) !important;
    color: #ffffff;
    width: 100%;
    box-sizing: border-box; 
}
.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);
}

.action-btn-primary {
    background: var(--primary); 
    color: #fff;
    border-color: var(--primary);
}
.action-btn-primary:hover {
    filter: brightness(1.1);
}

/* --- CSS Output Area --- */
.css-output-area {
    margin-top: 20px; 
}
.css-output-area label {
    font-size: 13px;
    font-weight: 700;
    color: var(--muted);
    margin-bottom: 6px;
    display: block;
}
#cssOutput {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 15px;
    font-family: monospace; 
    font-size: 15px;
    color: var(--fg);
    resize: none; 
    box-sizing: border-box;
}

/* --- Pickr Popup Style --- */
.pcr-app {
    z-index: 1000; 
}


.pcr-app.visible {
    border-radius: 12px !important;
}


.pcr-app .pcr-interaction .pcr-save {
    display: none;
}


/* --- Responsive Adjustments --- */
@media (max-width: 768px) {
    .gradient-controls-grid-v2 {
        grid-template-columns: repeat(2, 1fr); 
        gap: 15px;
    }
}
@media (max-width: 480px) {
    .gradient-controls-grid-v2 {
        grid-template-columns: 1fr; 
        gap: 15px;
    }
    .gradient-preview {
        height: 100px; 
    }
}




/* --- Styles for Custom Dropdown --- */
.dropdown-container { 
    position: relative; 
}

.dropdown-menu {
    position: absolute; 
    background: var(--card);
    border: 1px solid var(--border); /* Added border */
    border-radius: 8px;
    box-shadow: var(--shadow);
    z-index: 1001; /* Ensure it's above Pickr popup (z-index 1000) */
    min-width: 100%; /* Make it at least as wide as the button */
    padding: 8px 0;
    /* right: 0; */ /* Let it align left by default */
    top: calc(100% + 5px);
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
    transition: opacity 0.2s, transform 0.2s;
}

.dropdown-menu.show {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Style for the button that looks like a select */
.select-mock { /* Removed .gm-option-group prefix */
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0 12px; /* Adjusted padding */
    color: var(--fg);
    font-weight: 700;
    font-size: 14px; /* Match input font */
    height: 40px; /* Match input height */
    box-sizing: border-box;
    width: 100%;
    cursor: pointer;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: Inter, system-ui; /* Match input font */
}
 .select-mock:hover {
     border-color: var(--primary); /* Add hover effect */
 }

.select-mock svg {
   flex-shrink: 0; /* Prevent icon shrinking */
   margin-left: 8px; 
}


.dropdown-item {
    display: flex;
    align-items: center;
    padding: 8px 15px; 
    width: 100%;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500; /* Normal weight for options */
    color: var(--fg);
    text-align: left;
    white-space: nowrap; /* Prevent options wrapping */
}

.dropdown-item:hover,
.dropdown-item:focus {
    background-color: var(--chip); /* Use chip color for hover */
    outline: none;
}

.dropdown-item.active {
    font-weight: 700; /* Bold active item */
    /* background-color: var(--chip-active); /* Optional: different bg for active */
}


/* --- Interactive Gradient Slider --- */
.gradient-slider-container {
    width: 100%;
    padding: 15px 0; /* Add some vertical space */
    margin-bottom: 30px; /* Space below slider */
    box-sizing: border-box;
}

.gradient-slider-track {
    position: relative; /* Crucial for positioning handles */
    width: 100%;
    height: 20px; /* Height of the gradient bar */
    border-radius: 10px; /* Rounded ends */
    border: 1px solid var(--border);
    background: linear-gradient(90deg, #2278FB 0%, #6BDFDB 100%); /* Default */
    cursor: default; /* Change cursor if needed */
}

.gradient-slider-handle {
    position: absolute;
    top: 50%; /* Center vertically */
    transform: translate(-50%, -50%); /* Center based on handle's own size */
    width: 28px; /* Handle width */
    height: 28px; /* Handle height */
    border-radius: 50%; /* Make it round */
    background-color: #fff; /* White handle */
    border: 3px solid var(--handle-color, #000); /* Border color will match stop color */
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: grab; /* Indicate draggable */
    z-index: 5; /* Ensure handles are above the track */
    box-sizing: border-box;
}

.gradient-slider-handle:active {
    cursor: grabbing; /* Cursor while dragging */
    transform: translate(-50%, -50%) scale(1.1); /* Slightly larger when active */
}

/* Style to visually show the stop color in the handle's border */
.gradient-slider-handle[data-stop="1"] { --handle-color: var(--stop1-color, #2278FB); }
.gradient-slider-handle[data-stop="2"] { --handle-color: var(--stop2-color, #6BDFDB); }
/* Add more for stops 3, 4, etc. if you add them later */


