/* Styles specific to the CSS Gradient Generator Tool */

.gradient-generator-container {
    max-width: 1000px; /* Allow wider container */
    margin: 1rem auto;
    padding: 1.5rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--preview-bg);
}

.gradient-generator-container h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 1.4rem;
    color: var(--text-color);
}

.main-layout {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
}

.controls-panel {
    flex: 1; /* Take up available space */
    min-width: 300px; /* Minimum width before wrapping */
}

.preview-and-output {
    flex: 1.5; /* Preview takes more space */
    /*min-width: 350px;*/
    display: flex;
    padding-right: 1.5rem;
    flex-direction: column;
    border-right: 1px solid var(--border-color);
    gap: 1.5rem;
}
@media (max-width: 768px) {
    .preview-and-output {
        border-right: none;
        padding-right: 0;
        margin-bottom: 1.5rem;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 1.5rem;
    }
}

.controls-panel h3,
.preview-panel h3,
.output-panel h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.1rem;
    color: var(--label-text);
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
}

.control-group {
    margin-bottom: 1.5rem;
}

.control-group label:not(.radio-group label) {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--label-text);
    font-size: 0.9rem;
}

/* Radio Button Styling */
.radio-group label {
    margin-right: 1rem;
    cursor: pointer;
    font-size: 1rem;
}
.radio-group input[type="radio"] {
    margin-right: 0.3rem;
    accent-color: var(--accent-color); /* Style the radio button itself */
}

/* Angle Controls */
.angle-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.angle-control input[type="range"] {
    flex-grow: 1;
    cursor: pointer;
     accent-color: var(--accent-color); /* Style the slider track/thumb */
}
.angle-control input[type="number"] {
     width: 65px;
     padding: 0.4rem;
     text-align: center;
     border: 1px solid var(--border-color);
     border-radius: 4px;
     background-color: var(--bg-color);
     color: var(--text-color);
     font-size: 0.95rem;
}
.angle-control span {
     font-size: 0.9rem;
     color: var(--label-text);
}
/* Hide number input arrows */
.angle-control input[type="number"]::-webkit-outer-spin-button,
.angle-control input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none; margin: 0; }
.angle-control input[type="number"] { -moz-appearance: textfield; }

.control-group small {
     font-size: 0.8rem;
     color: var(--label-text);
     opacity: 0.7;
     display: block;
     margin-top: 0.3rem;
}


.control-group select {
     width: 100%;
     padding: 0.6rem 0.8rem;
     border: 1px solid var(--border-color);
     border-radius: 4px;
     font-size: 1rem;
     background-color: var(--bg-color);
     color: var(--text-color);
}

.control-group select:focus {
     border-color: var(--accent-color);
     outline: none;
     box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}
body.dark-mode .control-group select:focus {
      box-shadow: 0 0 0 2px rgba(102, 191, 255, 0.25);
}

/* Color Stops */
#color-stops-container {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
    max-height: 300px; /* Limit height and scroll */
    overflow-y: auto;
     padding-right: 5px; /* Space for scrollbar */
}

.color-stop-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: var(--bg-color);
    padding: 0.5rem;
    border-radius: 4px;
     border: 1px solid var(--border-color);
}

.color-stop-color {
    width: 40px;
    height: 30px;
    padding: 0 2px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    background-color: transparent; /* Let the color show */
    flex-shrink: 0;
}
/* Remove default browser styling artifacts for color input */
.color-stop-color::-webkit-color-swatch-wrapper { padding: 0; }
.color-stop-color::-webkit-color-swatch { border: none; border-radius: 3px; }
.color-stop-color::-moz-color-swatch { border: none; border-radius: 3px; }

.color-stop-position {
    width: 80px;
    padding: 0.4rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 0.9rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    text-align: center;
    flex-shrink: 0;
}
/* Hide arrows */
.color-stop-position::-webkit-outer-spin-button,
.color-stop-position::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.color-stop-position { -moz-appearance: textfield; }


.remove-stop-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--error-text);
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
    margin-left: auto; /* Push to the right */
    transition: background-color 0.2s, color 0.2s;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.remove-stop-btn:hover:not(:disabled) {
    background-color: var(--error-text);
    color: var(--bg-color);
    border-color: var(--error-text);
}
.remove-stop-btn:disabled {
     cursor: not-allowed;
     opacity: 0.5;
}

.control-button.add-btn {
    width: 100%;
    padding: 0.6rem 1rem;
    font-size: 0.95rem;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    background-color: #6c757d; /* Grey */
    color: white;
    text-align: center;
}
.control-button.add-btn:hover {
     opacity: 0.9;
}


/* Preview Panel */
#gradient-preview {
    width: 100%;
    height: 200px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background-color: #ccc; /* Default background */
    /* Transition background for smoother updates */
    transition: background 0.3s ease-in-out;
}


/* Output Panel */
.css-output-container {
    position: relative; /* For positioning copy button */
}

#css-output {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 0.9rem;
    background-color: var(--bg-color);
    color: var(--text-color);
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}
#css-output:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.2);
}
body.dark-mode #css-output:focus {
     box-shadow: 0 0 0 2px rgba(102, 191, 255, 0.25);
}

.control-button.copy {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 0.3rem 0.6rem;
    font-size: 0.8rem;
    background-color: var(--label-text);
    color: var(--bg-color);
    border: none;
    border-radius: 3px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    z-index: 2;
}
.control-button.copy:hover {
    opacity: 1;
}

.copy-status-message {
    position: absolute;
    top: 8px;
    right: 60px; /* Adjust based on copy button width */
    font-size: 0.8rem;
    color: var(--accent-color);
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none;
}
.copy-status-message.visible {
    opacity: 1;
}


.hidden {
    display: none;
}


/* Responsive */
@media (max-width: 768px) {
    .main-layout {
        flex-direction: column; /* Stack panels */
        gap: 1.5rem;
    }
}