/* WooCommerce Orders Search Styles */

/* Variables using CSS custom properties for consistency */
:root {
    --wc-search-primary: #fff;
    --wc-search-secondary: #6c757d;
    --wc-search-border: #eee;
    --wc-search-bg: #f8f9fa;
    --wc-search-shadow: 0 2px 8px rgba(0,0,0,0.08);
    --wc-search-radius: 8px;
    --wc-search-transition: all 0.3s ease;
}

/* Main wrapper */
.wc-orders-search-wrapper {
    margin-bottom: 30px;
    padding: 0;
    background: var(--wc-search-primary);
    border-radius: 1px;
    border: none;
    box-shadow: none;
}

/* Form layout */
.wc-orders-search-form {
    display: flex;
    gap: 15px;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

/* Input styling */
#wc-orders-search-input {
    width: 100%;
    padding: 15px 20px 15px 50px;
    border: 1px solid #eee;
    border-radius: 2px;
    font-size: 1rem;
    transition: var(--wc-search-transition);
    background: #fff;
    box-shadow: none;
    height: 42px;
    box-sizing: border-box;
}

#wc-orders-search-input:focus {
    outline: none;
    border-color: none;
    box-shadow: none;
    transform: none;
}

/* Search icon */
.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-icon img {
    width: 15px;
    height: 15px;
    opacity: 0.6;
    transition: opacity 0.3s ease;
}

#wc-orders-search-input:focus + .search-icon img {
    opacity: 0.8;
}

/* Buttons */
.search-buttons {
    display: flex;
    gap: 10px;
}

#wc-orders-search-btn,
#wc-orders-clear-btn,
.button.secondary {
    padding: 15px 25px;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 400;
    transition: var(--wc-search-transition);
    letter-spacing: 0.5px;
    height: 42px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 100px;
    text-decoration: none;
	font-family: 'Inter';
}

#wc-orders-search-btn {
    background: #3398d6;
    color: white;
}

#wc-orders-search-btn:hover {
    background: #ffd13b;
    box-shadow: none;
}

.button.secondary {
    background: #8f5cc4;
    color: white;
}

.button.secondary:hover {
    background: #ffd13b;
}

/* Results */
.search-results-header {
    padding: 18px 24px;
    background: none;
    border: 1px solid #eee;
    border-radius: 1px;
    margin-bottom: 20px;
    font-weight: 600;
    color: #155724;
	font-family: 'Inter';
}

.no-orders-found {
    padding: 25px;
    text-align: center;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 1px solid #ffc107;
    border-radius: var(--wc-search-radius);
    color: #856404;
    font-size: 16px;
    margin: 0;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.1);
}

/* Search results table */
.search-results .woocommerce-orders-table {
    margin-top: 0;
    border-radius: 12px;
    overflow: hidden;
    border: none;
}

.search-results .woocommerce-orders-table th {
    background: transparent;
    font-weight: 600;
    padding: 16px 20px;
    border-bottom: 2px solid var(--wc-search-border);
}

.search-results .woocommerce-orders-table td {
    padding: 16px 20px;
    vertical-align: middle;
}

.search-results .woocommerce-orders-table tbody tr {
    transition: var(--wc-search-transition);
}

.search-results .woocommerce-orders-table tbody tr:hover {
    background: var(--wc-search-bg);
    transform: translateX(5px);
}

.search-results .woocommerce-orders-table tbody tr:nth-child(even) {
    background: rgba(248, 249, 250, 0.5);
}

/* Pagination */
.wc-orders-search-pagination {
    margin-top: 30px;
    padding: 20px;
    background: #fff;
    border-radius: var(--wc-search-radius);
    border: 1px solid var(--wc-search-border);
    box-shadow: var(--wc-search-shadow);
}

.pagination-info {
    text-align: center;
    margin-bottom: 15px;
    color: var(--wc-search-secondary);
    font-size: 14px;
    font-weight: 500;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.pagination-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 12px;
    border: 2px solid var(--wc-search-border);
    border-radius: 6px;
    background: #fff;
    color: #495057;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: var(--wc-search-transition);
    line-height: 1;
}

.pagination-link:hover {
    background: var(--wc-search-primary);
    border-color: var(--wc-search-primary);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.2);
}

.pagination-link.current {
    background: var(--wc-search-primary);
    border-color: var(--wc-search-primary);
    color: #fff;
    font-weight: 600;
}

.pagination-link.prev,
.pagination-link.next {
    min-width: 80px;
    font-weight: 600;
}

.pagination-ellipsis {
    color: var(--wc-search-secondary);
    font-weight: 600;
    padding: 0 8px;
}

/* Admin Bar Search */
#wp-admin-bar-wc-orders-search-admin-bar .wc-admin-search-container {
    display: flex;
    align-items: center;
    gap: 0;
}

#wp-admin-bar-wc-orders-search-admin-bar .wc-admin-search-container input[type="text"] {
    border: 1px solid #ddd;
    border-radius: 30px 0 0 30px;
    padding: 2px 15px;
    font-size: 12px;
    background: #fff;
    color: #333;
    transition: border-color 0.2s ease;
    border-right: none;
    height: 25px;
}

#wp-admin-bar-wc-orders-search-admin-bar .wc-admin-search-container button {
    border: 1px solid var(--wc-search-primary);
    border-radius: 0 30px 30px 0;
    padding: 2px 10px;
    font-size: 11px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    background: var(--wc-search-primary);
    color: #fff;
    height: 25px;
    line-height: 1;
    border-left: none;
}

#wp-admin-bar-wc-orders-search-admin-bar .wc-admin-search-container button:hover {
    background: #005a87;
    border-color: #005a87;
}

/* Responsive Design */
@media (max-width: 782px) {
    #wp-admin-bar-wc-orders-search-admin-bar {
        display: none;
    }
}

@media (max-width: 768px) {
    .wc-orders-search-wrapper {
        padding: 20px 15px;
        margin-bottom: 20px;
    }
    
    .wc-orders-search-form {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .search-buttons {
        flex-direction: column;
        gap: 10px;
    }
    
    #wc-orders-search-btn,
    .button.secondary {
        width: 100%;
        min-width: unset;
    }
    
    #wc-orders-search-input {
        font-size: 16px; /* Prevent zoom on iOS */
        height: 52px;
    }
    
    .pagination-links {
        gap: 4px;
    }
    
    .pagination-link {
        min-width: 35px;
        height: 35px;
        font-size: 12px;
        padding: 6px 8px;
    }
    
    .pagination-link.prev,
    .pagination-link.next {
        min-width: 60px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .wc-orders-search-wrapper {
        padding: 15px 10px;
    }
    
    #wc-orders-search-input {
        padding: 12px 15px 12px 40px;
        height: 52px;
    }
    
    .search-icon {
        left: 15px;
    }
    
    .search-icon img {
        width: 16px;
        height: 16px;
    }
    
    #wc-orders-search-btn,
    .button.secondary {
        padding: 12px 20px;
        font-size: 13px;
    }
    
    .pagination-links {
        gap: 2px;
    }
    
    .pagination-link {
        min-width: 30px;
        height: 30px;
        font-size: 11px;
        padding: 4px 6px;
    }
    
    .pagination-link.prev,
    .pagination-link.next {
        min-width: 50px;
        font-size: 10px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.search-results {
    animation: fadeIn 0.4s ease-out;
}

/* Focus states for accessibility */
#wc-orders-search-btn:focus,
.button.secondary:focus {
    outline: 3px solid var(--wc-search-primary);
    outline-offset: 2px;
}
