/**
 * Starter Product Add-ons - Frontend CSS
 * Kutu tasarımı ile addon gösterimi
 */

/* Ana Container - Kutu */
.spa-addons-under-gallery,
.spa-addons-wrapper,
#spa-addons-section {
    margin: 20px 0 !important;
    padding: 25px !important;
    background: #f8f9fa !important;
    border: 2px solid #dee2e6 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
}

/* İç içe wrapper varsa iç olanı sıfırla */
.spa-addons-under-gallery .spa-addons-wrapper {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Grup Başlığı */
.spa-addon-group {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #dee2e6;
}

.spa-addon-group:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.spa-group-title {
    margin: 0 0 15px 0 !important;
    padding: 10px 15px !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    color: #fff !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    border-radius: 6px !important;
}

.spa-group-desc {
    margin: 0 0 15px 0;
    padding: 10px;
    background: #fff;
    border-left: 3px solid #667eea;
    color: #666;
    font-size: 14px;
}

/* Fields Container */
.spa-fields {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Her bir field */
.spa-field {
    margin: 0;
    padding: 0;
}

.spa-field > label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

/* Input alanları */
.spa-field input[type="text"],
.spa-field input[type="number"],
.spa-field input[type="email"],
.spa-field input[type="date"],
.spa-field textarea,
.spa-field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: #fff;
}

.spa-field input:focus,
.spa-field textarea:focus,
.spa-field select:focus {
    border-color: #667eea;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

/* Checkbox ve Radio - Kutu içinde */
.spa-checkbox-group,
.spa-radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.spa-checkbox-option,
.spa-radio-option,
.spa-checkbox-label {
    display: flex !important;
    align-items: center !important;
    padding: 12px 15px !important;
    background: #fff !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    flex: 1 1 calc(50% - 5px);
    min-width: 200px;
}

.spa-checkbox-option:hover,
.spa-radio-option:hover,
.spa-checkbox-label:hover {
    border-color: #667eea !important;
    background: #f8f9ff !important;
}

.spa-checkbox-option input,
.spa-radio-option input,
.spa-checkbox-label input {
    margin-right: 10px !important;
    width: 18px !important;
    height: 18px !important;
    accent-color: #667eea;
}

.spa-checkbox-option span,
.spa-radio-option span,
.spa-checkbox-label span {
    flex: 1;
    font-size: 14px;
    color: #333;
}

/* Fiyat etiketi */
.spa-option-price,
.spa-price {
    color: #e74c3c !important;
    font-weight: 700 !important;
    margin-left: 5px;
}

/* Required yıldız */
.spa-required {
    color: #e74c3c;
    margin-left: 3px;
}

/* Field açıklama */
.spa-field-desc {
    margin: 8px 0 0 0;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

/* Dosya yükleme */
.spa-file-input {
    padding: 15px;
    background: #fff;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.spa-file-input:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

/* Toplam fiyat */
.spa-addons-total {
    margin-top: 20px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.spa-total-label {
    color: #fff;
    font-weight: 600;
    font-size: 15px;
}

.spa-total-value {
    color: #fff;
    font-weight: 700;
    font-size: 18px;
}

/* ===== ÇOKLU DOSYA YÜKLEME STİLLERİ ===== */

/* Dropzone Alanı */
.spa-file-dropzone {
    position: relative;
    padding: 30px 20px;
    background: #fff;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.spa-file-dropzone:hover,
.spa-file-dropzone.spa-dragover {
    border-color: #667eea;
    background: #f8f9ff;
}

.spa-file-dropzone input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.spa-dropzone-content {
    pointer-events: none;
}

.spa-dropzone-icon {
    display: block;
    font-size: 40px;
    margin-bottom: 10px;
}

.spa-dropzone-text {
    display: block;
    font-size: 14px;
    color: #333;
    font-weight: 600;
    margin-bottom: 5px;
}

.spa-dropzone-hint {
    display: block;
    font-size: 12px;
    color: #999;
}

/* Yüklenen Dosyalar Listesi */
.spa-uploaded-files-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.spa-uploaded-file {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    transition: all 0.2s ease;
}

.spa-uploaded-file:hover {
    border-color: #667eea;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.15);
}

.spa-uploaded-file.spa-uploading {
    opacity: 0.7;
}

.spa-uploaded-file.spa-upload-error {
    border-color: #e74c3c;
    background: #fff5f5;
}

/* Küçük Resim (Thumbnail) */
.spa-file-thumb {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.spa-file-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.spa-file-thumb .spa-file-icon {
    font-size: 24px;
}

.spa-loading-thumb {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: spa-shimmer 1.5s infinite;
}

@keyframes spa-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Dosya Bilgileri */
.spa-uploaded-file .spa-file-info {
    flex: 1;
    min-width: 0;
}

.spa-uploaded-file .spa-file-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.spa-uploaded-file .spa-file-size {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Progress Bar */
.spa-upload-progress {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    margin-top: 8px;
    overflow: hidden;
}

.spa-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    border-radius: 2px;
    width: 0;
    transition: width 0.3s ease;
}

/* Kaldır Butonu */
.spa-file-remove {
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    border: none;
    background: #f8f9fa;
    color: #999;
    font-size: 18px;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.spa-file-remove:hover {
    background: #e74c3c;
    color: #fff;
}

.spa-file-remove:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Spinner */
.spa-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spa-spin 0.8s linear infinite;
}

@keyframes spa-spin {
    to { transform: rotate(360deg); }
}

/* Hata Mesajı */
.spa-error-text {
    display: block;
    color: #e74c3c;
    font-size: 11px;
    margin-top: 4px;
}

/* Mobil uyum */
@media (max-width: 768px) {
    .spa-addons-under-gallery,
    #spa-addons-section {
        padding: 15px !important;
        margin: 15px 0 !important;
    }
    
    .spa-checkbox-option,
    .spa-radio-option,
    .spa-checkbox-label {
        flex: 1 1 100%;
    }
    
    .spa-group-title {
        font-size: 14px !important;
        padding: 8px 12px !important;
    }
    
    .spa-file-dropzone {
        padding: 20px 15px;
    }
    
    .spa-dropzone-icon {
        font-size: 30px;
    }
    
    .spa-file-thumb {
        width: 40px;
        height: 40px;
    }
    
    .spa-uploaded-file .spa-file-name {
        font-size: 12px;
    }
}