/* ===================================
   PALETTE GENERATOR MODAL STYLES
   =================================== */

.palette-generator-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(6, 51, 18, 0.85);
    backdrop-filter: blur(8px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.palette-generator-modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.palette-modal-content {
    background: var(--halo);
    border-radius: 16px;
    padding: 32px;
    max-width: 800px;
    width: 85vw;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.palette-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.palette-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--depth);
}

.palette-modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: all 0.2s;
    color: var(--stone);
}

.palette-modal-close:hover {
    background: var(--veil);
    color: var(--depth);
}

.palette-input-section {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
}

.palette-color-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid var(--veil);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: var(--depth);
    background: white;
    transition: all 0.2s;
}

.palette-color-input:focus {
    outline: none;
    border-color: var(--bloom);
    box-shadow: 0 0 0 3px rgba(146, 239, 154, 0.1);
}

.palette-btn {
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.palette-btn-primary {
    background: var(--depth);
    color: var(--bloom);
}

.palette-btn-primary:hover {
    background: var(--grove);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(6, 51, 18, 0.2);
}

.palette-btn-secondary {
    background: var(--veil);
    color: var(--depth);
}

.palette-btn-secondary:hover {
    background: var(--mist);
    transform: translateY(-1px);
}

.palettes-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.palette-card {
    background: white;
    border: 2px solid var(--veil);
    border-radius: 12px;
    padding: 16px;
    transition: all 0.2s;
    max-width: 320px;
}

.palette-card:hover {
    border-color: var(--bloom);
    box-shadow: 0 8px 24px rgba(146, 239, 154, 0.15);
}

.palette-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--depth);
    margin-bottom: 12px;
}

.palette-colors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin-bottom: 12px;
}

.palette-color-swatch {
    aspect-ratio: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.palette-color-swatch:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.palette-icon-preview {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 55%;
    height: 55%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    pointer-events: none;
}

.palette-icon-preview svg {
    width: 100%;
    height: 100%;
}

.palette-icon-preview svg * {
    fill: var(--icon-color, rgba(255, 255, 255, 0.7)) !important;
    stroke: var(--icon-color, rgba(255, 255, 255, 0.7)) !important;
}

.palette-color-code {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 4px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.2s;
}

.palette-color-swatch:hover .palette-color-code {
    opacity: 1;
}

.palette-color-swatch:hover .palette-icon-preview {
    opacity: 0.3;
}

.palette-actions {
    display: flex;
    gap: 8px;
}

.palette-action-btn {
    flex: 1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.palette-save-btn {
    background: var(--bloom);
    color: var(--depth);
}

.palette-save-btn:hover {
    background: var(--depth);
    color: var(--bloom);
}

.palette-copy-btn {
    background: var(--veil);
    color: var(--depth);
}

.palette-copy-btn:hover {
    background: var(--mist);
}

/* My Palettes Section in Color Picker */
.my-palettes-container {
    padding-top: 12px;
    margin-top: 12px;
    border-top: 2px solid var(--veil);
}

.my-palettes-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.my-palettes-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--stone);
}

.generate-palettes-link {
    font-size: 11px;
    color: var(--depth);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
}

.generate-palettes-link:hover {
    background: var(--bloom);
    color: var(--depth);
}

/* Saved palettes grid now uses Tailwind classes in HTML */

.saved-palette-item {
    background: transparent;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s;
}

.saved-palette-item:hover {
    opacity: 0.9;
}

.saved-palette-colors {
    display: grid;
    grid-template-columns: repeat(9, 1fr);
    gap: 0;
    margin-bottom: 6px;
    border-radius: 18px;
    overflow: hidden;
}

.saved-palette-color {
    aspect-ratio: 1;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.saved-palette-color:first-child {
    border-radius: 18px 0 0 18px;
}

.saved-palette-color:last-child {
    border-radius: 0 18px 18px 0;
}

.saved-palette-color:hover {
    transform: scale(1.2);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    z-index: 10;
}

.saved-palette-icon-preview {
    position: absolute;
    width: 45%;
    height: 45%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.saved-palette-icon-preview svg {
    width: 100%;
    height: 100%;
    display: block;
}

.saved-palette-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.saved-palette-name {
    font-size: 11px;
    font-weight: 600;
    color: var(--depth);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    transition: all 0.2s;
    outline: none;
}

.saved-palette-name:hover {
    background: var(--veil);
}

.saved-palette-name[contenteditable="true"] {
    background: var(--bloom);
    color: var(--depth);
    cursor: text;
}

.saved-palette-delete {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: var(--stone);
    transition: all 0.2s;
    border-radius: 4px;
}

.saved-palette-delete:hover {
    background: rgba(255, 0, 0, 0.1);
    color: #ff0000;
}

/* Responsive */
@media (max-width: 768px) {
    .palettes-container {
        grid-template-columns: 1fr;
    }

    .palette-modal-content {
        width: 95vw;
        padding: 24px;
    }

    .palette-input-section {
        flex-direction: column;
    }

    /* Hide palette generator modal completely on mobile */
    .palette-generator-modal {
        display: none !important;
    }
}
