body {
    margin: 0;
    padding: 40px 20px 100px 20px;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4e8eb 100%);
    min-height: 100vh;
}

.container {
    text-align: center;
    max-width: 1200px;
    margin: 0 auto;
}

.main-section {
    text-align: center;
    margin-bottom: 40px;
    background: #f8f9fb;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

h1 {
    margin: 0 0 30px 0;
    color: #1a1a1a;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

#color-display {
    width: 100%;
    height: 360px;
    margin: 30px auto;
    border-radius: 24px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.hex-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 8px;
}

.color-picker-label {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transition: all 0.3s ease;
    margin-top: 4px;
}

.color-picker-label:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.05);
}

.color-picker-label span {
    color: white;
    font-size: 24px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.color-text-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.2));
    backdrop-filter: blur(2px);
    padding: 24px;
}

#color-name {
    font-size: 56px;
    font-weight: 700;
    color: white;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    margin-bottom: 8px;
    text-align: center;
    line-height: 1.2;
}

#hex-value {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 32px;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
}

.color-actions {
    display: flex;
    gap: 16px;
    margin-top: 8px;
}

.icon-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.icon-button:hover {
    background: rgba(255, 255, 255, 0.3);
}

.icon-button span.material-symbols-rounded {
    font-size: 24px;
    color: white;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-variation-settings:
        'FILL' 0,
        'wght' 400,
        'GRAD' 0,
        'opsz' 24;
}

.color-picker-wrapper {
    position: relative;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.color-picker-wrapper button {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    pointer-events: none;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

#color-picker {
    position: absolute;
    top: 0;
    left: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
    z-index: 1;
}

#color-picker::-webkit-color-swatch-wrapper {
    padding: 0;
}

#color-picker::-webkit-color-swatch {
    border: none;
    border-radius: 50%;
}

/* Firefox */
#color-picker::-moz-color-swatch {
    border: none;
    border-radius: 50%;
}

.button-group {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: center;
    margin: 30px auto;
    background: #f8f9fb;
    padding: 24px;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    max-width: fit-content;
}

.button-group.fixed-bottom,
.fixed-bottom {
    display: none;
}

button {
    font-size: 16px;
    font-weight: 500;
    background: #4f46e5;
    color: white;
    border: none;
    padding: 14px 28px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    letter-spacing: 0.3px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background: #4338ca;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.2);
}

#variations {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-template-rows: repeat(4, auto);
    gap: 24px;
    padding: 32px;
    background: #f8f9fb;
    border-radius: 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.variation-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.variation-card:hover {
    transform: scale(1.03);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.variation-color {
    width: 100%;
    height: 100px;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.variation-info {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.variation-hex {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 14px;
    color: #1a1a1a;
}

.variation-name {
    font-size: 14px;
    color: #4a4a4a;
    line-height: 1.3;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.variation-label {
    font-size: 13px;
    color: #666;
    margin-top: 6px;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
}

#name-to-hex-form {
    width: 100%;
}

#name-input-container {
    margin-top: 24px;
    background: white;
    border-radius: 16px;
    padding: 16px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    max-width: 400px;
}

#name-input-container.hidden {
    height: 0;
    margin-top: 0;
}

.action-buttons {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    margin-bottom: 16px;
    align-items: center;
}

#name-to-hex-form {
    background: rgba(0, 0, 0, 0.2);
    padding: 2px;
    border-radius: 8px;
}

#color-name-input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.2s;
    background: rgba(255, 255, 255, 0.95);
    color: #1a1a1a;
}

#color-name-input::placeholder {
    color: #666;
}

#color-name-input:focus {
    outline: none;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#name-result {
    margin-top: 12px;
    display: flex;
    gap: 12px;
    align-items: center;
    background: rgba(0, 0, 0, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
}

#name-result-color {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

#name-result-hex {
    font-family: 'SF Mono', 'Fira Code', monospace;
    font-size: 15px;
    color: white;
}

.hidden {
    display: none;
}

.help-button {
    position: absolute;
    right: 16px;
    top: 16px;
    width: 36px;
    height: 36px;
    min-width: 36px;
    min-height: 36px;
    background: rgba(0, 0, 0, 0.1);
}

.help-button:hover {
    background: rgba(0, 0, 0, 0.15);
}

.help-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 16px;
    margin: 16px 0;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.1);
    text-align: left;
    opacity: 0;
}

.help-content.visible {
    max-height: 1200px;
    opacity: 1;
    transition: max-height 0.5s ease-in, opacity 0.3s ease-in;
}

.help-section {
    padding: 24px;
    font-size: 15px;
    line-height: 1.5;
    max-height: 70vh;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.help-section::-webkit-scrollbar {
    width: 6px;
}

.help-section::-webkit-scrollbar-track {
    background: transparent;
}

.help-section::-webkit-scrollbar-thumb {
    background-color: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

@media (max-width: 768px) {
    .help-section {
        max-height: 60vh;
        padding: 20px;
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    body {
        padding: 20px 16px 90px 16px;
    }
    
    .container {
        min-height: calc(100vh - 110px);
    }
    
    #color-display {
        min-height: 280px;
        padding: 24px;
        border-radius: 20px;
    }
    
    .color-text-overlay {
        gap: 8px;
    }
    
    #color-name {
        font-size: 24px;
        line-height: 1.3;
    }
    
    #hex-value {
        font-size: 18px;
    }
    
    .icon-button {
        width: 36px;
        height: 36px;
        min-width: 36px;
        min-height: 36px;
    }
    
    .icon-button span {
        font-size: 20px;
    }
    
    .button-group {
        padding: 16px;
        border-radius: 20px;
        flex-wrap: wrap;
    }
    
    #variations {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 20px;
    }
    
    .variation-color {
        height: 80px;
    }
    
    .variation-hex {
        font-size: 12px;
    }
    
    .variation-name {
        font-size: 12px;
    }
    
    #name-input-container {
        margin-top: 20px;
        padding: 12px;
    }
    
    #color-name-input {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    #name-result {
        margin-top: 10px;
        gap: 12px;
    }
    
    #name-result-color {
        width: 40px;
        height: 40px;
    }
    
    #name-result-hex {
        font-size: 14px;
    }
    
    .help-button {
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
    }
    
    .help-section {
        padding: 20px;
        font-size: 14px;
    }
    
    .help-section h4 {
        font-size: 16px;
    }
    
    .action-buttons {
        margin-top: 12px;
        margin-bottom: 12px;
    }
    
    #color-name-input {
        padding: 10px 14px;
        font-size: 15px;
    }
    
    #name-result {
        margin-top: 10px;
        padding: 6px 10px;
    }
    
    #name-result-color {
        width: 28px;
        height: 28px;
    }
    
    #name-result-hex {
        font-size: 14px;
    }
}

.variations-message {
    text-align: center;
    color: #4a4a4a;
    font-size: 15px;
    margin: 24px 0 16px;
    font-weight: 500;
}

@media (max-width: 768px) {
    .variations-message {
        font-size: 14px;
        margin: 20px 0 12px;
    }
}

.site-footer {
    text-align: center;
    padding: 24px 20px;
    color: #666;
    font-size: 14px;
    margin-top: 40px;
}

.site-footer a {
    color: #1a1a1a;
    text-decoration: none;
    transition: color 0.2s;
}

.site-footer a:hover {
    color: #0066cc;
}

@media (max-width: 768px) {
    .site-footer {
        padding: 20px 16px;
        margin-top: 32px;
        font-size: 13px;
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }
}

/* Add smooth scrolling */
html {
    scroll-behavior: smooth;
}
