/**
 * Frontend Styles for WHMCS Domain Checker
 */

.whmcs-dc-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 30px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.whmcs-dc-form-wrapper {
    background: var(--background-color, #ffffff);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    padding: 40px;
    transition: all 0.3s ease;
}

.whmcs-dc-header {
    text-align: center;
    margin-bottom: 30px;
}

.whmcs-dc-title {
    color: var(--primary-color, #0073aa);
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 10px 0;
}

.whmcs-dc-subtitle {
    color: var(--text-color, #666);
    font-size: 16px;
    margin: 0;
}

.whmcs-dc-form {
    margin-bottom: 20px;
}

.whmcs-dc-input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.whmcs-dc-input-wrapper {
    flex: 1;
    min-width: 200px;
    position: relative;
}

.whmcs-dc-input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-color, #666);
    margin-bottom: 6px;
}

.whmcs-dc-domain-input {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    transition: all 0.3s ease;
    color: var(--text-color, #333);
    background: #f8f9fa;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    height: 52px;
    box-sizing: border-box;
    line-height: 20px;
}

.whmcs-dc-domain-input:focus {
    outline: none;
    border-color: var(--primary-color, #0073aa);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.whmcs-dc-domain-input::placeholder {
    color: #999;
    opacity: 0.7;
}

.tld-select-wrapper {
    min-width: 180px;
    position: relative;
}

.tld-select-wrapper.hidden {
    display: none;
}

.whmcs-dc-tld-select {
    width: 100%;
    padding: 16px 20px;
    font-size: 16px;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    background: #f8f9fa;
    color: var(--text-color, #333);
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
}

.whmcs-dc-tld-select:focus {
    outline: none;
    border-color: var(--primary-color, #0073aa);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.05);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%230073aa' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.whmcs-dc-tld-select.auto-detected {
    border-color: #4caf50;
    background-color: #f1f8f4;
    animation: highlightExtension 0.5s ease;
}

@keyframes highlightExtension {
    0% { background-color: #f1f8f4; }
    50% { background-color: #e8f5e9; }
    100% { background-color: #f8f9fa; }
}

.whmcs-dc-tld-select.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.whmcs-dc-tld-select.auto-detected {
    border-color: #4caf50;
    background-color: #f1f8f4;
    animation: highlightExtension 0.5s ease;
}

@keyframes highlightExtension {
    0% { background-color: #f1f8f4; }
    50% { background-color: #e8f5e9; }
    100% { background-color: #f8f9fa; }
}

.whmcs-dc-check-button {
    padding: 14px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--button-color, #0073aa);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
    min-width: 150px;
}

.whmcs-dc-check-button:hover {
    background: var(--button-hover-color, #005177);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.whmcs-dc-check-button:active {
    transform: translateY(0);
}

.whmcs-dc-check-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.whmcs-dc-popular-tlds {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

.popular-label {
    color: var(--text-color, #666);
    font-size: 14px;
    font-weight: 500;
}

.popular-tld-list {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.popular-tld-item {
    padding: 6px 12px;
    background: #f5f5f5;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-color, #333);
    cursor: pointer;
    transition: all 0.2s ease;
}

.popular-tld-item:hover {
    background: var(--primary-color, #0073aa);
    color: #fff;
    border-color: var(--primary-color, #0073aa);
}

/* Results */
.whmcs-dc-results {
    margin-top: 30px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.whmcs-dc-result-content {
    background: #f9f9f9;
    border-radius: 8px;
    padding: 25px;
    border-left: 4px solid var(--primary-color, #0073aa);
}

.whmcs-dc-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 10px;
}

.whmcs-dc-result-header h3 {
    margin: 0;
    font-size: 22px;
    color: var(--text-color, #333);
    font-weight: 600;
}

.whmcs-dc-status {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.whmcs-dc-status.available {
    background: #4caf50;
    color: #fff;
}

.whmcs-dc-status.unavailable {
    background: #f44336;
    color: #fff;
}

.whmcs-dc-result-body {
    color: var(--text-color, #333);
}

.whmcs-dc-price-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
    font-size: 18px;
}

.whmcs-dc-price-label {
    font-weight: 500;
    color: var(--text-color, #666);
}

.whmcs-dc-price-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--primary-color, #0073aa);
}

.whmcs-dc-order-button {
    display: inline-block;
    padding: 12px 30px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: var(--button-color, #0073aa);
    border: none;
    border-radius: 8px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 15px;
}

.whmcs-dc-order-button:hover {
    background: var(--button-hover-color, #005177);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3);
}

.whmcs-dc-whois-info {
    margin-top: 20px;
    padding: 15px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
}

.whmcs-dc-whois-info h4 {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: var(--text-color, #333);
}

.whmcs-dc-whois-info pre {
    margin: 0;
    padding: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-color, #666);
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 300px;
    overflow-y: auto;
}

.whmcs-dc-error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #f44336;
    margin-top: 20px;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .whmcs-dc-form-wrapper {
        padding: 25px 20px;
    }
    
    .whmcs-dc-input-group {
        flex-direction: column;
    }
    
    .whmcs-dc-input-wrapper,
    .tld-select-wrapper {
        width: 100%;
        min-width: 100%;
    }
    
    .whmcs-dc-domain-input,
    .whmcs-dc-tld-select {
        width: 100%;
    }
    
    .whmcs-dc-check-button {
        width: 100%;
    }
    
    .whmcs-dc-title {
        font-size: 24px;
    }
    
    .whmcs-dc-result-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

