/* WHOIS 查询页面专用样式 - LibreDomains */

/* 页面头部统计 */
.header-stats {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.stat-item {
    text-align: center;
    padding: 1rem 1.5rem;
    background: rgba(99, 102, 241, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.stat-item .stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    line-height: 1;
    margin-bottom: 0.25rem;
}

.stat-item .stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* 查询区域 */
.query-section {
    padding: 4rem 0 6rem;
    background: var(--bg-secondary);
}

.query-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: start;
}

.query-form-wrapper {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    position: sticky;
    top: 100px;
}

.query-tabs {
    display: flex;
    background: var(--bg-tertiary);
    border-bottom: 1px solid var(--border-color);
}

.tab-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.tab-btn.active {
    color: var(--primary-color);
    background: white;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.tab-btn:hover:not(.active) {
    background: rgba(99, 102, 241, 0.05);
}

.query-form {
    padding: 2rem;
}

.domain-input-container {
    margin-bottom: 2rem;
}

.input-group {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.input-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem 1rem;
    transition: var(--transition);
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.domain-input {
    flex: 1;
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 500;
}

.domain-input::placeholder {
    color: var(--text-muted);
}

.input-separator {
    color: var(--text-secondary);
    font-weight: 600;
    margin: 0 0.5rem;
    font-size: 1.1rem;
}

.domain-select {
    border: none;
    background: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-primary);
    font-weight: 600;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: var(--border-radius-sm);
}

.domain-select:hover {
    background: rgba(99, 102, 241, 0.1);
}

.query-btn {
    background: var(--gradient-primary);
    color: white;
    border: none;
    border-radius: var(--border-radius);
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    white-space: nowrap;
}

.query-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.query-btn:active {
    transform: translateY(0);
}

.input-hints {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.hint-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.hint-item i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

/* 快速建议 */
.quick-suggestions {
    border-top: 1px solid var(--border-light);
    padding-top: 1.5rem;
}

.quick-suggestions h4 {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.suggestions-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.suggestion-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.suggestion-btn:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.suggestion-btn i {
    font-size: 0.75rem;
}

/* 查询结果 */
.query-results {
    background: white;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.result-placeholder {
    text-align: center;
    color: var(--text-secondary);
}

.placeholder-animation {
    position: relative;
    margin-bottom: 2rem;
}

.search-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.search-waves {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.wave {
    position: absolute;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    opacity: 0;
    animation: wave 2s ease-out infinite;
}

.wave:nth-child(1) {
    animation-delay: 0s;
}

.wave:nth-child(2) {
    animation-delay: 0.5s;
}

.wave:nth-child(3) {
    animation-delay: 1s;
}

@keyframes wave {
    0% {
        width: 0;
        height: 0;
        opacity: 1;
    }
    100% {
        width: 100px;
        height: 100px;
        opacity: 0;
    }
}

.result-placeholder h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

/* 查询结果样式 */
.result-loading,
.result-error,
.result-success,
.result-unavailable,
.result-not-found,
.result-whois,
.result-dns {
    padding: 3rem;
    text-align: center;
    width: 100%;
}

.result-loading {
    color: var(--text-secondary);
}

.loading-animation {
    position: relative;
    margin-bottom: 2rem;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.result-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.result-success .result-icon {
    color: var(--success-color);
}

.result-error .result-icon,
.result-unavailable .result-icon {
    color: var(--error-color);
}

.result-not-found .result-icon {
    color: var(--text-muted);
}

.result-whois .result-icon,
.result-dns .result-icon {
    color: var(--info-color);
}

.domain-name {
    font-family: var(--font-mono);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--primary-color);
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    margin: 1rem 0;
}

.result-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.domain-details,
.whois-details,
.dns-records {
    text-align: left;
    margin: 2rem 0;
}

.detail-section {
    margin-bottom: 2rem;
}

.detail-section h4 {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--border-light);
}

.info-grid {
    display: grid;
    gap: 1rem;
}

.info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
}

.info-value {
    font-weight: 500;
    color: var(--text-primary);
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
}

.info-value a:hover {
    text-decoration: underline;
}

.status-active {
    color: var(--success-color);
    font-weight: 600;
}

/* DNS 记录样式 */
.dns-record {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-sm);
    margin-bottom: 0.75rem;
    border-left: 4px solid var(--border-color);
}

.record-type {
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.record-type.a {
    background: var(--success-color);
    color: white;
}

.record-type.aaaa {
    background: var(--info-color);
    color: white;
}

.record-type.cname {
    background: var(--warning-color);
    color: white;
}

.record-type.txt {
    background: var(--text-secondary);
    color: white;
}

.record-type.mx {
    background: var(--primary-color);
    color: white;
}

.record-details {
    flex: 1;
}

.record-name {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.record-content {
    font-family: var(--font-mono);
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
    word-break: break-all;
}

.record-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.proxied {
    color: var(--warning-color);
    font-weight: 600;
}

.dns-summary {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-light);
    color: var(--text-secondary);
}

/* 查询历史 */
.query-history {
    padding: 4rem 0;
    background: white;
}

.history-container {
    max-width: 800px;
    margin: 0 auto;
}

.history-placeholder {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.history-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    transition: var(--transition);
    cursor: pointer;
}

.history-item:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}

.history-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.history-type {
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-type.availability {
    background: var(--success-color);
    color: white;
}

.history-type.whois {
    background: var(--info-color);
    color: white;
}

.history-type.dns {
    background: var(--warning-color);
    color: white;
}

.history-domain {
    font-family: var(--font-mono);
    font-weight: 600;
    color: var(--text-primary);
}

.history-time {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.history-result {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.history-result.available {
    color: var(--success-color);
}

.history-result.unavailable {
    color: var(--error-color);
}

.history-result.found {
    color: var(--info-color);
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .query-container {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .query-form-wrapper {
        position: static;
    }

    .header-stats {
        justify-content: center;
    }
}

@media (max-width: 768px) {
    .header-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .stat-item {
        width: 100%;
        max-width: 200px;
    }

    .query-tabs {
        flex-direction: column;
    }

    .tab-btn {
        padding: 0.75rem;
    }

    .input-group {
        flex-direction: column;
        gap: 0.75rem;
    }

    .input-hints {
        flex-direction: column;
        gap: 0.5rem;
    }

    .suggestions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .suggestion-btn {
        padding: 0.5rem;
        font-size: 0.75rem;
    }

    .result-actions {
        flex-direction: column;
        align-items: center;
    }

    .info-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .dns-record {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .record-type {
        align-self: flex-start;
    }

    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .history-info {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 480px) {
    .suggestions-grid {
        grid-template-columns: 1fr;
    }

    .query-form {
        padding: 1.5rem;
    }

    .query-results {
        padding: 1.5rem;
    }
}

/* WHOIS 结果增强样式 */
.result-info .info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.result-info .info-item.full-width {
    grid-column: 1 / -1;
}

.result-info .info-item .info-value a {
    color: var(--primary-color);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: var(--transition);
}

.result-info .info-item .info-value a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.result-info .dns-records {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1rem;
}

.result-info .dns-record {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary-color);
}

.result-info .record-type {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    min-width: 60px;
    text-align: center;
}

.result-info .record-type.a {
    background: #e3f2fd;
    color: #1976d2;
}

.result-info .record-type.cname {
    background: #f3e5f5;
    color: #7b1fa2;
}

.result-info .record-type.txt {
    background: #e8f5e8;
    color: #388e3c;
}

.result-info .record-type.mx {
    background: #fff3e0;
    color: #f57c00;
}

.result-info .record-details {
    flex: 1;
    min-width: 0;
}

.result-info .record-name {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.result-info .record-content {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-secondary);
    word-break: break-all;
    margin-bottom: 0.25rem;
}

.result-info .record-meta {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.result-info .proxied {
    color: var(--primary-color);
    font-weight: 500;
}

/* 响应式优化 */
@media (max-width: 768px) {
    .result-info .info-grid {
        grid-template-columns: 1fr;
    }

    .result-info .dns-record {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .result-info .record-type {
        align-self: flex-start;
    }
}