/**
 * Frontend Stilleri - Ürün Özelleştirme
 * 
 * @package Custom_Product_Upload
 * @version 2.0.0
 */

/* ================================
   ANA WRAPPER
   ================================ */
.cpu-custom-fields-wrapper {
    margin: 20px 0;
    padding: 0;
}

/* ================================
   FIELD SECTION GENEL
   ================================ */
.cpu-field-section {
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.cpu-field-section:last-child {
    margin-bottom: 0;
}

.cpu-section-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.cpu-section-title .required {
    color: #e74c3c;
    margin-left: 3px;
}

.cpu-field-info {
    display: block;
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

/* ================================
   DOSYA YÜKLEME ALANI
   ================================ */
.cpu-file-section .cpu-file-box {
    position: relative;
}

.cpu-file-input {
    width: 100%;
    padding: 20px;
    border: 2px dashed #ccc;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cpu-file-input:hover {
    border-color: #0073aa;
    background: #f0f7fc;
}

.cpu-file-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

/* Dosya Önizleme */
.cpu-file-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.cpu-preview-item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    max-width: 200px;
}

.cpu-preview-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.cpu-preview-item .cpu-preview-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 24px;
}

.cpu-preview-item .cpu-preview-info {
    flex: 1;
    min-width: 0;
}

.cpu-preview-item .cpu-preview-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cpu-preview-item .cpu-preview-size {
    font-size: 11px;
    color: #888;
}

.cpu-preview-item .cpu-preview-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 22px;
    height: 22px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 14px;
    line-height: 22px;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
}

.cpu-preview-item .cpu-preview-remove:hover {
    background: #c0392b;
}

/* Drag & Drop */
.cpu-file-section.cpu-drag-over .cpu-file-input {
    border-color: #0073aa;
    background: #e6f3f9;
}

/* ================================
   İSİM-SOYİSİM ALANI
   ================================ */
.cpu-name-section .cpu-text-box {
    position: relative;
}

.cpu-text-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.cpu-text-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cpu-text-input::placeholder {
    color: #999;
}

/* Karakter Sayacı */
.cpu-char-counter {
    display: block;
    text-align: right;
    font-size: 11px;
    color: #888;
    margin-top: 5px;
}

.cpu-char-counter.cpu-warning {
    color: #f39c12;
}

.cpu-char-counter.cpu-danger {
    color: #e74c3c;
}

/* ================================
   NOTUNUZ ALANI
   ================================ */
.cpu-note-section .cpu-note-box {
    position: relative;
}

.cpu-note-input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
    transition: all 0.3s ease;
}

.cpu-note-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cpu-note-input::placeholder {
    color: #999;
}

/* ================================
   TARİH-SAAT ALANI
   ================================ */
.cpu-datetime-section .cpu-datetime-box {
    position: relative;
}

.cpu-datetime-input {
    width: 100%;
    padding: 12px 15px;
    padding-left: 40px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: #fff url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="%23666" stroke-width="2"><rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect><line x1="16" y1="2" x2="16" y2="6"></line><line x1="8" y1="2" x2="8" y2="6"></line><line x1="3" y1="10" x2="21" y2="10"></line></svg>') no-repeat 12px center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cpu-datetime-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cpu-datetime-input::placeholder {
    color: #999;
}

.cpu-datetime-icon {
    margin-right: 5px;
}

/* ================================
   FLATPICKR ÖZEL STİLLER
   ================================ */
.flatpickr-calendar {
    font-family: inherit;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: #0073aa;
    border-color: #0073aa;
}

.flatpickr-day:hover {
    background: #e6f3f9;
}

.flatpickr-time input:hover,
.flatpickr-time input:focus {
    background: #e6f3f9;
}

/* ================================
   SEPET & CHECKOUT GÖRÜNÜMLERİ
   ================================ */
.cpu-cart-item-data {
    margin-top: 10px;
    padding: 10px;
    background: #f5f5f5;
    border-radius: 4px;
    font-size: 13px;
}

.cpu-cart-item-data dt {
    font-weight: 600;
    color: #333;
    margin-bottom: 3px;
}

.cpu-cart-item-data dd {
    margin: 0 0 10px 0;
    padding-left: 10px;
    color: #555;
}

.cpu-cart-item-data dd:last-child {
    margin-bottom: 0;
}

.cpu-cart-item-data a {
    color: #0073aa;
    text-decoration: underline;
}

.cpu-cart-item-data a:hover {
    color: #005177;
}

/* ================================
   VALİDASYON DURUMLARI
   ================================ */
.cpu-field-section.cpu-error .cpu-file-input,
.cpu-field-section.cpu-error .cpu-text-input,
.cpu-field-section.cpu-error .cpu-note-input,
.cpu-field-section.cpu-error .cpu-datetime-input {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.cpu-field-section.cpu-valid .cpu-file-input,
.cpu-field-section.cpu-valid .cpu-text-input,
.cpu-field-section.cpu-valid .cpu-note-input,
.cpu-field-section.cpu-valid .cpu-datetime-input {
    border-color: #27ae60;
}

.cpu-error-message {
    display: block;
    color: #e74c3c;
    font-size: 12px;
    margin-top: 5px;
}

/* ================================
   RESPONSIVE
   ================================ */
@media (max-width: 768px) {
    .cpu-custom-fields-wrapper {
        margin: 15px 0;
    }
    
    .cpu-field-section {
        padding: 12px;
    }
    
    .cpu-preview-item {
        max-width: 100%;
        width: 100%;
    }
    
    .cpu-file-input {
        padding: 15px;
    }
    
    .cpu-text-input,
    .cpu-note-input,
    .cpu-datetime-input {
        padding: 10px 12px;
        font-size: 16px; /* iOS zoom önleme */
    }
    
    .cpu-datetime-input {
        padding-left: 38px;
    }
}

@media (max-width: 480px) {
    .cpu-section-title {
        font-size: 13px;
    }
    
    .cpu-field-info {
        font-size: 11px;
    }
    
    .cpu-preview-item img,
    .cpu-preview-item .cpu-preview-icon {
        width: 40px;
        height: 40px;
    }
}

/* ================================
   ACCESSIBILITY
   ================================ */
.cpu-file-input:focus-visible,
.cpu-text-input:focus-visible,
.cpu-note-input:focus-visible,
.cpu-datetime-input:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Screen Reader Only */
.cpu-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ================================
   ANİMASYONLAR
   ================================ */
@keyframes cpu-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

.cpu-field-section.cpu-shake {
    animation: cpu-shake 0.3s ease-in-out;
}

@keyframes cpu-fade-in {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.cpu-preview-item {
    animation: cpu-fade-in 0.3s ease-out;
}

/* ================================
   PRINT STİLLERİ
   ================================ */
@media print {
    .cpu-custom-fields-wrapper {
        display: none;
    }
}
