/**
 * Public CSS for Bulgarian Documents Plugin
 */

/* Checkout Fields */
.wcbgd-company-fields,
.wcbgd-installation-fields {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.wcbgd-company-fields h3,
.wcbgd-installation-fields h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.2em;
    color: #333;
}

.wcbgd-company-details,
.wcbgd-installation-details {
    margin-top: 15px;
}

.wcbgd-error {
    color: #dc3232;
    font-size: 0.9em;
    margin-top: 5px;
    display: block;
}

/* My Account Documents Tab */
.woocommerce-MyAccount-documents {
    margin-bottom: 30px;
}

.wcbgd-filters {
    margin-bottom: 30px;
    padding: 20px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
}

.wcbgd-filter-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    align-items: flex-end;
}

.wcbgd-filter-item {
    flex: 1;
    min-width: 150px;
}

.wcbgd-filter-item label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 0.9em;
    color: #666;
}

.wcbgd-filter-item input,
.wcbgd-filter-item select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.wcbgd-filter-actions {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.wcbgd-filter-actions .button {
    padding: 8px 15px;
    height: auto;
}

/* Documents Table */
.woocommerce-table--order-documents {
    margin-top: 20px;
}

.woocommerce-table__document-type {
    font-weight: 600;
}

.wcbgd-document-number {
    color: #666;
    font-size: 0.9em;
}

.wcbgd-download-link,
.wcbgd-verify-qr {
    margin-right: 10px;
}

/* QR Modal */
.wcbgd-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
}

.wcbgd-modal-content {
    background-color: #fff;
    margin: 10% auto;
    padding: 30px;
    border: 1px solid #888;
    border-radius: 5px;
    width: 90%;
    max-width: 500px;
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.wcbgd-modal-close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    transition: color 0.3s;
}

.wcbgd-modal-close:hover,
.wcbgd-modal-close:focus {
    color: #000;
    text-decoration: none;
}

.wcbgd-modal h3 {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.4em;
    color: #333;
}

.wcbgd-qr-container {
    text-align: center;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 5px;
}

.wcbgd-qr-data {
    background: #f5f5f5;
    padding: 15px;
    margin: 15px 0;
    font-size: 0.9em;
    word-break: break-all;
    border-left: 3px solid #0073aa;
    text-align: left;
}

.wcbgd-qr-data strong {
    display: block;
    margin-bottom: 10px;
    color: #333;
}

.wcbgd-qr-help {
    color: #666;
    font-size: 0.9em;
    font-style: italic;
    text-align: center;
    margin-top: 15px;
}

/* Thank You Page Documents Section */
.woocommerce-order-documents {
    margin: 30px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 3px;
}

.woocommerce-order-documents__title {
    margin-top: 0;
    margin-bottom: 20px;
    font-size: 1.3em;
    color: #333;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 10px;
}

.woocommerce-table--order-documents .button {
    margin-right: 5px;
}

.wcbgd-show-qr {
    background: #0073aa;
    color: white;
    border-color: #0073aa;
}

.wcbgd-show-qr:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Pagination */
.wcbgd-page-info {
    margin: 0 15px;
    line-height: 32px;
    font-weight: 600;
    color: #666;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .wcbgd-filter-row {
        flex-direction: column;
    }
    
    .wcbgd-filter-item {
        width: 100%;
        min-width: 100%;
    }
    
    .wcbgd-filter-actions {
        width: 100%;
        justify-content: space-between;
    }
    
    .wcbgd-modal-content {
        width: 95%;
        margin: 20% auto;
        padding: 20px;
    }
    
    .woocommerce-table--order-documents {
        font-size: 0.9em;
    }
    
    .woocommerce-table--order-documents .button {
        padding: 5px 10px;
        font-size: 0.85em;
    }
}

@media screen and (max-width: 480px) {
    .wcbgd-company-fields,
    .wcbgd-installation-fields {
        padding: 15px;
    }
    
    .woocommerce-order-documents {
        padding: 15px;
    }
    
    .wcbgd-filters {
        padding: 15px;
    }
}

/* Loading States */
.wcbgd-loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.wcbgd-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: wcbgd-spin 1s linear infinite;
}

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

/* Print Styles */
@media print {
    .wcbgd-filters,
    .wcbgd-filter-actions,
    .woocommerce-pagination,
    .wcbgd-modal {
        display: none !important;
    }
    
    .woocommerce-table--order-documents {
        border: 1px solid #000;
    }
    
    .woocommerce-table--order-documents th,
    .woocommerce-table--order-documents td {
        border: 1px solid #000;
        padding: 5px;
    }
}