/* Custom Product File Upload - Frontend Styles */

.cpfu-upload-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 2px dashed #ddd;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.cpfu-upload-wrapper:hover {
    border-color: #999;
    background: #fff;
}

.cpfu-upload-button-wrapper {
    text-align: center;
    margin-bottom: 15px;
}

.cpfu-upload-button {
    display: inline-block;
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.cpfu-upload-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.cpfu-upload-button:active {
    transform: translateY(0);
}

.cpfu-button-text {
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: center;
}

.cpfu-button-text svg {
    width: 20px;
    height: 20px;
}

.cpfu-info-text {
    margin-top: 10px;
    font-size: 13px;
    color: #666;
}

/* Loading Indicator */
.cpfu-loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-weight: 600;
}

.cpfu-spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: cpfu-spin 0.8s linear infinite;
}

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

/* Error Message */
.cpfu-error {
    padding: 15px;
    background: #fee;
    border: 1px solid #fcc;
    border-radius: 5px;
    color: #c00;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Success Message */
.cpfu-success {
    padding: 15px;
    background: #efe;
    border: 1px solid #cfc;
    border-radius: 5px;
    color: #060;
    margin-bottom: 15px;
    font-weight: 600;
}

/* Files List */
.cpfu-files-list {
    margin-top: 20px;
}

.cpfu-file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.2s ease;
    animation: cpfu-slideIn 0.3s ease;
}

@keyframes cpfu-slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cpfu-file-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.cpfu-file-preview {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
}

.cpfu-file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cpfu-file-preview svg {
    color: #999;
}

.cpfu-file-info {
    flex: 1;
    min-width: 0;
}

.cpfu-file-name {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cpfu-file-size {
    display: block;
    font-size: 12px;
    color: #999;
}

.cpfu-delete-file {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fee;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #c00;
}

.cpfu-delete-file:hover {
    background: #fcc;
    transform: scale(1.1);
}

/* Checkout Section */
.cpfu-checkout-section {
    margin: 30px 0;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 10px;
}

.cpfu-checkout-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpfu-checkout-section h3:before {
    content: "📁";
    font-size: 28px;
}

.cpfu-product-upload-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.cpfu-product-upload-section h4 {
    margin-top: 0;
    color: #667eea;
    font-size: 18px;
    margin-bottom: 15px;
}

/* Cart Page */
.woocommerce-cart .cpfu-upload-wrapper {
    margin-top: 15px;
}

.cpfu-cart-item-upload {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.cpfu-cart-uploads-section {
    margin: 30px 0;
    padding: 30px;
    background: #f9f9f9;
    border-radius: 10px;
}

.cpfu-cart-uploads-section h3 {
    margin-top: 0;
    color: #333;
    font-size: 24px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cpfu-cart-uploads-section h3:before {
    content: "📁";
    font-size: 28px;
}

/* Admin Order Files */
.cpfu-admin-files {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.cpfu-admin-files h3 {
    margin-top: 0;
}

.cpfu-admin-files table {
    margin-top: 15px;
}

.cpfu-admin-files table img {
    border: 1px solid #ddd;
    border-radius: 4px;
}

/* Order Item Files */
.cpfu-order-item-files {
    margin-top: 10px;
    padding: 10px;
    background: #f9f9f9;
    border-radius: 4px;
}

.cpfu-order-item-files a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.cpfu-order-item-files a:hover {
    text-decoration: underline;
}

/* Responsive */
@media (max-width: 768px) {
    .cpfu-upload-wrapper {
        padding: 15px;
    }
    
    .cpfu-upload-button {
        padding: 12px 20px;
        font-size: 14px;
    }
    
    .cpfu-file-item {
        padding: 12px;
        gap: 10px;
    }
    
    .cpfu-file-preview {
        width: 50px;
        height: 50px;
    }
    
    .cpfu-checkout-section {
        padding: 20px;
    }
    
    .cpfu-checkout-section h3 {
        font-size: 20px;
    }
}

/* Animation for empty state */
.cpfu-upload-wrapper:not(:has(.cpfu-file-item)) .cpfu-upload-button {
    animation: cpfu-pulse 2s ease-in-out infinite;
}

@keyframes cpfu-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}
