/* Project Kotel Custom Note Field Styles */

.custom-note-field-wrapper {
    background: #E8DEBD;
    padding: 15px;
}

.custom-note-field-wrapper label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.custom-note-field-wrapper label span {
    color: #000000;
}

.custom-note-field-wrapper p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
    font-style: italic;
}

#customer_note_field_external {
    width: 100%;
    padding: 10px;
    background: #dbcfaf;
    color: #232737;
    border: none;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.3s ease;
    border-radius: 0;
}

#customer_note_field_external:focus {
    outline: none;
    box-shadow: none;
}

#customer_note_field_external.disabled-gift-mode {
    opacity: 0.6;
    background: #D4C4A8 !important;
    color: #888 !important;
    cursor: not-allowed;
    pointer-events: none;
}

#note-field-error,
#note-field-success {
    font-size: 16px;
    margin-top: 5px;
    display: none;
    font-weight: 400;
    padding: 10px;
}

#note-field-error {
    color: #232737;
    background: #B2BFC0;
    border-right: 5px solid #7DA0C3;
}

#note-field-success {
    color: #7DA0C3;
    background: #B2BFC0;
    border-left: 5px solid #7DA0C3;
    color: #232737;
}

.success-checkmark {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-left: 5px;
    display: inline-block;
}

/* Note Field Buttons */
.note-field-buttons {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    justify-content: flex-end;
}

.note-field-buttons button {
    padding: 12px 24px;
    border: none;
    font-size: 18px;
    border-radius: 0;
    font-weight: 400;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 140px;
    text-align: center;
}

.note-field-buttons .btn-add-to-cart {
    background: transparent;
    color: #E8A91B;
    border: 1px solid #E8A91B;
}

.note-field-buttons .btn-add-to-cart:hover {
    background: #E8A91B;
    border: 1px solid #E8A91B;
}

.btn-buy-now {
    background: #E8A91B;
    color: white;
}

.btn-buy-now:hover {
    background: #b8941f;
    transform: translateY(-1px);
}

.note-field-buttons button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.note-field-buttons button.loading {
    position: relative;
    color: transparent;
}

.note-field-buttons button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .note-field-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    .note-field-buttons button {
        width: 100%;
        min-width: auto;
    }
}

/* Admin styles */
.options_group .custom-note-field-wrapper {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

/* Email styles */
.customer-notes-section {
    background: #f8f8f8;
    padding: 15px;
    border-left: 3px solid #0073aa;
    margin: 10px 0;
}

.customer-notes-section h3 {
    margin-top: 0;
    color: #0073aa;
}

/* Admin order styles - using metabox now */

/* Note Options Section */
.note-options-section {
    margin-top: 15px;
}

.option-row-inline {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 10px;
}

.option-row {
    margin-bottom: 10px;
}

.option-checkbox-label {
    display: flex !important;
    align-items: center;
    font-weight: normal !important;
    margin-bottom: 0 !important;
    cursor: pointer;
    gap: 8px;
}

.option-checkbox-label input[type="checkbox"] {
    width: auto !important;
    height: auto !important;
    margin: 0;
    transform: scale(1.2);
}

.option-checkbox-label span {
    color: #333 !important;
    font-weight: bold;
}

.option-content-wrapper {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #D4C4A8;
}

#gift_recipient_phone {
    direction: rtl !important;
    width: 100%;
    padding: 10px;
    background: #dbcfaf;
    color: #232737;
    border: none;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 10px;
    transition: border-color 0.3s ease;
    border-radius: 0;
}

#gift_recipient_phone:focus {
    outline: none;
    box-shadow: none;
}

.option-explanation {
    margin: 0 !important;
    font-size: 14px !important;
    color: #666 !important;
    font-style: italic !important;
    line-height: 1.4;
}

/* Image Upload Section */
.image-upload-area {
    margin-top: 10px;
}

.upload-dropzone {
    border: 2px dashed #c5b896;
    padding: 30px;
    text-align: center;
    background: #f5f5f5;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
}

.upload-dropzone:hover,
.upload-dropzone.dragover {
    border-color: #E8A91B;
    background: #f9f7f1;
}

.upload-icon {
    font-size: 48px;
    color: #c5b896;
    margin-bottom: 10px;
}

.upload-text {
    font-size: 16px !important;
    color: #333 !important;
    margin-bottom: 5px !important;
    font-weight: 500;
}

.upload-formats {
    font-size: 12px !important;
    color: #888 !important;
    margin-bottom: 0 !important;
}

/* Image Preview Section */
.uploaded-images-preview {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.image-preview {
    position: relative;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.image-preview:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.image-preview.loading {
    opacity: 0.7;
}

.image-container {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    overflow: hidden;
}

.image-container img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid #E8A91B;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.image-info {
    padding: 8px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.filename {
    font-size: 11px;
    color: #666;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.delete-image-btn {
    position: absolute;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    top: 5px;
    left: 5px;
    background: #E8A91B;
    color: white;
    border: none;
    width: 24px !important;
    height: 24px !important;
    border-radius: 0;
    font-size: 18px !important;
    line-height: 24px !important;
    text-align: center !important;
    cursor: pointer;
    transition: background 0.2s ease;
    z-index: 10;
}

.delete-image-btn:hover {
    background: #b8941f;
}

/* Upload Messages */
.upload-message {
    margin-top: 10px;
    padding: 10px;
    border-radius: 4px;
    font-size: 14px;
}

.upload-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.upload-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Responsive design for image uploads */
@media (max-width: 768px) {
    .uploaded-images-preview {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .upload-dropzone {
        padding: 20px;
    }
    
    .upload-icon {
        font-size: 32px;
    }
    
    .upload-text {
        font-size: 14px !important;
    }
} 