/* CKU full styles - Updated comprehensive stylesheet
   Includes: frontend layout, thumbnails, advanced per-file progress bars,
   remove button, status box, minicart previews, admin previews, responsive rules.
   Replace existing file with this exact content.
*/

/* --------------------------------------------------------
   Base container
   -------------------------------------------------------- */
#custom-keychain-section {
    margin: 15px 0;
    padding: 16px;
    background: #f8fdff;
    border-radius: 12px;
    border: 1px solid #e9f2fb;
    box-shadow: 0 6px 18px rgba(30,50,70,0.04);
    width: 100%;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: #0f1724;
}

/* --------------------------------------------------------
   Header
   -------------------------------------------------------- */
.upload-header {
    text-align: center;
    margin-bottom: 12px;
}

.upload-header h3 {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    color: #0f1724;
    margin: 0;
    font-weight: 700;
}

.upload-header p {
    margin: 6px 0 0 0;
    color: #556;
    font-size: 0.92rem;
}

/* --------------------------------------------------------
   Cards and layout
   -------------------------------------------------------- */
.upload-container {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.upload-card {
    flex: 1;
    min-width: 240px;
    max-width: 420px;
    background: #ffffff;
    border-radius: 10px;
    padding: 12px;
    border: 1px solid #eef7ff;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-sizing: border-box;
}

/* --------------------------------------------------------
   Upload button
   -------------------------------------------------------- */
.upload-btn {
    width: 100%;
    text-align: center;
    margin-bottom: 10px;
}

.upload-btn input[type="file"] {
    display: none;
}

.upload-btn label {
    background: linear-gradient(135deg,#6c5ce7,#8f7cfb);
    color: #fff;
    border-radius: 999px;
    padding: 10px 14px;
    cursor: pointer;
    display: inline-flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 20px rgba(99,102,241,0.12);
    transition: transform .16s ease, box-shadow .16s ease;
    font-weight: 600;
}

.upload-btn label:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(99,102,241,0.14);
}

.upload-btn label i {
    font-size: 16px;
}

/* --------------------------------------------------------
   Preview box
   -------------------------------------------------------- */
.image-preview {
    width: 100%;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fbfeff;
    border: 1px dashed #e7f2ff;
    border-radius: 8px;
    position: relative;
    padding: 8px;
    box-sizing: border-box;
    overflow: hidden;
}

.preview-placeholder {
    color: #cbd5e1;
    font-size: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.image-preview img {
    max-height: 120px;
    max-width: 100%;
    display: block;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    object-fit: contain;
}

/* --------------------------------------------------------
   Remove button (circular) - top-right
   -------------------------------------------------------- */
.cku-remove-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    border: none;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(239,68,68,0.18);
    cursor: pointer;
    z-index: 30;
    transition: transform .12s ease, box-shadow .12s ease;
}

.cku-remove-btn:hover {
    transform: translateY(-1px);
}

.cku-remove-btn:focus {
    outline: 3px solid rgba(239,68,68,0.16);
    outline-offset: 2px;
}

/* Hidden by default; shown by JS when needed */
.cku-remove-btn { display: none; }

/* --------------------------------------------------------
   Progress bar UI (modern)
   - upload-progress-bar: track container
   - upload-progress-fill: animated fill
   - upload-progress-text: percent label
   -------------------------------------------------------- */
.upload-progress-bar {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 10px;
    height: 10px;
    background: rgba(15,23,42,0.06);
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    z-index: 20;
}

.upload-progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg,#6c5ce7,#00c6ff);
    transition: width 220ms linear;
    box-shadow: 0 6px 18px rgba(0,198,255,0.08) inset;
}

.upload-progress-text {
    position: absolute;
    right: 12px;
    bottom: 14px;
    font-size: 11px;
    color: #0f1724;
    background: rgba(255,255,255,0.95);
    padding: 3px 7px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15,23,42,0.06);
    z-index: 25;
    font-weight: 600;
}

/* Small screens tweak */
@media (max-width: 640px) {
    .upload-progress-text { font-size: 10px; right: 8px; bottom: 12px; }
    .upload-card { min-width: calc(50% - 8px); }
}

/* --------------------------------------------------------
   Status box
   -------------------------------------------------------- */
.upload-status {
    margin-top: 14px;
    padding: 10px 12px;
    border-radius: 10px;
    background: #f0fbff;
    border: 1px solid #dff3ff;
    color: #0f1724;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.upload-status i { color: #0f1724; }

.upload-status .hint { font-weight: 600; color: #456; font-size: 13px; font-weight: 600; }

/* status states */
.status-success { background: #ecfdf5; border-color: #d1fae5; color: #065f46; }
.status-error { background: #fff1f2; border-color: #ffe4e6; color: #9f1239; }

/* --------------------------------------------------------
   Special instructions & WhatsApp input styles
   -------------------------------------------------------- */
.special-instructions,
.whatsapp-section {
    width: 100%;
    margin-top: 14px;
    padding: 12px;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #eef7ff;
    box-sizing: border-box;
}

.instructions-header,
.whatsapp-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.instructions-header h4,
.whatsapp-header h4 {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #0f1724;
}

.instructions-input input,
.whatsapp-input input {
    width: 100%;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid #d1d9e6;
    font-size: 14px;
    box-sizing: border-box;
    transition: box-shadow .12s ease, border-color .12s ease;
}

.instructions-input input:focus,
.whatsapp-input input:focus {
    outline: none;
    border-color: #6c5ce7;
    box-shadow: 0 8px 20px rgba(108,92,231,0.08);
}

/* hints */
.hint { font-size: 0.85rem; color: #6b7280; }

/* --------------------------------------------------------
   Minicart preview & cart item values
   -------------------------------------------------------- */
.custom-image-preview { margin-top: 6px; display:flex; align-items:center; gap:8px; }
.custom-image-preview img { max-width: 70px; height: auto; border-radius: 6px; border: 1px solid #e6eef6; }

/* Mini cart specific small preview */
.minicart-image-preview { display:flex; align-items:center; gap:8px; font-size:12px; color:#374151; }
.minicart-image-preview img { max-width:36px; border-radius:6px; border:1px solid #e2e8f0; }

/* --------------------------------------------------------
   Admin preview styles (Orders)
   -------------------------------------------------------- */
.custom-image-admin-preview {
    margin-top: 12px;
    padding: 12px;
    background: #fff;
    border: 1px solid #e9eef6;
    border-radius: 8px;
    max-width: 320px;
    box-sizing: border-box;
}

.custom-image-admin-preview img { max-width: 140px; height: auto; border-radius:6px; border:1px solid #ddd; display:block; }

/* order item preview larger */
.custom-image-order-preview { display:inline-block; margin-top: 12px; padding: 12px; background: #fff; border-radius: 8px; border:1px solid #eaeaea; }
.custom-image-order-preview img { max-width:120px; height:auto; border-radius:5px; border:1px solid #ddd; }

/* --------------------------------------------------------
   Buttons & helpers
   -------------------------------------------------------- */
.reselect-images-button {
    display: inline-block;
    background: #0f1724;
    color: #fff !important;
    border-radius: 999px;
    padding: 7px 20px;
    font-size: 12px;
    text-decoration: none;
    transition: transform .12s ease;
}

.delete-custom-image {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: white !important;
    padding: 6px 10px !important;
    font-size: 12px !important;
    border-radius: 6px;
}

/* --------------------------------------------------------
   Accessibility and focus states
   -------------------------------------------------------- */
.upload-btn label:focus,
.upload-btn label:active,
.cku-remove-btn:focus {
    outline: 3px solid rgba(108,92,231,0.12);
    outline-offset: 2px;
}

/* --------------------------------------------------------
   Responsive and print
   -------------------------------------------------------- */
@media (max-width: 768px) {
    .upload-container { gap: 12px; }
    .upload-card { min-width: calc(50% - 10px); }
}

@media (max-width: 480px) {
    .upload-card { min-width: 47%; padding: 10px; }
    .upload-header h3 { font-size: 1rem; }
}

@media print {
    #custom-keychain-section, .upload-status, .cku-remove-btn, .upload-progress-bar { display: none !important; }
}

/* --------------------------------------------------------
   Utility classes
   -------------------------------------------------------- */
.cku-hidden { display: none !important; visibility: hidden; }
.cku-inline-flex { display: inline-flex !important; align-items: center; gap: 6px; }

/* End of CKU stylesheet */