/**
 * KCN Membership Manager - Customization Tab Styles
 * WooCommerce My Account "Personnalisation" tab
 */

/* Wrapper */
.kcn-customization-wrapper {
    max-width: 800px;
}

.kcn-customization-wrapper h2 {
    margin-bottom: 0.5em;
    color: #1e1e1e;
}

.kcn-customization-description {
    color: #666;
    margin-bottom: 1.5em;
    font-size: 0.95em;
    line-height: 1.6;
}

/* Instance info banner */
.kcn-instance-info {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-left: 4px solid #2271b1;
    padding: 1em 1.25em;
    margin-bottom: 2em;
    border-radius: 0 4px 4px 0;
    font-size: 0.95em;
}

.kcn-instance-info strong {
    color: #1e1e1e;
    margin-right: 0.5em;
}

/* Form */
.kcn-customization-form {
    background: #fff;
    padding: 1.5em;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.kcn-form-field {
    margin-bottom: 1.5em;
}

.kcn-form-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5em;
    color: #1e1e1e;
}

.kcn-form-field input[type="text"] {
    width: 100%;
    max-width: 400px;
}

.kcn-field-description {
    margin-top: 0.5em;
    font-size: 0.85em;
    color: #666;
}

/* Logo upload */
.kcn-logo-preview-wrapper {
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.kcn-logo-preview {
    padding: 1em;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    display: inline-block;
    max-width: 320px;
}

.kcn-logo-preview img {
    max-width: 280px;
    max-height: 150px;
    height: auto;
    display: block;
    margin-bottom: 0.75em;
    border-radius: 4px;
}

.kcn-remove-logo {
    display: flex;
    align-items: center;
    gap: 0.5em;
    font-size: 0.9em;
    color: #d63638;
    cursor: pointer;
}

.kcn-remove-logo input[type="checkbox"] {
    margin: 0;
}

/* Custom file input (hidden native input) */
.kcn-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.kcn-file-input-button {
    display: inline-block;
    padding: 0.6em 1.2em;
    background: #f0f0f1;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95em;
    transition: all 0.2s ease;
}

.kcn-file-input-button:hover {
    background: #e0e0e0;
    border-color: #8c8f94;
}

.kcn-file-input-name {
    display: inline-block;
    margin-left: 0.75em;
    color: #666;
    font-size: 0.9em;
    font-style: italic;
}

.kcn-file-input-name.has-file {
    color: #1e1e1e;
    font-style: normal;
    font-weight: 500;
}

/* Preview section */
.kcn-form-preview {
    margin-top: 2em;
    padding-top: 2em;
    border-top: 1px solid #eee;
}

.kcn-form-preview h3 {
    font-size: 1.1em;
    margin-bottom: 1em;
    color: #1e1e1e;
}

.kcn-cover-preview {
    max-width: 300px;
}

.kcn-cover-page {
    aspect-ratio: 210 / 297;
    width: 100%;
    max-width: 220px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1.5em;
    gap: 1em;
}

.kcn-preview-logo {
    max-width: 80%;
    max-height: 40%;
    object-fit: contain;
}

.kcn-preview-logo-placeholder {
    width: 60%;
    height: 30%;
    background: linear-gradient(135deg, #f0f0f0 0%, #e0e0e0 100%);
    border: 2px dashed #ccc;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 0.75em;
    text-align: center;
    padding: 0.5em;
}

.kcn-preview-title {
    font-size: 0.85em;
    font-weight: 500;
    color: #333;
    text-align: center;
    padding: 0 0.5em;
    word-break: break-word;
}

.kcn-preview-note {
    margin-top: 1em;
    font-size: 0.8em;
    color: #888;
    font-style: italic;
}

/* Form actions */
.kcn-form-actions {
    margin-top: 1.5em;
    padding-top: 1.5em;
    border-top: 1px solid #eee;
}

.kcn-form-actions .button {
    min-width: 150px;
}

/* Responsive */
@media screen and (max-width: 600px) {
    .kcn-customization-form {
        padding: 1em;
    }
    
    .kcn-cover-page {
        max-width: 180px;
    }
    
    .kcn-form-field input[type="text"] {
        max-width: 100%;
    }
}

/* Success/error messages within the tab */
.kcn-customization-wrapper .woocommerce-message,
.kcn-customization-wrapper .woocommerce-error {
    margin-bottom: 1.5em;
}

