* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f4f6f8;
    min-height: 100vh;
    color: #333;
}

.container { max-width: 1200px; margin: 0 auto; padding: 20px; }
.header { text-align: center; margin-bottom: 40px; color: #0d6efd; }
.header h1 { font-size: 3rem; margin-bottom: 10px; }
.header p { font-size: 1.2rem; color: #5f6b76; }

.search-section, .results-section, .loading {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}
.search-section { padding: 40px; margin-bottom: 30px; }
.search-box { display: flex; gap: 15px; margin-bottom: 30px; }
#domainInput {
    flex: 1; padding: 15px 20px; border: 2px solid #e1e5e9; border-radius: 10px;
    font-size: 16px; transition: border-color .2s, box-shadow .2s;
}
#domainInput:focus { outline: none; border-color: #0d6efd; box-shadow: 0 0 0 3px rgba(13,110,253,.12); }

#checkButton, .tld-btn.selected, .btn-whois {
    background: #0d6efd; color: #fff; border-color: #0d6efd;
}
#checkButton {
    padding: 15px 30px; border: 1px solid #0d6efd; border-radius: 10px;
    font-size: 16px; font-weight: 600; cursor: pointer;
}
#checkButton:hover, .tld-btn.selected:hover, .btn-whois:hover { background: #0b5ed7; border-color: #0b5ed7; }
#checkButton:disabled { opacity: .65; cursor: not-allowed; }

.tld-selection { margin-bottom: 0; }
.tld-selection h3 { margin-bottom: 15px; color: #2d3748; }
.tld-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 10px; }
.tld-btn {
    padding: 10px; border: 2px solid #e2e8f0; border-radius: 8px; background: #fff;
    cursor: pointer; text-align: center; font-weight: 600; color: #334155;
}
.tld-btn:hover { border-color: #0d6efd; }

.results-section { padding: 30px; margin-bottom: 30px; }
.results-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; gap: 15px; }
.results-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn-exportar, .btn-limpiar {
    padding: 10px 20px; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600;
}
.btn-exportar { background: #198754; }
.btn-exportar:hover { background: #157347; }
.btn-limpiar { background: #dc3545; }
.btn-limpiar:hover { background: #bb2d3b; }

.results-grid { display: grid; gap: 15px; }
.domain-result {
    display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px;
    padding: 20px; border: 1px solid #e2e8f0; border-radius: 12px;
}
.domain-result.available { border-left: 4px solid #48bb78; }
.domain-result.taken { border-left: 4px solid #f56565; }
.domain-info { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.domain-name { font-size: 18px; font-weight: 600; }
.domain-status { padding: 4px 12px; border-radius: 20px; font-size: 12px; font-weight: 600; text-transform: uppercase; }
.status-available { background: #c6f6d5; color: #22543d; }
.status-taken { background: #fed7d7; color: #742a2a; }
.status-unknown { background: #fff3cd; color: #664d03; }
.domain-actions { display: flex; gap: 10px; }
.btn-register {
    padding: 8px 16px; background: #198754; color: #fff; border: none; border-radius: 6px; cursor: pointer; font-weight: 600;
}
.btn-register:hover { background: #157347; }
.btn-whois { padding: 8px 16px; border: 1px solid #0d6efd; border-radius: 6px; cursor: pointer; font-weight: 600; }
.whois-unavailable { color: #6c757d; font-size: 13px; }

.whois-info { width: 100%; margin-top: 5px; padding: 18px; background: #f8f9fa; border: 1px solid #e2e8f0; border-radius: 10px; }
.whois-info h4 { color: #0d6efd; margin-bottom: 15px; }
.whois-details { display: grid; gap: 9px; }
.whois-details > div { line-height: 1.5; }
.expiry-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.expiry-badge {
    display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 12px;
    color: #fff; font-size: 12px; font-weight: 700; white-space: nowrap;
}
.expiry-green { background: #198754; }
.expiry-orange { background: #fd7e14; }
.expiry-red { background: #dc3545; }
.expiry-blue { background: #0d6efd; }

.loading { text-align: center; padding: 40px; }
.spinner {
    width: 40px; height: 40px; margin: 0 auto 15px; border: 4px solid #dee2e6;
    border-top-color: #0d6efd; border-radius: 50%; animation: spin 1s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 768px) {
    .header h1 { font-size: 2rem; }
    .search-section, .results-section { padding: 20px; }
    .search-box { flex-direction: column; }
    #checkButton { width: 100%; }
    .results-header { flex-direction: column; align-items: flex-start; }
}
