/**
 * ARPHost Domain Search — Frontend Styles
 *
 * Uses theme CSS custom properties so it auto-adapts to light/dark mode.
 * All classes are prefixed with .arphost-ds- to avoid conflicts.
 *
 * @package Arphost_Domain_Search
 */

/* ==========================================================================
   Search Form
   ========================================================================== */

.arphost-ds-wrap {
    max-width: 720px;
    margin: 0 auto 2rem;
}

.arphost-ds-form {
    margin-bottom: 1rem;
}

.arphost-ds-input-group {
    display: flex;
    border-radius: var(--radius-lg, 16px);
    overflow: hidden;
    box-shadow: var(--shadow-lg, 0 10px 15px -3px rgb(0 0 0 / 0.1));
    border: 2px solid var(--border-color, #e2e8f0);
    transition: border-color var(--transition-base, 250ms ease),
                box-shadow var(--transition-base, 250ms ease);
}

.arphost-ds-input-group:focus-within {
    border-color: var(--brand-primary, #0891b2);
    box-shadow: var(--shadow-glow, 0 0 40px rgba(8, 145, 178, 0.15));
}

.arphost-ds-input {
    flex: 1;
    padding: 16px 20px;
    font-size: 1.1rem;
    border: none;
    outline: none;
    background: var(--bg-input, #fff);
    color: var(--text-primary, #0f172a);
    font-family: inherit;
}

.arphost-ds-input::placeholder {
    color: var(--text-muted, #64748b);
}

.arphost-ds-btn {
    padding: 16px 28px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    white-space: nowrap;
    background: linear-gradient(135deg, var(--brand-primary, #0891b2), var(--brand-primary-dark, #0e7490));
    color: #fff;
    transition: background var(--transition-base, 250ms ease),
                transform var(--transition-fast, 150ms ease);
    font-family: inherit;
}

.arphost-ds-btn:hover {
    background: linear-gradient(135deg, var(--brand-primary-light, #22d3ee), var(--brand-primary, #0891b2));
}

.arphost-ds-btn:active {
    transform: scale(0.97);
}

.arphost-ds-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.arphost-ds-btn i {
    margin-right: 6px;
}

/* Radio options */
.arphost-ds-options {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-top: 12px;
}

.arphost-ds-radio {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--text-secondary, #475569);
}

.arphost-ds-radio input[type="radio"] {
    accent-color: var(--brand-primary, #0891b2);
    width: 16px;
    height: 16px;
}

/* ==========================================================================
   Loading & Error States
   ========================================================================== */

.arphost-ds-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 1.5rem;
    color: var(--text-secondary, #475569);
    font-size: 0.95rem;
}

.arphost-ds-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid var(--border-color, #e2e8f0);
    border-top-color: var(--brand-primary, #0891b2);
    border-radius: 50%;
    animation: arphost-ds-spin 0.7s linear infinite;
    display: inline-block;
}

@keyframes arphost-ds-spin {
    to { transform: rotate(360deg); }
}

.arphost-ds-error {
    text-align: center;
    padding: 1rem;
    color: var(--brand-danger, #ef4444);
    font-weight: 500;
    background: rgba(239, 68, 68, 0.08);
    border-radius: var(--radius-md, 10px);
    margin-top: 1rem;
}

/* ==========================================================================
   Results
   ========================================================================== */

.arphost-ds-results {
    max-width: 720px;
    margin: 0 auto 2rem;
}

.arphost-ds-result-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-color, #e2e8f0);
    border-radius: var(--radius-lg, 16px);
    margin-bottom: 12px;
    box-shadow: var(--shadow-card, 0 1px 3px 0 rgb(0 0 0 / 0.1));
    transition: box-shadow var(--transition-base, 250ms ease),
                border-color var(--transition-base, 250ms ease),
                transform var(--transition-base, 250ms ease);
    flex-wrap: wrap;
    gap: 12px;
}

.arphost-ds-result-card:hover {
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1));
    transform: translateY(-1px);
}

.arphost-ds-result-card.available {
    border-left: 4px solid var(--brand-success, #10b981);
}

.arphost-ds-result-card.taken {
    border-left: 4px solid var(--text-muted, #64748b);
    opacity: 0.7;
}

.arphost-ds-result-domain {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--text-primary, #0f172a);
    min-width: 180px;
}

.arphost-ds-result-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: var(--radius-full, 9999px);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arphost-ds-result-badge.available {
    background: rgba(16, 185, 129, 0.12);
    color: var(--brand-success, #10b981);
}

.arphost-ds-result-badge.taken {
    background: rgba(100, 116, 139, 0.12);
    color: var(--text-muted, #64748b);
}

.arphost-ds-result-price {
    font-weight: 600;
    color: var(--brand-primary, #0891b2);
    font-size: 1.05rem;
    min-width: 80px;
    text-align: center;
}

.arphost-ds-result-actions {
    display: flex;
    gap: 8px;
}

.arphost-ds-result-btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: var(--radius-sm, 6px);
    text-decoration: none;
    text-align: center;
    transition: background var(--transition-fast, 150ms ease),
                transform var(--transition-fast, 150ms ease);
    cursor: pointer;
    border: none;
    font-family: inherit;
    letter-spacing: 0.3px;
}

.arphost-ds-result-btn.register {
    background: linear-gradient(135deg, var(--brand-primary, #0891b2), var(--brand-primary-dark, #0e7490));
    color: #fff;
}

.arphost-ds-result-btn.register:hover {
    background: linear-gradient(135deg, var(--brand-primary-light, #22d3ee), var(--brand-primary, #0891b2));
    transform: translateY(-1px);
}

.arphost-ds-result-btn.transfer {
    background: var(--bg-surface-hover, #f1f5f9);
    color: var(--brand-primary, #0891b2);
    border: 1px solid var(--border-color, #e2e8f0);
}

.arphost-ds-result-btn.transfer:hover {
    background: var(--bg-surface, #fff);
    border-color: var(--brand-primary, #0891b2);
}

/* ==========================================================================
   TLD Pricing Table
   ========================================================================== */

.arphost-ds-pricing-wrap {
    max-width: 860px;
    margin: 2rem auto;
}

.arphost-ds-pricing-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.arphost-ds-pricing-header h3 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary, #0f172a);
    margin-bottom: 0.5rem;
}

.arphost-ds-pricing-header p {
    color: var(--text-secondary, #475569);
    font-size: 0.95rem;
}

.arphost-ds-pricing-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: var(--radius-lg, 16px);
    border: 1px solid var(--border-color, #e2e8f0);
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgb(0 0 0 / 0.1));
}

.arphost-ds-pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.arphost-ds-pricing-table thead {
    background: linear-gradient(135deg, var(--brand-primary, #0891b2), var(--brand-primary-dark, #0e7490));
}

.arphost-ds-pricing-table thead th {
    color: #fff;
    padding: 14px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.arphost-ds-pricing-table tbody tr {
    border-bottom: 1px solid var(--border-color, #e2e8f0);
    transition: background var(--transition-fast, 150ms ease);
}

.arphost-ds-pricing-table tbody tr:last-child {
    border-bottom: none;
}

.arphost-ds-pricing-table tbody tr:hover {
    background: var(--bg-surface-hover, #f1f5f9);
}

.arphost-ds-pricing-table td {
    padding: 12px 20px;
    color: var(--text-primary, #0f172a);
    background: var(--bg-card, #fff);
}

.arphost-ds-pricing-table tbody tr:hover td {
    background: var(--bg-surface-hover, #f1f5f9);
}

.arphost-ds-pricing-table .tld-name {
    font-weight: 700;
    color: var(--brand-primary, #0891b2);
}

.arphost-ds-pricing-table .tld-popular {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: rgba(245, 158, 11, 0.12);
    color: var(--brand-secondary, #f59e0b);
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: var(--radius-full, 9999px);
    text-transform: uppercase;
}

.arphost-ds-loading-cell {
    text-align: center;
    padding: 2rem !important;
    color: var(--text-muted, #64748b);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 640px) {
    .arphost-ds-input-group {
        flex-direction: column;
        border-radius: var(--radius-md, 10px);
    }

    .arphost-ds-input {
        border-bottom: 1px solid var(--border-color, #e2e8f0);
        padding: 14px 16px;
        font-size: 1rem;
    }

    .arphost-ds-btn {
        padding: 14px 20px;
    }

    .arphost-ds-result-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .arphost-ds-result-actions {
        width: 100%;
    }

    .arphost-ds-result-btn {
        flex: 1;
        text-align: center;
    }

    .arphost-ds-pricing-table {
        font-size: 0.85rem;
    }

    .arphost-ds-pricing-table thead th,
    .arphost-ds-pricing-table td {
        padding: 10px 12px;
    }
}
