* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #334155 100%);
    color: #e2e8f0;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    margin: 0;
    padding: 20px;
}

.container {
    max-width: 900px;
    width: 100%;
}

header {
    text-align: center;
    margin-bottom: 30px;
}

h1 {
    color: #38bdf8;
    margin: 0 0 10px 0;
    font-size: 2.5rem;
    font-weight: 700;
    text-shadow: 0 2px 10px rgba(56, 189, 248, 0.3);
}

.subtitle {
    color: #94a3b8;
    font-size: 1.1rem;
    margin: 0;
}

.form {
    display: flex;
    gap: 12px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

input {
    flex: 1;
    min-width: 250px;
    padding: 14px 18px;
    border-radius: 12px;
    border: 2px solid #334155;
    background: #1e293b;
    color: #e2e8f0;
    font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
}

input::placeholder {
    color: #64748b;
}

button {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    border: none;
    color: #0f172a;
    padding: 14px 32px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 12px rgba(56, 189, 248, 0.3);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(56, 189, 248, 0.4);
}

button:active {
    transform: translateY(0);
}

.stats {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.stat-item {
    background: #1e293b;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid #334155;
}

.stat-label {
    color: #94a3b8;
    font-size: 0.875rem;
    margin-right: 8px;
}

.stat-value {
    color: #38bdf8;
    font-weight: 600;
}

.card {
    background: #1e293b;
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    border: 1px solid #334155;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #334155;
}

.card-header.success {
    background: linear-gradient(135deg, #1e293b 0%, #0f766e 100%);
}

.card-header.error {
    background: linear-gradient(135deg, #1e293b 0%, #7f1d1d 100%);
}

.card-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: #e2e8f0;
}

.card-body {
    padding: 24px;
}

.record-section {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #334155;
}

.record-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.record-type {
    color: #38bdf8;
    font-weight: 600;
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.record-value {
    color: #e2e8f0;
    font-size: 1.1rem;
    font-family: 'Monaco', 'Courier New', monospace;
}

.record-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.badge {
    background: #334155;
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Monaco', 'Courier New', monospace;
    border: 1px solid #475569;
}

.mx-record {
    display: flex;
    align-items: center;
    gap: 8px;
}

.priority {
    background: #0ea5e9;
    color: #0f172a;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.75rem;
}

.soa-details {
    background: #0f172a;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.9rem;
}

.soa-details div {
    padding: 6px 0;
    border-bottom: 1px solid #1e293b;
}

.soa-details div:last-child {
    border-bottom: none;
}

.soa-details strong {
    color: #38bdf8;
    margin-right: 8px;
}

.txt-records {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.txt-record {
    background: #0f172a;
    padding: 12px;
    border-radius: 6px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #cbd5e1;
    word-break: break-all;
    border-left: 3px solid #38bdf8;
}

.error {
    color: #fca5a5;
    font-weight: 600;
}

.error-card {
    border-color: #991b1b;
}

.warning-card {
    border-color: #f59e0b;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.loading p {
    color: #38bdf8;
    font-size: 1.1rem;
    margin-top: 20px;
}

.spinner {
    border: 4px solid #334155;
    border-top: 4px solid #38bdf8;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.secondary-button {
    background: linear-gradient(135deg, #64748b 0%, #475569 100%);
    color: #e2e8f0;
}

.secondary-button:hover {
    box-shadow: 0 6px 20px rgba(100, 116, 139, 0.4);
}

.hidden {
    display: none !important;
}

.history-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 450px;
    height: 100vh;
    background: #1e293b;
    border-left: 2px solid #334155;
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    overflow-y: auto;
}

.history-header {
    padding: 24px;
    border-bottom: 2px solid #334155;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(135deg, #1e293b 0%, #0f766e 100%);
}

.history-header h2 {
    margin: 0;
    color: #e2e8f0;
    font-size: 1.5rem;
}

.close-button {
    background: transparent;
    border: none;
    color: #e2e8f0;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
    min-width: auto;
    box-shadow: none;
}

.close-button:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: none;
}

.history-tabs {
    display: flex;
    padding: 16px;
    gap: 8px;
    border-bottom: 1px solid #334155;
}

.tab-button {
    flex: 1;
    padding: 10px 16px;
    background: #334155;
    color: #94a3b8;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
    min-width: auto;
    box-shadow: none;
}

.tab-button:hover {
    background: #475569;
    color: #e2e8f0;
    transform: none;
}

.tab-button.active {
    background: linear-gradient(135deg, #38bdf8 0%, #0ea5e9 100%);
    color: #0f172a;
    font-weight: 600;
}

.history-content {
    padding: 16px;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-item {
    background: #0f172a;
    padding: 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border-left: 3px solid #38bdf8;
}

.history-item:hover {
    background: #1e293b;
    transform: translateX(4px);
}

.history-domain {
    font-weight: 600;
    color: #38bdf8;
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-family: 'Monaco', 'Courier New', monospace;
}

.history-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.85rem;
    color: #94a3b8;
}

.history-clicks {
    color: #38bdf8;
    font-weight: 500;
}

.history-date {
    color: #64748b;
}

.empty-history {
    text-align: center;
    padding: 40px 20px;
    color: #64748b;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.stat-card {
    background: #0f172a;
    padding: 24px;
    border-radius: 10px;
    text-align: center;
    border: 1px solid #334155;
}

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: #38bdf8;
    margin-bottom: 8px;
}

.stat-label {
    font-size: 0.875rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .form {
        flex-direction: column;
    }

    input {
        min-width: 100%;
    }

    button {
        width: 100%;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
    }

    .card-body {
        padding: 16px;
    }

    .badge {
        font-size: 0.8rem;
    }

    .history-panel {
        width: 100%;
        border-left: none;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }
}
