/**
 * WooCommerce Account Search Styles
 * Responsive and WooCommerce-compatible styling
 */

/* ======================================
   SEARCH CONTAINER
   ====================================== */

.wc-account-search-container {
    margin: 20px 0;
    background: #ffffff;
    border: 1px solid #e1e5e9;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.wc-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    margin-bottom: 24px;
}

.wc-search-input-wrapper {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.wc-account-search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.5;
    background: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    color: #374151;
}

.wc-account-search-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wc-search-clear {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    color: #6b7280;
    font-size: 16px;
    display: none;
    opacity: 0.7;
    transition: opacity 0.3s ease;
    border-radius: 4px;
}

.wc-search-clear:hover {
    opacity: 1;
    background: #f3f4f6;
}

.wc-search-clear.visible {
    display: block;
}


/* ======================================
   LOADING STATE
   ====================================== */

.wc-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    text-align: center;
    color: #666;
}

.wc-search-loading .spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #f3f4f6;
    border-top: 2px solid #3b82f6;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

.wc-search-loading .loading-text {
    font-weight: 500;
}

/* ======================================
   SEARCH RESULTS
   ====================================== */

.wc-search-results {
    margin-top: 20px;
}

.wc-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.wc-search-result-item {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 20px;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    margin-bottom: 12px;
}

.wc-search-result-item:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    border-color: #3b82f6;
}

.wc-search-no-results {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 40px 20px;
    text-align: center;
    color: #6b7280;
    font-style: italic;
}

/* ======================================
   ORDER RESULTS
   ====================================== */

.wc-order-item .wc-order-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.wc-order-number {
    font-size: 18px;
    color: #333;
}

.wc-order-status {
    display: flex;
    align-items: center;
}

.wc-order-status span {
    padding: 4px 8px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* WooCommerce order status colors */
.wc-order-status-completed {
    background: #c6e1c6;
    color: #5b841b;
}

.wc-order-status-processing {
    background: #c8d7e1;
    color: #2e4453;
}

.wc-order-status-on-hold {
    background: #f8dda7;
    color: #94660c;
}

.wc-order-status-cancelled {
    background: #eba3a3;
    color: #761919;
}

.wc-order-status-refunded {
    background: #e5e5e5;
    color: #777;
}

.wc-order-status-failed {
    background: #eba3a3;
    color: #761919;
}

.wc-order-total {
    font-size: 18px;
    font-weight: 600;
    color: #3b82f6;
}

.wc-order-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 15px;
}

.wc-order-details > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wc-order-details .label {
    font-weight: 600;
    color: #666;
    min-width: 60px;
}

.wc-order-details .value {
    color: #333;
    flex: 1;
}

.wc-order-actions {
    display: flex;
    justify-content: flex-end;
}

.wc-order-view-link {
    background: #3b82f6 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: background-color 0.3s ease !important;
}

.wc-order-view-link:hover {
    background: #2563eb !important;
    color: #fff !important;
}

/* ======================================
   DOWNLOAD RESULTS
   ====================================== */

.wc-download-item .wc-download-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.wc-download-file {
    font-size: 16px;
    color: #333;
    flex: 1;
    min-width: 0;
}

.wc-download-file strong {
    display: block;
    word-break: break-word;
}

.wc-download-product {
    color: #666;
    font-size: 14px;
    margin-top: 5px;
}

.wc-download-product .product-name {
    font-style: italic;
}

.wc-download-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 15px;
}

.wc-download-details > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wc-download-details .label {
    font-weight: 600;
    color: #666;
    min-width: 120px;
}

.wc-download-details .value {
    color: #333;
    flex: 1;
}

.wc-download-actions {
    display: flex;
    justify-content: flex-end;
}

.wc-download-link {
    background: #10b981 !important;
    color: #fff !important;
    border: none !important;
    padding: 10px 20px !important;
    border-radius: 6px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    transition: background-color 0.3s ease !important;
}

.wc-download-link:hover {
    background: #059669 !important;
    color: #fff !important;
}

/* ======================================
   RESPONSIVE DESIGN
   ====================================== */

@media (max-width: 768px) {
    .wc-account-search-container {
        margin: 15px 0;
        padding: 15px;
    }

    .wc-search-form {
        flex-direction: column;
        gap: 10px;
    }

    .wc-search-input-wrapper {
        width: 100%;
        min-width: auto;
    }

    .wc-order-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .wc-order-number,
    .wc-order-total {
        margin-bottom: 10px;
    }

    .wc-order-details .label {
        min-width: 80px;
    }

    .wc-download-header {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .wc-download-file {
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .wc-account-search-container {
        margin: 10px 0;
        padding: 10px;
    }
    
    .wc-search-input-wrapper {
        min-width: auto;
    }
    
    .wc-account-search-input {
        font-size: 14px;
        padding: 10px 35px 10px 12px;
    }
    
    .wc-account-sort-select {
        font-size: 13px;
        padding: 10px 12px;
    }
    
    .wc-search-result-item {
        padding: 15px;
    }
    
    .wc-order-details,
    .wc-download-details {
        gap: 6px;
    }
    
    .wc-order-details > div,
    .wc-download-details > div {
        flex-direction: column;
        gap: 2px;
    }
    
    .wc-order-details .label,
    .wc-download-details .label {
        min-width: auto;
        font-size: 13px;
    }
    
    .wc-order-view-link,
    .wc-download-link {
        padding: 8px 16px !important;
        font-size: 14px !important;
    }
}

/* ======================================
   ACCESSIBILITY IMPROVEMENTS
   ====================================== */

.wc-account-search-input:focus {
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.wc-search-clear:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

.wc-order-view-link:focus,
.wc-download-link:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}


