/*
 * frontend.css
 * Contains general styles for WooCom Custom Fields plugin frontend.
 */

/* Styles for the custom fields container on product page */
.wc-custom-fields-container {
    margin-bottom: 20px;
    padding-left: 0px !important;
    padding: 15px;
    border: 1px solid #e0e0e000;
    border-radius: 8px;
    background-color: #f9f9f900;
}

.wc-custom-package-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.wc-custom-package-button {
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
}

.wc-custom-package-button:hover {
    background-color: #005177;
    transform: translateY(-2px);
}

/* The 'selected' class is handled by inline style in frontend.php for dynamic colors */
/* .wc-custom-package-button.selected {
    background-color: #28a745;
    box-shadow: 0 3px 6px rgba(0,0,0,0.2);
    border: 2px solid #1e7e34;
} */

#wc-custom-total-price {
    font-size: 1.2em;
    color: #333;
    margin-top: 15px;
    padding-top: 10px;
    border-top: 1px dashed #e0e0e0;
}

/* Styles for the individual upload fields */
.wccf-individual-uploads-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px; /* Space between individual upload boxes */
    margin-top: 15px;
}


.wc-cf-upload-label {
    width: 120px; /* Fixed width */
    height: 120px; /* Fixed height */
    border: 2px dashed #ccc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    background: #f9f9f9;
}
.wc-cf-upload-preview {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: #aaa;
    transition: all 0.3s ease;
}
.wc-cf-upload-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Ensure image fits within the box without cropping */
    display: block;
}
.wc-cf-plus {
    font-size: 36px;
    line-height: 1;
}


.wccf-upload-previews-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
    border: 1px solid #eee;
    padding: 10px;
    border-radius: 8px;
    background-color: #fff;
}

.wccf-temp-preview-item {
    width: 100px; /* Fixed width for preview item */
    height: 100px; /* Fixed height for preview item */
    overflow: hidden;
    border-radius: 5px;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f0f0f0;
}

.wccf-temp-preview-thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain; /* Ensure image fits within bounds */
    display: block;
}


/* Styles for the upload form on Thank You page */
#wccf-photo-upload-form {
    background-color: #f0f0f0;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: flex-start;
}

#wccf-photo-upload-form h3 {
    margin-top: 0;
    color: #333;
}

.wccf-upload-input {
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 5px;
    background-color: #fff;
    width: 100%; /* Make input full width */
    max-width: 400px; /* Limit max width */
}

.wccf-upload-button, .wccf-temp-upload-button { /* Apply to both upload buttons */
    background-color: #0073aa;
    color: #fff;
    border: none;
    padding: 10px 25px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 3px rgba(0,0,0,0.1);
    align-self: flex-end; /* Align button to the right */
}

.wccf-upload-button:hover, .wccf-temp-upload-button:hover {
    background-color: #005177;
    transform: translateY(-2px);
}

#wccf-upload-response, #wccf-temp-upload-response { /* Apply to both response divs */
    margin-top: 10px;
    padding: 10px;
    border-radius: 5px;
    font-weight: bold;
}

#wccf-upload-response.success, #wccf-temp-upload-response.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#wccf-upload-response.error, #wccf-temp-upload-response.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Basic styling for admin dashboard (these styles are in admin-dashboard.php's inline style block, but keeping them here for reference if moved) */
.wccf-uploads-list .postbox {
    margin-bottom: 20px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.wccf-uploads-list .postbox .hndle {
    cursor: default;
    background: #f0f0f1;
    border-bottom: 1px solid #c3c4c7;
    padding: 8px 12px;
    font-size: 14px;
    line-height: 1.4;
    margin: 0;
    border-radius: 5px 5px 0 0;
}

.wccf-uploads-list .postbox .inside {
    padding: 15px 12px;
}

.wccf-file-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wccf-file-list li {
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
    display: flex;
    align-items: center;
}

.wccf-file-list li:last-child {
    border-bottom: none;
}

.wccf-file-list a {
    text-decoration: none;
    color: #0073aa;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.wccf-file-list a:hover {
    color: #005177;
    text-decoration: underline;
}

.wccf-file-list .dashicons {
    margin-right: 5px;
    color: #666;
}

.wccf-file-size {
    font-size: 0.85em;
    color: #888;
    margin-left: auto; /* Push size to the right */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wc-custom-package-buttons {
        flex-direction: column;
    }
    .wc-custom-package-button {
        width: 100%;
    }
}
