/**
 * WP Simple Color Frontend Styles - Final Version for Modal UI
 */

.wpsc-manager-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e7eb;
}

.wpsc-manager-header h2 {
    margin: 0;
    font-size: 20px;
}

.wpsc-open-modal-btn {
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 3px 15px;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .2s;
}

.wpsc-open-modal-btn:hover {
    background-color: #1d4ed8;
}

.wpsc-action-btn {
    display: inline-flex;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    font-size: 12px;
    border-radius: 8px;
    cursor: pointer;
    /* border: 1px solid #b9b9b9; */
    background: none;
    text-decoration: none;
    color: #c9c9c9;
    transition: all 0.2s ease;
    align-items: center;
}

.wpsc-action-btn:hover {
    background-color: #e9ecef;
    color: #007bff;
}

.wpsc-delete-btn:hover {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fca5a5;
}

.wpsc-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, .6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s .3s;
}

.wpsc-modal-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.wpsc-modal-overlay .wpsc-card {
    transform: translateY(20px) scale(.95);
    transition: transform .3s ease;
}

.wpsc-modal-overlay.is-visible .wpsc-card {
    transform: translateY(0) scale(1);
}

.wpsc-card-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    padding: 0;
    margin: 20px;
    width: 100%;
    max-width: 420px;
}

.wpsc-card {
    background-color: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    overflow: hidden;
}

.wpsc-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.wpsc-card-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #111827;
}

.wpsc-card-close {
    background: 0 0;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
}

.wpsc-card-body {
    padding: 24px;
}

.wpsc-form-group {
    margin-bottom: 20px;
}

.wpsc-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 8px;
}

.wpsc-form-group input[type=text] {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 16px;
    box-sizing: border-box;
}

.wpsc-form-group input[type=text]:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, .2);
    outline: none;
}

.wpsc-save-button {
    width: 100%;
    background-color: #2563eb;
    color: #fff;
    border: none;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .2s;
}

.wpsc-save-button:hover {
    background-color: #1d4ed8;
}

.wpsc-color-adder {
  display: flex;
  align-items: center;
  gap: 8px; /* jarak antara input dan tombol */
}



.wpsc-color-adder #wpsc-add-swatch-btn {
  padding: 0px 25px;
  font-size: 18px;
  border: none;
  border-radius: 5px;
  background-color: #0073aa;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.3s ease;
}
.clr-field input[type="text"] {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #ccc;
    border-radius: 8px;
}
.wpsc-color-adder .clr-field {
  flex: 1; /* Biar input memanjang */
  display: flex;
  align-items: center;
}
#wpsc-add-swatch-btn:hover {
    background-color: #005c8a;
}

.wpsc-palette-preview-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px;
    border: 1px dashed #d1d5db;
    border-radius: 8px;
    min-height: 60px;
    background-color: #f9fafb;
    margin-top: 10px;
    justify-content: center;
}

.wpsc-palette-swatch {
    width: 100px;
    height: 40px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    font-family: monospace;
    font-size: 14px;
    color: white;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.wpsc-remove-swatch {
    /* Hapus 'position', 'top', 'right' */
    background: transparent;    /* Latar belakang transparan secara default */
    color: white;               /* Warna 'x' disesuaikan dengan warna teks */
    border: none;
    border-radius: 50%;
    padding: 0px 5px;
    margin: 3px;
    line-height: 22px;
    text-align: center;
    font-size: 20px;            /* Ukuran 'x' sedikit diperbesar */
    font-weight: normal;
    cursor: pointer;
    opacity: 0.7;               /* Sedikit transparan secara default agar tidak terlalu mencolok */
    transition: all 0.2s ease-in-out; /* Transisi untuk semua efek */
    flex-shrink: 0;
}

.wpsc-palette-swatch:hover .wpsc-remove-swatch {
    transform: scale(1.1);
    background-color: #dc3545;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Wadah utama untuk palet baru */
.wpsc-palette-display-container {
    display: flex;
    height: 70px;
    margin: 20px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    border: 1px solid #e5e7eb;
}

/* Blok warna individual */
.wpsc-palette-display-block {
    display: flex;
    box-shadow: inset hsla(250, 3%, 0%, 0.05) 0 1px, inset hsla(250, 3%, 0%, 0.05) 0 -1px;
    flex-grow: 1;
    transition: all 0.1s ease-in-out;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    flex-basis: 1px;
    align-items: center;
    justify-content: space-around;
}

/* Efek hover untuk memperbesar blok warna */
.wpsc-palette-display-block:hover {
    flex-basis: 80px; /* Perbesar sedikit blok yang di-hover */
}

/* Teks kode HEX */
.wpsc-palette-display-code {
    font-family: monospace;
    font-weight: 700;
    font-size: 14px;
    opacity: 0; /* Sembunyikan secara default */
    transition: opacity 0.3s ease;
    pointer-events: none; /* Agar tidak mengganggu event hover pada parent */
}

/* Tampilkan kode HEX saat blok warna di-hover */
.wpsc-palette-display-block:hover .wpsc-palette-display-code {
    opacity: 1;
}

/* Kelas untuk warna teks terang dan gelap yang akan ditambahkan oleh JavaScript */
.wpsc-text-light {
    color: #ffffff;
}

.wpsc-text-dark {
    color: #000000;
}

/* Wadah Grid Utama */
.wpsc-palette-grid-container {
    display: grid;
    /* Membuat kolom responsif: minimal 280px, dan akan mengisi sisa ruang */
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 15px;
    margin-top: 24px;
}

/* Gaya untuk setiap kartu palet */
.wpsc-palette-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background-color: #fff;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Menggunakan kembali tampilan palet baris, disesuaikan untuk kartu */
.wpsc-palette-card .wpsc-palette-display-container {
    height: 100px;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    border: none;
    border-bottom: 1px solid #e5e7eb;
}

/* Footer Kartu */
.wpsc-palette-card-footer {
    padding: 3px 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: #f9fafb;
}

.wpsc-palette-card-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    flex-grow: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wpsc-palette-card-actions {
    display: flex;
    gap: 1px;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
}
.wpsc-palette-empty-state {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    font-size: 14px;
    background-color: #f9fafb;
}
/*
 * WP Simple Color Notice Pop-up Styles
 */
.wpsc-notice-popup {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    border: 1px solid transparent;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    z-index: 9999;
    font-size: 15px;
    max-width: 350px;
    /* Properti untuk transisi */
    opacity: 0;
    transform: translateY(20px);
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.21, 1.02, 0.73, 1);
}

.wpsc-notice-popup.is-visible {
    opacity: 1;
    transform: translateY(0);
    visibility: visible;
}

.wpsc-notice-popup p {
    margin: 0;
    padding: 0;
}

/* Success Notice */
.wpsc-notice-popup.success {
    background-color: #d1fae5;
    border-color: #6ee7b7;
    color: #065f46;
}

/* Error Notice */
.wpsc-notice-popup.error {
    background-color: #fee2e2;
    border-color: #fca5a5;
    color: #991b1b;
}
/* Inline error message style */
.wpsc-inline-error {
    font-size: 13px;
    color: #b91c1c; /* Red 800 */
    margin-top: 6px;
}
/*
 * Custom Confirmation Modal Styles
 */
.wpsc-confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(17, 24, 39, .6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1001; /* Lebih tinggi dari modal utama */
    opacity: 0;
    visibility: hidden;
    transition: opacity .3s ease, visibility 0s .3s;
}

.wpsc-confirm-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transition-delay: 0s;
}

.wpsc-confirm-modal {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .15);
    transform: translateY(20px) scale(.95);
    transition: transform .3s ease;
}

.wpsc-confirm-overlay.is-visible .wpsc-confirm-modal {
    transform: translateY(0) scale(1);
}

.wpsc-confirm-modal h3 {
    margin-top: 0;
    margin-bottom: 8px;
    font-size: 20px;
    color: #111827;
}

.wpsc-confirm-modal p {
    margin-top: 0;
    margin-bottom: 24px;
    color: #6b7280;
    font-size: 15px;
}

.wpsc-confirm-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.wpsc-confirm-actions button {
    width: 100px;
    border: none;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color .2s;
}

.wpsc-button-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.wpsc-button-secondary:hover {
    background-color: #d1d5db;
}

.wpsc-button-danger {
    background-color: #ef4444; /* Red 500 */
    color: #fff;
}

.wpsc-button-danger:hover {
    background-color: #dc2626; /* Red 600 */
}
/*
 * Color Picker Wrapper Layout Styles
 */
.wpsc-color-adder .clr-field {
  flex: 1; /* Membuat input dan swatch-nya memenuhi ruang yang tersedia */
}

/* Penyesuaian agar tombol swatch Coloris terlihat bagus */
.wpsc-color-adder .clr-field .clr-picker-button {
  width: 38px;
  height: 38px;
  right: 1px;
  top: 1px;
  bottom: 1px;
  border-radius: 8px;
}

/* Penyesuaian agar input tidak tertutup oleh tombol swatch */
.wpsc-color-adder .clr-field #wpsc-staging-color {
  padding-right: 45px !important;
}
/*
 * Dropdown Actions Styles
 */
.wpsc-palette-card-actions {
    position: relative; /* Penting untuk positioning pop-up agar relatif terhadap wadah ini */
}

.wpsc-actions-popup {
    display: none; /* Sembunyikan pop-up secara default */
    position: absolute;
    top: 100%; /* Posisi pop-up tepat di bawah tombol induknya */
    right: 0;
    z-index: 10;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e5e7eb;
    min-width: 140px;
    padding: 6px;
    margin-top: 4px;
}

/* Kelas ini ditambahkan oleh JavaScript untuk menampilkan pop-up */
.wpsc-actions-popup.is-active {
    display: block; 
}

/* Gaya untuk setiap tombol di dalam pop-up (Edit, Delete) */
.wpsc-popup-action-btn {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 8px 12px;
    border: none;
    background: none;
    text-align: left;
    font-size: 14px;
    cursor: pointer;
    border-radius: 6px;
    color: #374151;
    transition: background-color 0.2s;
}

.wpsc-popup-action-btn:hover {
    background-color: #f3f4f6; /* Warna latar saat di-hover */
}

/* Gaya untuk ikon di dalam tombol pop-up */
.wpsc-popup-action-btn .fa-solid {
    margin-right: 10px;
    width: 16px;
    text-align: center;
    color: #9ca3af;
}

/* Gaya khusus untuk tombol hapus saat di-hover */
.wpsc-popup-action-btn.wpsc-delete-btn:hover {
    background-color: #fee2e2;
    color: #b91c1c;
}

.wpsc-popup-action-btn.wpsc-delete-btn:hover .fa-solid {
    color: #ef4444;
}