/* Specific styles for the CSS Box Shadow Generator */

.shadow-generator-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.box-preview-area {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 250px;
    background-color: #f0f4f7;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
}

.box-preview {
    width: 150px;
    height: 150px;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    transition: box-shadow 0.2s ease-out; /* Smooth transition for shadow */
}

.controls-panel {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.value-display {
    font-weight: bold;
    color: #007bff;
    margin-left: 10px;
}

/* Slider styling */
input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: #e2e8f0;
    border-radius: 5px;
    outline: none;
    transition: background 0.2s ease;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #007bff;
    border: 2px solid #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Color and Opacity controls */
.color-control-group {
    display: flex;
    flex-direction: column;
}

.color-picker-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
}

#shadow-color {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 40px;
    height: 40px;
    background: none;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    padding: 0;
}
#shadow-color::-webkit-color-swatch-wrapper {
    padding: 0;
}
#shadow-color::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}
.color-input {
    flex-grow: 1;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Fira Code', monospace;
    text-transform: uppercase;
}

/* Inset Toggle Switch */
.switch-group {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
}
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: #007bff;
}
input:checked + .slider:before {
    transform: translateX(22px);
}

.output-area {
    margin-top: 15px;
}

#output-code {
    width: 100%;
    padding: 15px;
    border: 1px dashed #007bff;
    border-radius: 6px;
    background-color: #f9f9f9;
    font-family: 'Fira Code', 'Cascadia Code', 'Consolas', monospace;
    font-size: 0.9em;
    color: #333;
    resize: none;
    min-height: 120px;
    line-height: 1.5;
}

.button-group {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .shadow-generator-container {
        padding: 20px;
        gap: 20px;
    }
    .controls-panel {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    .button-group .btn {
        width: 100%;
    }
}