* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Roboto', sans-serif;
    min-height: 100%;
    background: linear-gradient(135deg, #f6ffd5 0%, #e8ffea 50%, #dfffdb 100%) fixed;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    width: 100%;
    min-height: calc(100vh - 40px);
    padding: 30px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.8);
    will-change: transform; /* Hardware acceleration hint */
    transform: translateZ(0); /* Force GPU acceleration */
}

.input-section {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-bottom: 40px;
    align-items: flex-start;
}

.input-container {
    position: relative;
    display: flex;
    gap: 15px;
    align-items: flex-start;
}

.toggle-container {
    display: flex;
    align-items: center;
}

.toggle-button {
    width: 45px;
    height: 45px;
    padding: 0;
    background: #4CAF50;
    border-radius: 8px;
    cursor: pointer;
    color: white;
    transition: background-color 0.3s;
    position: relative;
}

.toggle-button:hover {
    background-color: #45a049;
}

.toggle-button i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.3s, transform 0.3s;
}

.toggle-button .fa-keyboard {
    opacity: 0;
}

.toggle-button .fa-palette {
    opacity: 1;
}

.toggle-button.show-picker .fa-keyboard {
    opacity: 1;
}

.toggle-button.show-picker .fa-palette {
    opacity: 0;
}

.input-wrapper {
    display: none;
    flex-direction: column;
    gap: 5px;
}

.input-wrapper.active {
    display: flex;
}

#colorPicker {
    width: 250px;
    height: 45px;
    padding: 5px;
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.9);
}

.picked-color-code {
    font-family: 'Roboto', monospace;
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    text-align: center;
    background: rgba(255, 255, 255, 0.8);
    padding: 8px 12px;
    border-radius: 6px;
    border: 2px solid rgba(76, 175, 80, 0.2);
    margin-top: 8px;
}

input {
    font-family: 'Roboto', sans-serif;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid rgba(76, 175, 80, 0.3);
    border-radius: 8px;
    width: 250px;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

input:focus {
    outline: none;
    border-color: #4CAF50;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
}

button {
    padding: 12px 20px;
    font-size: 16px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
    will-change: transform;
}

button:hover {
    background-color: #45a049;
    transform: translateY(-1px);
}

button:active {
    transform: translateY(1px);
}

.shades-container {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
}

.shade-boxes {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    padding-bottom: 25px;
    will-change: transform; /* Optimize for animations */
}

.color-box {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    cursor: pointer;
    position: relative;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    will-change: transform;
    transform: translateZ(0);
    transition: transform 0.2s cubic-bezier(0.2, 0, 0.2, 1);
}

.color-box:hover {
    transform: scale(1.05) translateZ(0);
}

.color-box.clicked {
    transform: scale(0.95) translateZ(0);
}

.copy-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.2s;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.color-box:hover .copy-icon {
    opacity: 1;
}

.copy-icon .fa-copy {
    display: block;
}

.copy-icon .fa-check {
    display: none;
}

.copy-icon.copied .fa-copy {
    display: none;
}

.copy-icon.copied .fa-check {
    display: block;
}

.color-code {
    position: absolute;
    bottom: -25px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: rgba(255, 255, 255, 0.9);
    padding: 4px 8px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: 1;
}

.copied-tooltip {
    position: fixed;
    background-color: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 14px;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s;
    z-index: 1000;
}

.error-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.error-modal.show {
    display: flex;
}

.error-content {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 400px;
    width: 90%;
    text-align: center;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.error-message {
    color: #e74c3c;
    margin-bottom: 20px;
    font-size: 16px;
}

.error-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
}

.error-button:hover {
    background-color: #45a049;
}

.error-button:focus {
    outline: 2px solid #45a049;
    outline-offset: 2px;
}

h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #2c3e50;
    font-size: 2.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
}

h2 {
    margin-bottom: 15px;
    color: #444;
}

.lighter-shades,
.darker-shades {
    width: 100%;
}
