/* Frontend styles for WooCommerce Invoice PDF Generator */

/* My Account page invoice button styling */
.woocommerce-MyAccount-orders .woocommerce-button.invoice-pdf {
    background-color: #0073aa;
    color: white !important;
    border: 1px solid #0073aa;
    padding: 8px 16px;
    font-size: 13px;
    text-decoration: none;
    border-radius: 3px;
    display: inline-block;
    margin: 2px;
    transition: all 0.2s ease;
    cursor: pointer;
}

.woocommerce-MyAccount-orders .woocommerce-button.invoice-pdf:hover {
    background-color: #005a87;
    border-color: #005a87;
    color: white !important;
}

.woocommerce-MyAccount-orders .woocommerce-button.invoice-pdf:focus {
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.3);
    outline: none;
}

/* Icon for the download button */
.woocommerce-MyAccount-orders .woocommerce-button.invoice-pdf::before {
    content: "\f103"; /* Download icon from dashicons */
    font-family: dashicons;
    margin-right: 5px;
    font-size: 14px;
    vertical-align: middle;
}

/* Order actions container */
.woocommerce-orders-table__cell-order-actions {
    white-space: nowrap;
}

.woocommerce-orders-table__cell-order-actions .woocommerce-button {
    margin-right: 5px;
    margin-bottom: 5px;
}

/* Loading state for frontend */
.invoice-pdf-downloading {
    opacity: 0.7;
    pointer-events: none;
    position: relative;
}

.invoice-pdf-downloading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Success message styling */
.woocommerce-message.invoice-downloaded {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.woocommerce-message.invoice-downloaded::before {
    content: "\f147"; /* Download icon */
    font-family: dashicons;
    margin-right: 8px;
}

/* Error message styling */
.woocommerce-error.invoice-error {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

/* Responsive design for mobile */
@media screen and (max-width: 768px) {
    .woocommerce-MyAccount-orders .woocommerce-button.invoice-pdf {
        font-size: 12px;
        padding: 6px 12px;
        margin: 1px;
    }
    
    .woocommerce-orders-table__cell-order-actions {
        min-width: 120px;
    }
}

@media screen and (max-width: 480px) {
    .woocommerce-MyAccount-orders .woocommerce-button.invoice-pdf {
        display: block;
        width: 100%;
        margin: 2px 0;
        text-align: center;
    }
    
    .woocommerce-orders-table__cell-order-actions .woocommerce-button {
        display: block;
        width: 100%;
        margin: 2px 0;
    }
}

/* Print styles (in case someone wants to print the page) */
@media print {
    .woocommerce-button.invoice-pdf {
        display: none !important;
    }
}