/* =========================================================
   PLAYER CREATOR
   ========================================================= */

.pc-app {
    display: flex;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* ---- Controls panel ---- */
.pc-controls {
    flex: 0 0 400px;
    max-width: 400px;
}

.pc-page-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #111;
}

.pc-page-desc {
    font-size: 14px;
    color: #666;
    margin: 0 0 28px;
}

.pc-section {
    margin-bottom: 24px;
}

.pc-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.pc-sublabel {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
}

/* ---- Inputs ---- */
.pc-input {
    display: block;
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fff;
    color: #111;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.pc-input:focus {
    border-color: #333;
}

.pc-hint {
    display: block;
    font-size: 12px;
    color: #888;
    margin-top: 6px;
}

/* ---- Timestamp row ---- */
.pc-timestamp-row {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.pc-time-field {
    flex: 1;
}

.pc-time-sep {
    font-size: 13px;
    color: #999;
    padding-bottom: 12px;
    flex-shrink: 0;
}

/* ---- Image upload ---- */
.pc-upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    cursor: pointer;
    overflow: hidden;
    transition: border-color 0.2s, background 0.2s;
    position: relative;
    min-height: 180px;
}

.pc-upload-area:hover,
.pc-upload-area.drag-over {
    border-color: #666;
    background: #fafafa;
}

.pc-upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

.pc-upload-preview {
    max-height: 400px;
    overflow: hidden;
}

.pc-upload-preview img {
    display: block;
    width: 100%;
    max-height: 400px;
    object-fit: contain;
}

.pc-crop-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.pc-btn-sm {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
}

.pc-btn-confirm {
    background: #111;
    color: #fff;
}

.pc-btn-confirm:hover { background: #333; }

.pc-btn-cancel {
    background: #e8e8e8;
    color: #333;
}

.pc-btn-cancel:hover { background: #ddd; }

/* ---- Filters ---- */
.pc-filter-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pc-filter-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 4px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    transition: border-color 0.2s;
    width: 70px;
}

.pc-filter-btn:hover { border-color: #ccc; }

.pc-filter-btn.active { border-color: #111; }

.pc-filter-thumb {
    width: 56px;
    height: 56px;
    border-radius: 4px;
}

.pc-filter-name {
    font-size: 10px;
    color: #555;
    text-align: center;
    line-height: 1.2;
}

.pc-filter-btn.active .pc-filter-name {
    color: #111;
    font-weight: 600;
}

/* ---- Search ---- */
.pc-search-wrap {
    position: relative;
}

.pc-search-results {
    position: absolute;
    z-index: 100;
    top: 100%;
    left: 0;
    right: 0;
    max-height: 360px;
    overflow-y: scroll;
    background: #fff;
    border: 1px solid #d0d0d0;
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.pc-search-results::-webkit-scrollbar { width: 6px; }
.pc-search-results::-webkit-scrollbar-thumb { background: #ccc; border-radius: 3px; }

.pc-result-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.pc-result-item:hover,
.pc-result-item.active { background: #f5f5f5; }

.pc-result-item img {
    width: 44px;
    height: 44px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.pc-result-item div { min-width: 0; }

.pc-result-item strong {
    display: block;
    font-size: 14px;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pc-result-item span {
    display: block;
    font-size: 12px;
    color: #888;
}

.pc-no-res {
    padding: 14px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* ---- Colors ---- */
.pc-color-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.pc-color-btn {
    width: 40px;
    height: 40px;
    border: 2px solid #ccc;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, transform 0.15s;
    padding: 0;
}

.pc-color-btn:hover { transform: scale(1.1); }

.pc-color-btn.active {
    border-color: #333;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0,0,0,0.1);
}

.pc-color-dot {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* ---- Sizes Dropdown ---- */
.pc-size-grid {
    position: relative;
}

.pc-size-dropdown {
    position: relative;
    width: 100%;
}

.pc-size-selected {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding: 12px 16px;
    font-size: 14px;
    border: 1px solid #d0d0d0;
    border-radius: 8px;
    background: #fff;
    color: #333;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    user-select: none;
}

.pc-size-selected:hover { border-color: #999; }

.pc-size-dropdown.open .pc-size-selected {
    border-color: #999;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.pc-dropdown-arrow {
    margin-left: 8px;
    font-size: 10px;
    color: #666;
    transition: transform 0.2s;
    flex-shrink: 0;
}

.pc-size-dropdown.open .pc-dropdown-arrow {
    transform: rotate(180deg);
}

.pc-size-options {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 100;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
}

.pc-size-dropdown.open .pc-size-options {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #999;
    border-top: none;
}

.pc-size-option {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 16px;
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.15s;
    border-bottom: 1px solid #f0f0f0;
}

.pc-size-option:last-child { border-bottom: none; }
.pc-size-option:hover { background: #f5f5f5; }
.pc-size-option.active { background: #f0f0f0; }

.pc-size-label {
    font-weight: 600;
    white-space: nowrap;
    color: #111;
    flex-shrink: 0;
}

.pc-size-price {
    font-size: 13px;
    color: #666;
    margin-left: auto;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ---- Price & Cart ---- */
.pc-cart-section {
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.pc-price-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 18px;
}

#pc-price-label { font-weight: 600; color: #333; }
#pc-price-value { font-weight: 700; color: #111; }

.pc-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.pc-btn-cart {
    background: #111;
    color: #fff;
    margin-bottom: 10px;
}

.pc-btn-cart:hover { background: #333; }
.pc-btn-cart:disabled { background: #999; cursor: not-allowed; }

.pc-btn-download {
    background: #fff;
    color: #333;
    border: 1px solid #d0d0d0;
}

.pc-btn-download:hover { background: #f5f5f5; }
.pc-btn-download:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Preview ---- */
.pc-preview-wrap {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    position: sticky;
    top: 100px;
}

.pc-preview {
    width: 100%;
    max-width: 580px;
    aspect-ratio: 5 / 7;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15), 0 2px 8px rgba(0,0,0,0.08);
    border-radius: 4px;
    overflow: hidden;
}

.pc-preview svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---- Cropper.js overrides ---- */
.cropper-view-box,
.cropper-face { border-radius: 0; }

/* ---- Responsive ---- */
@media (max-width: 900px) {
    .pc-app {
        flex-direction: column;
        padding: 20px 16px;
        gap: 24px;
    }

    .pc-controls {
        flex: none;
        max-width: 100%;
    }

    .pc-preview-wrap {
        position: static;
        order: -1;
    }

    .pc-preview {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .pc-page-title { font-size: 20px; }

    .pc-filter-btn { width: 60px; }

    .pc-filter-thumb {
        width: 48px;
        height: 48px;
    }
}
