/**
 * QN-EIN POD Photo Uploader Styles
 * Version: 0.1.0
 * Reference: wearfelicity.com PDP uploader
 */

/* =========== Container =========== */
.qnein-pod-uploader {
    margin: 20px 0;
    padding: 16px;
    background: #fafafa;
    border: 1px dashed #d0d0d0;
    border-radius: 6px;
    text-align: center;
}

.qnein-pod-uploader__title {
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 600;
    color: #2c2c2c;
}

.qnein-pod-uploader__hint {
    margin: 8px 0 0;
    font-size: 12px;
    color: #888;
    line-height: 1.5;
}

/* =========== Upload Button =========== */
.qnein-pod-upload-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: #2c2c2c;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.qnein-pod-upload-btn:hover {
    background: #97243a;
}

.qnein-pod-upload-btn.is-uploaded {
    background: #166534;
    cursor: default;
}

.qnein-pod-upload-btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.qnein-pod-upload-btn__text {
    line-height: 1;
}

.qnein-pod-upload-wrap {
    position: relative;
    display: inline-block;
}

.qnein-pod-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* =========== Preview =========== */
.qnein-pod-preview {
    margin-top: 16px;
    display: none;
}

.qnein-pod-preview.is-visible {
    display: block;
}

.qnein-pod-preview__image {
    max-width: 180px;
    max-height: 180px;
    border-radius: 50%;
    border: 2px solid #e6bab9;
    object-fit: cover;
    margin: 0 auto;
    display: block;
}

.qnein-pod-preview__actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
    justify-content: center;
}

.qnein-pod-preview__btn {
    padding: 6px 14px;
    background: transparent;
    color: #2c2c2c;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.qnein-pod-preview__btn:hover {
    background: #f3f3f3;
    border-color: #2c2c2c;
}

.qnein-pod-preview__btn--danger {
    color: #97243a;
    border-color: #f3c4cb;
}

.qnein-pod-preview__btn--danger:hover {
    background: #fceef0;
    border-color: #97243a;
}

/* =========== Modal =========== */
.qnein-pod-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.7);
}

.qnein-pod-modal.is-active {
    display: flex;
}

.qnein-pod-modal__dialog {
    position: relative;
    width: 90%;
    max-width: 640px;
    max-height: 90vh;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.qnein-pod-modal__header {
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.qnein-pod-modal__title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #2c2c2c;
}

.qnein-pod-modal__close {
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
}

.qnein-pod-modal__close:hover {
    color: #2c2c2c;
}

.qnein-pod-modal__body {
    flex: 1;
    overflow: auto;
    padding: 20px;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qnein-pod-modal__body img {
    max-width: 100%;
    max-height: 60vh;
    display: block;
}

.qnein-pod-modal__footer {
    padding: 14px 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.qnein-pod-modal__btn {
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.qnein-pod-modal__btn--secondary {
    background: #f3f3f3;
    color: #2c2c2c;
}

.qnein-pod-modal__btn--secondary:hover {
    background: #e5e5e5;
}

.qnein-pod-modal__btn--primary {
    background: #2c2c2c;
    color: #fff;
}

.qnein-pod-modal__btn--primary:hover {
    background: #97243a;
}

.qnein-pod-modal__btn--primary:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* =========== Loading =========== */
.qnein-pod-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: #888;
    font-size: 14px;
}

.qnein-pod-loading__spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e5e5;
    border-top-color: #2c2c2c;
    border-radius: 50%;
    animation: qnein-pod-spin 0.8s linear infinite;
}

@keyframes qnein-pod-spin {
    to { transform: rotate(360deg); }
}

/* =========== Progress Bar =========== */
.qnein-pod-progress {
    width: 100%;
    height: 6px;
    background: #e5e5e5;
    border-radius: 3px;
    overflow: hidden;
    margin: 10px 0;
}

.qnein-pod-progress__bar {
    width: 0%;
    height: 100%;
    background: #22c55e;
    border-radius: 3px;
    transition: width 0.2s ease;
}

/* =========== Toast =========== */
#qnein-pod-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 380px;
    width: calc(100% - 40px);
    pointer-events: none;
}

.qnein-pod-toast {
    pointer-events: auto;
    padding: 14px 18px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: qnein-pod-toast-in 0.3s ease;
    font-family: inherit;
}

.qnein-pod-toast--error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.qnein-pod-toast--success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.qnein-pod-toast--warning {
    background: #fffbeb;
    color: #92400e;
    border: 1px solid #fde68a;
}

.qnein-pod-toast--info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

.qnein-pod-toast__icon {
    flex-shrink: 0;
    font-size: 16px;
}

.qnein-pod-toast__content {
    flex: 1;
}

.qnein-pod-toast__close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    opacity: 0.6;
}

.qnein-pod-toast__close:hover {
    opacity: 1;
}

@keyframes qnein-pod-toast-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========== Engraving Field =========== */
.qnein-pod-engraving {
    margin-top: 16px;
    text-align: left;
}

.qnein-pod-engraving__label {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #2c2c2c;
}

.qnein-pod-engraving__input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    font-size: 14px;
    font-family: inherit;
}

.qnein-pod-engraving__input:focus {
    outline: none;
    border-color: #2c2c2c;
}

.qnein-pod-engraving__counter {
    margin-top: 4px;
    font-size: 11px;
    color: #888;
    text-align: right;
}

/* =========== Personalized Note =========== */
.qnein-pod-note {
    text-align: center;
    font-size: 12px;
    padding: 10px 0 0;
    line-height: 1.6;
}

.qnein-pod-note__title {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #2c2c2c;
    margin-bottom: 4px;
}

.qnein-pod-note__shipping {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: #666;
    font-size: 12px;
}

.qnein-pod-note__icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: #888;
}

/* =========== Mobile =========== */
@media (max-width: 768px) {
    .qnein-pod-uploader {
        padding: 12px;
    }
    .qnein-pod-upload-btn {
        width: 100%;
        justify-content: center;
    }
    .qnein-pod-modal__dialog {
        width: 95%;
        max-height: 95vh;
    }
    .qnein-pod-preview__image {
        max-width: 140px;
        max-height: 140px;
    }
}
