/* Color Code Converter specific styles */

.tool-container {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

.form-control {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    box-sizing: border-box; /* Include padding in width */
}

.form-control::placeholder {
    color: #aaa;
}

.form-control:focus {
    border-color: #007bff; /* Primary color */
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: none;
}

.d-flex {
    display: flex;
}

.justify-content-center {
    justify-content: center;
}

.gap-3 > *:not(:last-child) {
    margin-right: 15px; /* Adjust spacing between buttons */
}

/* Color Preview */
.color-preview-container {
    text-align: center;
    margin-bottom: 30px;
}

.color-preview {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* Circle shape */
    background-color: #e0e0e0; /* Default grey */
    border: 3px solid #ccc;
    margin: 0 auto;
    box-shadow: inset 0 0 5px rgba(0,0,0,0.2);
    transition: background-color 0.3s ease-in-out, border-color 0.3s ease-in-out;
}

.color-name {
    font-weight: bold;
    color: #555;
}

/* Output Grid for Converted Codes */
.conversion-output-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Responsive columns */
    gap: 20px;
    margin-top: 20px;
}

.output-item {
    position: relative;
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
    border: 1px solid #e9ecef;
    display: flex;
    flex-direction: column;
    align-items: flex-start; /* Align label/input to start */
}

.output-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.output-field {
    width: calc(100% - 40px); /* Adjust for copy button */
    background-color: #fff;
    border: 1px solid #ddd;
    cursor: text; /* Indicate it's selectable */
    color: #555;
    white-space: nowrap; /* Prevent wrapping */
    overflow-x: auto; /* Allow horizontal scroll if content is too long */
}

.output-field::-webkit-scrollbar {
    height: 5px;
}
.output-field::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 5px;
}
.output-field::-webkit-scrollbar-track {
    background: #f1f1f1;
}


.copy-btn {
    position: absolute;
    top: 35px; /* Adjust based on label height */
    right: 10px;
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1; /* Fix icon alignment */
}

.copy-btn i {
    margin-right: 0;
}

.copy-btn:hover {
    background-color: #0056b3;
}

.error-message {
    color: #dc3545; /* Red for errors */
    font-size: 0.85rem;
    margin-top: 5px;
    display: block; /* Ensures it takes full width */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .conversion-output-grid {
        grid-template-columns: 1fr; /* Stack columns on small screens */
    }
    .copy-btn {
        top: 40px; /* Adjust for stacked layout */
    }
}