/**
 * Bizzio Customer Documents & Tracking Styles
 * Оптимизиран CSS за документи и товарителници
 */

/* ========================================
   Общи стилове за контейнера
   ======================================== */
.bizzio-documents-container {
    margin: 20px 0;
}

.bizzio-documents-intro {
    color: #666;
    margin-bottom: 25px;
    font-size: 15px;
}

.bizzio-empty-message {
    padding: 30px;
    text-align: center;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    color: #666;
}

/* ========================================
   Таб навигация
   ======================================== */
.bizzio-tabs-nav {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

.bizzio-tab-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: #666;
    transition: all 0.3s ease;
    margin-bottom: -2px;
}

.bizzio-tab-btn:hover {
    color: #333;
    background: #f5f5f5;
}

.bizzio-tab-btn.active {
    color: #2c3e50;
    border-bottom-color: #0073aa;
    background: transparent;
}

.bizzio-tab-btn .dashicons {
    width: 20px;
    height: 20px;
    font-size: 20px;
}

/* ========================================
   Таб съдържание
   ======================================== */
.bizzio-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.bizzio-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Бейджове за документи
   ======================================== */
.document-type-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
}

/* Фактура */
.document-type-34 {
    background: #e8f5e9;
    color: #2e7d32;
}

/* Кредитни известия */
.document-type-36,
.document-type-38,
.document-type-96 {
    background: #fff3e0;
    color: #e65100;
}

/* Дебитни известия */
.document-type-77,
.document-type-42 {
    background: #ffebee;
    color: #c62828;
}

/* ========================================
   Бейджове за превозвачи
   ======================================== */
.carrier-badge {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    background: #e3f2fd;
    color: #1565c0;
}

.carrier-badge.carrier-1 {
    /* Speedy */
    background: #fce4ec;
    color: #c2185b;
}

.carrier-badge.carrier-4 {
    /* Econt */
    background: #fff8e1;
    color: #f57f17;
}

.carrier-badge.carrier-5 {
    /* Interlogistica */
    background: #e0f2f1;
    color: #00695c;
}

/* ========================================
   Бутони за действия
   ======================================== */
.bizzio-download-btn,
.bizzio-track-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.bizzio-download-btn {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

.bizzio-download-btn:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

.bizzio-track-btn {
    background: #00a32a;
    color: #fff;
    border-color: #00a32a;
}

.bizzio-track-btn:hover {
    background: #008a20;
    border-color: #008a20;
    color: #fff;
}

.bizzio-download-btn .dashicons,
.bizzio-track-btn .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

/* ========================================
   Статус съобщения
   ======================================== */
.bizzio-no-download,
.bizzio-no-tracking {
    color: #999;
    font-style: italic;
    font-size: 13px;
}

/* ========================================
   Таблици - респонсивен дизайн
   ======================================== */
.bizzio-documents-table,
.bizzio-tracking-table {
    width: 100%;
    border-collapse: collapse;
}

.bizzio-documents-table th,
.bizzio-tracking-table th {
    text-align: left;
    padding: 12px;
    background: #f9f9f9;
    font-weight: 600;
    border-bottom: 2px solid #e0e0e0;
}

.bizzio-documents-table td,
.bizzio-tracking-table td {
    padding: 12px;
    border-bottom: 1px solid #e0e0e0;
    vertical-align: middle;
}

.bizzio-documents-table tr:hover,
.bizzio-tracking-table tr:hover {
    background: #f9f9f9;
}

/* ========================================
   Секция документи в поръчка
   ======================================== */
.bizzio-order-documents {
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #e0e0e0;
}

.woocommerce-order-documents-title {
    font-size: 20px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.order_documents th,
.order_tracking th {
    background: #f5f5f5;
    font-weight: 600;
}

.order_documents td,
.order_tracking td {
    padding: 10px;
}

/* ========================================
   Маркер "НОВО" в меню Моят акаунт
   ======================================== */

.woocommerce-MyAccount-navigation-link--bizzio-documents a {
    position: relative;
}

.woocommerce-MyAccount-navigation-link--bizzio-documents a:after {
    content: "NEW";
    position: absolute;
    top: -4px;
    left: 0px;
    background: #e60000;
    /* червен */
    color: #fff;
    font-size: 9px;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    line-height: 1;
}

/* ========================================
   Задаване на икона на менюто в Моят акаунт
   ======================================== */
.woocommerce-MyAccount-navigation-link--bizzio-documents a:before {
    font-family: "mfn-icons";
    content: "\e900";
    font-size: 18px;
    margin-right: 10px;
}

/* ========================================
   Мобилен респонсивен дизайн
   ======================================== */
@media screen and (max-width: 768px) {
    .bizzio-tabs-nav {
        flex-direction: column;
        gap: 5px;
    }

    .bizzio-tab-btn {
        width: 100%;
        justify-content: center;
        padding: 15px;
    }

    .bizzio-documents-table,
    .bizzio-tracking-table {
        border: 0;
    }

    .bizzio-documents-table thead,
    .bizzio-tracking-table thead {
        display: none;
    }

    .bizzio-documents-table tr,
    .bizzio-tracking-table tr {
        display: block;
        margin-bottom: 20px;
        border: 1px solid #e0e0e0;
        border-radius: 4px;
        padding: 10px;
        background: #fff;
    }

    .bizzio-documents-table td,
    .bizzio-tracking-table td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .bizzio-documents-table td:last-child,
    .bizzio-tracking-table td:last-child {
        border-bottom: 0;
    }

    .bizzio-documents-table td:before,
    .bizzio-tracking-table td:before {
        content: attr(data-title);
        font-weight: 600;
        color: #666;
        flex-basis: 40%;
    }

    .bizzio-download-btn,
    .bizzio-track-btn {
        width: 100%;
        justify-content: center;
        margin-top: 5px;
    }

    .document-type-badge,
    .carrier-badge {
        display: block;
        text-align: center;
        width: 100%;
    }
}

/* ========================================
   Анимации и преходи
   ======================================== */
.bizzio-documents-table tr,
.bizzio-tracking-table tr {
    transition: background 0.2s ease;
}

.document-type-badge,
.carrier-badge {
    transition: transform 0.2s ease;
}

.document-type-badge:hover,
.carrier-badge:hover {
    transform: scale(1.05);
}

/* ========================================
   Принтиране
   ======================================== */
@media print {

    .bizzio-tabs-nav,
    .bizzio-download-btn,
    .bizzio-track-btn {
        display: none !important;
    }

    .bizzio-tab-content {
        display: block !important;
    }

    .bizzio-documents-table,
    .bizzio-tracking-table {
        page-break-inside: avoid;
    }
}