/* ABB Stock Sync Frontend Styles */

/* Ana Wrapper */
.abb-stock-check-wrapper {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* Butonlar */
.abb-check-stock,
.abb-view-on-site {
    display: inline-block;
    margin-right: 10px;
    margin-bottom: 10px;
    padding: 10px 20px;
    background: #2271b1;
    color: #fff !important;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
    font-weight: 500;
}

.abb-check-stock:hover,
.abb-view-on-site:hover {
    background: #135e96;
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.abb-view-on-site {
    background: #50575e;
}

.abb-view-on-site:hover {
    background: #3a4045;
}

.abb-check-stock:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Dashicons düzeltmesi */
.abb-check-stock .dashicons,
.abb-view-on-site .dashicons {
    vertical-align: middle;
    margin-right: 5px;
    font-size: 16px;
}

/* Spinning animasyonu */
.dashicons.spinning {
    animation: dashicons-spin 1s linear infinite;
}

@keyframes dashicons-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Stok Bilgi Alanı */
.abb-stock-info {
    margin-top: 20px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Stok Özeti */
.abb-stock-summary {
    border-bottom: 1px solid #eee;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.abb-stock-summary h4 {
    margin: 0 0 10px 0;
    color: #23282d;
    font-size: 16px;
}

.abb-total-stock {
    font-size: 18px;
    color: #333;
    margin: 5px 0;
}

.abb-total-stock strong {
    color: #2271b1;
    font-size: 24px;
}

.abb-last-check {
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Distribütör Tablosu */
.abb-distributor-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.abb-distributor-table thead {
    background: #f5f5f5;
    border-bottom: 2px solid #ddd;
}

.abb-distributor-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.abb-distributor-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.abb-distributor-table tbody tr {
    transition: background-color 0.2s ease;
}

.abb-distributor-table tbody tr:hover {
    background: #f9f9f9;
}

.abb-distributor-table tbody tr:last-child td {
    border-bottom: none;
}

/* Distribütör İsmi */
.dist-name {
    font-weight: 500;
    color: #23282d;
}

/* Stok Miktarı */
.dist-stock {
    font-weight: 600;
    color: #2271b1;
}

/* Güncelleme Tarihi */
.dist-update {
    color: #666;
    font-size: 13px;
}

/* Satın Al Linki */
.abb-dist-link {
    display: inline-block;
    padding: 5px 15px;
    background: #00a32a;
    color: #fff !important;
    text-decoration: none;
    border-radius: 3px;
    font-size: 13px;
    transition: all 0.2s ease;
}

.abb-dist-link:hover {
    background: #008a20;
    transform: translateX(2px);
}

/* Stok Yok Mesajı */
.abb-no-stock {
    text-align: center;
    padding: 30px;
    color: #666;
    font-style: italic;
}

/* Mesajlar */
.abb-message {
    padding: 12px 20px;
    margin: 10px 0;
    border-radius: 4px;
    font-size: 14px;
    animation: slideDown 0.3s ease;
}

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

.abb-message-success {
    background: #d4f4dd;
    color: #00a32a;
    border: 1px solid #00a32a;
}

.abb-message-error {
    background: #ffd4d4;
    color: #d63638;
    border: 1px solid #d63638;
}

/* Stok Badge */
.abb-stock-badge {
    display: inline-block;
    padding: 4px 12px;
    margin-left: 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    animation: badgeFadeIn 0.5s ease;
}

@keyframes badgeFadeIn {
    from { opacity: 0; transform: scale(0.8); }
    to { opacity: 1; transform: scale(1); }
}

.abb-stock-badge.high {
    background: #d4f4dd;
    color: #00a32a;
}

.abb-stock-badge.medium {
    background: #fff4d4;
    color: #f0b429;
}

.abb-stock-badge.low {
    background: #ffd4d4;
    color: #d63638;
}

/* Modal */
.abb-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    animation: fadeIn 0.3s ease;
}

.abb-modal {
    background: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.abb-modal-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.abb-modal-header h3 {
    margin: 0;
    font-size: 18px;
    color: #23282d;
}

.abb-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #666;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.abb-modal-close:hover {
    color: #000;
    background: #f0f0f0;
    border-radius: 50%;
}

.abb-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 80px);
}

/* Loading */
.abb-loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.abb-loading:after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #ddd;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Tooltip */
.abb-tooltip {
    position: absolute;
    background: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    z-index: 9999;
    pointer-events: none;
}

.abb-tooltip:after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 5px 5px 0 5px;
    border-color: #333 transparent transparent transparent;
}

/* Info Icon */
.abb-info-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    background: #2271b1;
    color: #fff;
    border-radius: 50%;
    text-align: center;
    line-height: 16px;
    font-size: 12px;
    cursor: help;
    margin-left: 5px;
}

/* Fiyat Karşılaştırma */
.abb-price-comparison {
    margin-top: 20px;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 6px;
}

.abb-price-comparison h4 {
    margin: 0 0 15px 0;
    color: #23282d;
    font-size: 16px;
}

.abb-coming-soon {
    text-align: center;
    color: #666;
    font-style: italic;
    padding: 20px;
}

/* Mobil Görünüm */
@media screen and (max-width: 768px) {
    .abb-stock-check-wrapper {
        padding: 15px;
    }
    
    .abb-check-stock,
    .abb-view-on-site {
        display: block;
        width: 100%;
        margin-right: 0;
        text-align: center;
    }
    
    .abb-distributor-table {
        font-size: 12px;
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    
    .abb-distributor-table th,
    .abb-distributor-table td {
        padding: 8px 10px;
    }
    
    .abb-modal {
        margin: 20px;
        max-height: calc(100vh - 40px);
    }
    
    .abb-mobile-view {
        position: relative;
        overflow-x: scroll;
        -webkit-overflow-scrolling: touch;
    }
}

/* WooCommerce Uyumu */
.woocommerce .abb-stock-check-wrapper {
    clear: both;
}

.woocommerce-page .abb-stock-check-wrapper {
    margin-top: 30px;
}

/* Animasyonlar */
.abb-fade-in {
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Yazdırma Stilleri */
@media print {
    .abb-check-stock,
    .abb-view-on-site,
    .abb-modal-overlay {
        display: none !important;
    }
    
    .abb-stock-info {
        border: 1px solid #000;
        box-shadow: none;
    }
    
    .abb-distributor-table {
        border: 1px solid #000;
    }
}

/* Dark Mode Desteği */
@media (prefers-color-scheme: dark) {
    .abb-stock-check-wrapper {
        background: #1e1e1e;
        border-color: #444;
    }
    
    .abb-stock-info {
        background: #2a2a2a;
        border-color: #444;
        color: #fff;
    }
    
    .abb-distributor-table thead {
        background: #333;
    }
    
    .abb-distributor-table th,
    .abb-distributor-table td {
        color: #fff;
        border-color: #444;
    }
    
    .abb-modal {
        background: #2a2a2a;
        color: #fff;
    }
    
    .abb-modal-header {
        border-color: #444;
    }
}