/**
 * DocFlow Pro WooCommerce Integration Styles
 * 
 * @package DocFlowPro
 * @since 1.0.0
 */

/* DocFlow Downloads Section */
.docflow-downloads-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.docflow-downloads-section h2 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.25rem;
    font-weight: 600;
}

.docflow-downloads-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.docflow-download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.docflow-download-item:hover {
    border-color: #0073aa;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.1);
}

.download-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.file-icon {
    font-size: 1.5rem;
    color: #6c757d;
}

.file-name {
    font-weight: 500;
    color: #495057;
}

.download-actions {
    display: flex;
    gap: 0.5rem;
}

.docflow-download-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.docflow-download-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

/* My Account Downloads */
.docflow-my-account-downloads {
    margin: 1.5rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.docflow-my-account-downloads h3 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

/* Email Downloads */
.docflow-email-downloads {
    margin: 1rem 0;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
}

.docflow-email-downloads p {
    margin: 0.5rem 0;
}

.docflow-email-downloads a {
    color: #0073aa;
    text-decoration: none;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .docflow-download-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .download-actions {
        width: 100%;
    }
    
    .docflow-download-btn {
        width: 100%;
        justify-content: center;
    }
}

/* WooCommerce Theme Compatibility */
.woocommerce .docflow-downloads-section {
    margin: 2rem 0;
}

.woocommerce .docflow-download-btn {
    background: #0073aa;
    color: white;
}

.woocommerce .docflow-download-btn:hover {
    background: #005a87;
    color: white;
}

/* Storefront Theme Compatibility */
.storefront .docflow-downloads-section {
    margin: 2rem 0;
}

/* Astra Theme Compatibility */
.astra .docflow-downloads-section {
    margin: 2rem 0;
}

/* GeneratePress Theme Compatibility */
.generatepress .docflow-downloads-section {
    margin: 2rem 0;
}

/* DocFlow Downloads Page */
.docflow-downloads-page {
    margin: 2rem 0;
}

.docflow-downloads-page h2 {
    color: #495057;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.docflow-page-description {
    color: #6c757d;
    margin-bottom: 2rem;
    font-size: 1rem;
}

.docflow-order-section {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.order-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.order-header h3 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.order-meta {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.order-date {
    color: #6c757d;
    font-size: 0.9rem;
}

.order-status {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-completed {
    background: #d4edda;
    color: #155724;
}

.status-processing {
    background: #fff3cd;
    color: #856404;
}

.docflow-files-list {
    padding: 1.5rem;
}

.docflow-no-orders {
    text-align: center;
    padding: 3rem 1rem;
    color: #6c757d;
}

.docflow-error {
    text-align: center;
    padding: 2rem 1rem;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    color: #721c24;
    margin: 1rem 0;
}

/* DocFlow Tracking Page */
.docflow-tracking-page {
    margin: 2rem 0;
}

.docflow-tracking-page h2 {
    color: #495057;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.docflow-orders-table {
    margin-top: 2rem;
}

.docflow-track-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0073aa;
    color: white;
    text-decoration: none;
    border: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.docflow-track-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.no-tracking {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* WooCommerce Table Compatibility */
.woocommerce-orders-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.woocommerce-orders-table th,
.woocommerce-orders-table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.woocommerce-orders-table th {
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.woocommerce-orders-table tbody tr:hover {
    background: #f8f9fa;
}

/* Responsive Design */
@media (max-width: 768px) {
    .order-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .woocommerce-orders-table {
        font-size: 0.9rem;
    }
    
    .woocommerce-orders-table th,
    .woocommerce-orders-table td {
        padding: 0.75rem 0.5rem;
    }
}

/* Tracking Data Display */
.tracking-data-display {
    margin-top: 2rem;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.tracking-data-header {
    background: #f8f9fa;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.tracking-data-header h3 {
    margin: 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.close-tracking {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-tracking:hover {
    background: #e9ecef;
    color: #495057;
}

.tracking-data-content {
    padding: 1.5rem;
}

.tracking-loading {
    text-align: center;
    color: #6c757d;
    font-style: italic;
}

.tracking-error {
    text-align: center;
    color: #dc3545;
    font-weight: 500;
}

.tracking-status {
    margin-bottom: 1.5rem;
}

.tracking-status h4 {
    margin: 0 0 0.5rem 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.tracking-timeline {
    margin-top: 1.5rem;
}

.tracking-timeline h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.timeline-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.timeline-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #0073aa;
}

.timeline-icon {
    font-size: 1.25rem;
    color: #0073aa;
    flex-shrink: 0;
}

.timeline-content {
    flex: 1;
}

.timeline-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 0.25rem;
}

.timeline-description {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Status Badge Styles */
.docflow-status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    color: white;
}

.docflow-status-badge.pending_payment {
    background: #ffc107;
    color: #212529;
}

.docflow-status-badge.payment_completed {
    background: #28a745;
}

.docflow-status-badge.in_progress {
    background: #17a2b8;
}

.docflow-status-badge.completed {
    background: #28a745;
}

.docflow-status-badge.rejected {
    background: #dc3545;
}

/* ========================================
   DOCFLOW CHECKOUT FIELDS - ISOLATED STYLES
   ======================================== */

/* Main DocFlow checkout section - completely isolated */
.docflow-checkout-fields-section {
    background: #f9f9f9;
    border: 1px solid #0073aa;
    border-radius: 4px;
    padding: 20px;
    margin: 30px 0;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    clear: both;
    float: none;
    display: block;
    font-family: inherit;
    overflow: visible;
}

/* DocFlow section title */
.docflow-checkout-fields-section > h3 {
    color: #333;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding: 0 0 10px 0;
    display: block;
    line-height: 1.4;
    font-family: inherit;
    border-bottom: 1px solid #ddd;
}

/* DocFlow description */
.docflow-checkout-fields-section .docflow-description {
    color: #6c757d;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
}

/* DocFlow product fields container */
.docflow-checkout-fields-section .docflow-product-fields {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e9ecef;
}

.docflow-checkout-fields-section .docflow-product-fields:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

/* DocFlow product title */
.docflow-checkout-fields-section .docflow-product-title {
    color: #0073aa;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 15px 0;
    padding: 8px 0;
    border-bottom: 2px solid #0073aa;
    font-family: inherit;
}

/* DocFlow fields container */
.docflow-checkout-fields-section .docflow-fields-container {
    display: block;
    width: 100%;
}

/* DocFlow individual field group */
.docflow-checkout-fields-section .docflow-field-group {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
    box-sizing: border-box;
}

/* DocFlow field labels */
.docflow-checkout-fields-section .docflow-field-group label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
    font-family: inherit;
}

/* DocFlow input fields - using specific class names to avoid conflicts */
.docflow-checkout-fields-section .docflow-input-text,
.docflow-checkout-fields-section .docflow-date-input,
.docflow-checkout-fields-section .docflow-file-input,
.docflow-checkout-fields-section .docflow-textarea,
.docflow-checkout-fields-section .docflow-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    transition: all 0.3s ease;
    background: white;
    box-sizing: border-box;
    font-family: inherit;
    color: #333;
    display: block;
    height: auto;
    min-height: 40px;
    opacity: 1;
    visibility: visible;
}

/* DocFlow focus states */
.docflow-checkout-fields-section .docflow-input-text:focus,
.docflow-checkout-fields-section .docflow-date-input:focus,
.docflow-checkout-fields-section .docflow-file-input:focus,
.docflow-checkout-fields-section .docflow-textarea:focus,
.docflow-checkout-fields-section .docflow-select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

/* DocFlow textarea specific */
.docflow-checkout-fields-section .docflow-textarea {
    resize: vertical;
    min-height: 100px;
}

/* DocFlow file input specific */
.docflow-checkout-fields-section .docflow-file-input {
    border-style: dashed;
    cursor: pointer;
}

.docflow-checkout-fields-section .docflow-file-input:hover {
    border-color: #0073aa;
    background: #f8f9fa;
}

/* DocFlow file info */
.docflow-checkout-fields-section .docflow-file-info {
    display: block;
    margin-top: 8px;
    color: #6c757d;
    font-size: 12px;
    font-family: inherit;
}

/* DocFlow checkbox groups */
.docflow-checkout-fields-section .docflow-checkbox-group {
    display: block;
    padding: 12px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin-bottom: 10px;
}

.docflow-checkout-fields-section .checkbox-label {
    display: block;
    margin-bottom: 8px;
    padding: 5px 0;
    font-weight: normal;
    cursor: pointer;
    font-family: inherit;
    color: #333;
}

.docflow-checkout-fields-section .checkbox-label input[type="checkbox"] {
    width: auto;
    margin-right: 8px;
    vertical-align: middle;
}

/* DocFlow file upload container */
.docflow-checkout-fields-section .docflow-file-upload-container {
    position: relative;
    width: 100%;
}

/* Responsive design for DocFlow section */
@media (max-width: 768px) {
    .docflow-checkout-fields-section {
        padding: 15px;
        margin: 20px 0;
    }
}

/* Cart Item Data Display */
.woocommerce-cart-form .cart_item .docflow-data {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 0.5rem;
}

.woocommerce-cart-form .cart_item .docflow-data strong {
    color: #495057;
}

/* Error and Success Messages */
.docflow-error-message,
.docflow-success-message {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-weight: 500;
}

.docflow-error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.docflow-success-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

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

.docflow-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: docflow-spin 1s linear infinite;
}

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