* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    pointer-events: none;
    background-color: #1a1a1a;
}

body {
    background-color: transparent;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding-top: 40px;
    position: relative;
}

.logo-container {
    margin-bottom: 40px;
}

.logo {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: clamp(24px, 5vw, 42px);
    font-weight: 700;
    margin: 0;
    color: #fff; /* Cor base para o texto branco */
    filter: drop-shadow(0 0 8px rgba(166, 71, 255, 0.4));
    text-align: center;
    word-wrap: break-word;
    min-height: 1.2em;
    display: inline-block;
}

/* Classes para cores parciais na animação */
.logo .white-text {
    color: #fff;
}

.logo .purple-text {
    color: #8f18ff;
}

.logo::after {
    content: '|';
    margin-left: 2px;
    color: #8f18ff;
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

.color-picker-container {
    width: 800px;
    max-width: 95%;
    background-color: #202124;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(200, 200, 200, 0.15);
    border: 1px solid #5f6368;
    padding-bottom: 20px;
    margin: 0 auto;
}

.main-panel {
    display: flex;
    height: 400px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Footer */
.site-footer {
    margin-top: 20px;
    padding-bottom: 30px;
    text-align: center;
    color: #9aa0a6;
    font-size: 14px;
}

.author-link {
    color: #a855f7;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.author-link:hover {
    color: #c084fc;
    text-shadow: 0 0 10px rgba(168, 85, 247, 0.5);
}

/* Responsividade */
@media (max-width: 850px) {
    .color-picker-container {
        width: 100%;
        max-width: 500px;
    }

    .logo {
        font-size: clamp(26px, 8vw, 40px);
        padding: 0 10px;
        margin-top: -5px;
        margin-bottom: -5px;
    }

    .main-panel {
        flex-direction: column;
        height: auto;
    }

    .color-preview {
        height: 80px !important;
        width: 100% !important;
        flex: none !important;
    }

    .sv-picker {
        height: 250px !important;
        width: 100% !important;
        flex: none !important;
    }

    /* FORÇAR EMPILHAMENTO VERTICAL TOTAL */
    .other-values-row {
        display: flex !important;
        flex-direction: column !important;
        grid-template-columns: none !important;
        gap: 12px !important;
    }

    .value-item {
        width: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        padding: 12px !important;
        border-radius: 8px !important;
    }

    .value-item .label {
        margin-bottom: 6px !important;
        margin-right: 0 !important;
        text-align: center !important;
        width: 100% !important;
    }

    .value-item .value-box {
        text-align: center !important;
        width: 100% !important;
        font-size: 16px !important;
    }
}

@media (max-width: 580px) {
    body {
        padding-top: 20px;
        padding-bottom: 40px; /* Margem no fim do site */
    }

    .logo {
        font-size: clamp(26px, 8vw, 40px);
        padding: 0 10px;
        margin-top: 5px;
        margin-bottom: -5px;
    }

    .color-picker-container {
        margin: 0 15px 30px 15px; /* Margem lateral e inferior */
        width: calc(100% - 30px);
    }

    .color-values-container {
        padding: 0 15px 10px 15px;
    }
    
    .hue-slider-container {
        padding: 15px;
    }

    .sv-picker {
        height: 200px !important;
    }
}

@media (max-width: 350px) {
    .value-item .value-box {
        font-size: 13px;
    }

    .hex-value {
        font-size: 18px;
    }

    .value-item .label {
        min-width: 70px;
        font-size: 10px;
    }
}

.color-preview {
    flex: 1;
    background-color: #ff0000;
}

.sv-picker {
    flex: 2;
    position: relative;
    background-color: #ff0000; /* Will be updated by hue slider */
    cursor: crosshair;
}

.sv-white {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to right, #fff, rgba(255,255,255,0));
}

.sv-black {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to top, #000, rgba(0,0,0,0));
}

.sv-cursor {
    position: absolute;
    width: 12px;
    height: 12px;
    border: 2px solid #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.hue-slider-container {
    padding: 20px 30px;
}

.hue-slider {
    -webkit-appearance: none;
    width: 100%;
    height: 12px;
    border-radius: 6px;
    outline: none;
    background: linear-gradient(to right, 
        #ff0000 0%, #ffff00 17%, #00ff00 33%, 
        #00ffff 50%, #0000ff 67%, #ff00ff 83%, #ff0000 100%);
}

.hue-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #fff;
    cursor: pointer;
    border: 2px solid #202124;
    box-shadow: 0 0 2px rgba(0,0,0,0.5);
}

.color-values-container {
    padding: 0 30px 10px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.hex-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #3c4043;
    border-radius: 8px;
    padding: 12px;
    position: relative;
    background-color: transparent;
}

.hex-display-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.value-box-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    justify-content: center;
}

.copy-btn {
    background: none;
    border: none;
    color: #9aa0a6;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s, color 0.2s;
}

.copy-btn.mini {
    padding: 2px;
}

.copy-btn:hover {
    background-color: rgba(255,255,255,0.1);
    color: #fff;
}

.label {
    font-size: 11px;
    color: #9aa0a6;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 500;
}

.value-box {
    font-size: 16px;
    color: #e8eaed;
}

.hex-value {
    font-size: 20px;
    font-weight: 500;
}

.other-values-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.value-item {
    border: 1px solid #3c4043;
    border-radius: 4px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0; /* Prevents overflow */
}

.value-item .value-box {
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    width: 100%;
    text-align: center;
}
