/*
 * Plugin Name: Color Picker Plugin
 * Description: Styles for the Color Picker Plugin.
 */

/* Universal box-sizing for consistent layout */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Font Awesome for icons (Removed as buttons are removed) */
/* @import url('https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css'); */

/* Main container for the color picker */
.color-picker-container {
    font-family: 'Inter', sans-serif; /* Using Inter font for a modern look */
    background-color: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 12px; /* Rounded corners */
    padding: 25px;
    margin: 30px auto; /* Center the container with some margin */
    max-width: 700px; /* Increased max-width for new elements */
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1); /* Soft shadow for depth */
    text-align: center;
    transition: all 0.3s ease-in-out; /* Smooth transition for hover effects */
}

/* Heading inside the container */
.color-picker-container h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.8em;
    font-weight: 700;
}

/* Paragraph text */
.color-picker-container p {
    color: #555;
    margin-bottom: 25px;
    font-size: 1.1em;
    line-height: 1.6;
}

/* Color Spectrum Canvas */
.color-spectrum-canvas {
    width: 100%; /* Make canvas responsive */
    height: 300px; /* Fixed height for the spectrum */
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: crosshair; /* Cursor indicates color picking */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 25px;
    background-color: #fff; /* Fallback background */
}

/* Grid for pixel color and coordinates info */
.color-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns */
    gap: 20px;
    margin-bottom: 25px;
    text-align: left;
}

.info-group {
    background-color: #e9ecef;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

.info-label {
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.info-icon {
    font-size: 0.9em;
    color: #666;
    cursor: help;
}

/* Pixel Color Display */
.color-display-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pixel-color-swatch {
    width: 40px;
    height: 40px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background-color: #000; /* Default */
    transition: background-color 0.2s ease-in-out;
}

.color-input, .coord-input {
    flex-grow: 1;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    background-color: #fff;
    color: #333;
    text-align: center;
    /* Ensure inputs don't overflow */
    min-width: 0; 
    flex-shrink: 1; /* Allow input to shrink if needed */
}

/* Coordinates Display */
.coordinate-display-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap; /* Allow items to wrap to the next line if space is insufficient */
    justify-content: center; /* Center items if they wrap */
}

.coord-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    /* Use flex-basis for better control in flex containers */
    flex: 1 1 calc(50% - 7.5px); /* flex-grow, flex-shrink, flex-basis */
}

.coord-item span {
    font-size: 0.9em;
    color: #555;
    margin-bottom: 5px;
}

/* Button Row (Removed as per user request) */
/* .button-row {
    margin-bottom: 25px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap; 
} */

/* Action Button (Removed as per user request) */
/* .action-button {
    background-color: #007bff;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 1em;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 8px rgba(0, 123, 255, 0.2);
    display: flex;
    align-items: center;
    gap: 8px;
} */

/* .action-button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 123, 255, 0.3);
} */

/* .action-button:active {
    background-color: #004085;
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
} */

/* Info text for selected color (bottom) */
.selected-color-info {
    font-size: 1.1em;
    color: #444;
    margin-top: 20px;
    padding: 10px 15px;
    background-color: #e9ecef;
    border-radius: 8px;
    display: inline-block;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.1);
}

/* Span for displaying the current selected color */
#current-selected-color {
    font-weight: bold;
    color: #007bff;
    transition: color 0.3s ease-in-out;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .color-picker-container {
        padding: 20px;
        margin: 20px auto;
        max-width: 90%;
    }

    .color-picker-container h3 {
        font-size: 1.5em;
    }

    .color-picker-container p, .selected-color-info {
        font-size: 1em;
    }

    .color-spectrum-canvas {
        height: 250px;
    }

    .color-info-grid {
        grid-template-columns: 1fr; /* Stack columns on smaller screens */
        gap: 15px;
    }

    .coordinate-display-row {
        flex-direction: row; /* Keep coordinates side-by-side on smaller screens */
        gap: 8px; /* Reduced gap for smaller screens */
        justify-content: space-around; /* Distribute items evenly */
    }

    .coord-item {
        /* Adjusted flex-basis for 768px breakpoint */
        flex: 1 1 calc(50% - 4px); 
    }

    /* .action-button {
        padding: 10px 15px;
        font-size: 0.9em;
    } */
}

@media (max-width: 480px) {
    .color-picker-container {
        padding: 15px;
        margin: 15px auto;
    }

    .color-picker-container h3 {
        font-size: 1.3em;
    }

    .color-spectrum-canvas {
        height: 200px;
    }

    .coordinate-display-row {
        /* Changed to ensure they don't break out on very small screens */
        flex-direction: column; 
        gap: 10px;
    }
    .coord-item {
        /* Ensure full width and proper spacing when stacked */
        width: 100%; /* Explicitly set width to 100% */
        flex: none; /* Remove flex properties to avoid conflicts with width */
        max-width: 100%; /* Ensure it doesn't exceed parent width */
        padding: 0; /* Remove padding from coord-item itself */
    }

    .color-input, .coord-input {
        width: 100%; /* Ensure inputs fill their parent item */
        padding: 6px 8px; /* Slightly reduce padding for very small screens */
        font-size: 0.95em; /* Slightly smaller font size */
    }

    .info-group {
        padding: 10px 15px; /* Adjust padding of info-group for very small screens */
    }

    /* .action-button {
        width: 100%; 
        justify-content: center;
    } */

    /* .button-row {
        gap: 10px;
    } */
}
