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

:root {
    --primary: #4361ee;
    --primary-dark: #3a0ca3;
    --primary-light: #4cc9f0;
    --success: #06d6a0;
    --warning: #f72585;
    --danger: #e63946;
    --dark: #1a1a2e;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-600: #6c757d;
    --gray-800: #343a40;
    --shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.02);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius: 16px;
    --radius-sm: 10px;
}

body {
    font-family: 'JetBrains Mono', monospace;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--dark);
    line-height: 1.5;
    padding: 1.5rem;
}

.app-container {
    max-width: 1440px;
    margin: 0 auto;
}

header {
    text-align: center;
    padding: 1.5rem 2rem;
    margin-bottom: 2rem;
    position: relative;
}

.header-badge {
    position: absolute;
    top: 0;
    right: 20px;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    background: linear-gradient(135deg, #fff, #e0d4ff);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 .highlight {
    background: linear-gradient(135deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

header p {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 0.5rem;
}

.tab-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 0.8rem 1.2rem;
    border-radius: 60px;
    justify-content: center;
}

.tab-btn {
    background: transparent;
    border: none;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 500;
    padding: 0.6rem 1.4rem;
    cursor: pointer;
    color: white;
    transition: all 0.25s ease;
    border-radius: 40px;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
}

.tab-btn.active {
    background: white;
    color: var(--primary);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tab-content {
    display: none;
    animation: fadeInUp 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    background: rgba(255, 255, 255, 0.98);
    border-radius: var(--radius);
    padding: 1.8rem;
    box-shadow: var(--shadow-lg);
    transition: transform 0.2s;
}

.card:hover {
    transform: translateY(-2px);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--gray-200);
}

.card-icon {
    font-size: 1.8rem;
}

.card-header h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
}

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

.input-group input {
    flex: 1;
    min-width: 240px;
    background: var(--gray-100);
    border: 2px solid var(--gray-200);
    padding: 0.9rem 1.2rem;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.2s;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.1);
    background: white;
}

.btn-primary, .btn-secondary, .btn-danger {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.9rem 1.8rem;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-800);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #c1121f;
}

.result-area {
    background: var(--gray-100);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1.2rem;
    font-size: 0.8rem;
    overflow-x: auto;
    max-height: 550px;
    overflow-y: auto;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.info-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 12px;
    padding: 1rem;
}

.info-item:hover {
    border-color: var(--primary-light);
}

.info-label {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-value {
    font-size: 0.85rem;
    word-break: break-word;
    color: var(--gray-800);
    font-weight: 500;
}

.dns-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.dns-table th, .dns-table td {
    text-align: left;
    padding: 0.8rem;
    border-bottom: 1px solid var(--gray-200);
}

.dns-table th {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.dns-table tr:hover td {
    background: #fef9c3;
}

.whois-output {
    font-size: 0.7rem;
    white-space: pre-wrap;
    background: #fefce8;
    border-left: 4px solid var(--warning);
}

.ssl-valid {
    background: linear-gradient(135deg, #d1fae5, #a7f3d0);
    border-left: 4px solid var(--success);
}

.ssl-expired {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    border-left: 4px solid var(--danger);
}

.progress-bar {
    background: var(--gray-200);
    border-radius: 20px;
    height: 8px;
    overflow: hidden;
    margin-top: 8px;
}

.progress-fill {
    background: linear-gradient(90deg, var(--success), var(--primary));
    height: 100%;
    border-radius: 20px;
    transition: width 0.5s ease;
}

.age-number {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.history-actions {
    display: flex;
    gap: 0.8rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.history-item {
    background: white;
    border: 1px solid var(--gray-200);
    border-left: 4px solid var(--primary);
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    border-radius: 10px;
}

.history-item:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

.history-type {
    font-size: 0.65rem;
    color: var(--primary);
    font-weight: 700;
    text-transform: uppercase;
}

.history-query {
    font-weight: 600;
    margin: 0.4rem 0;
    font-size: 0.85rem;
}

.history-time {
    font-size: 0.65rem;
    color: var(--gray-600);
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--gray-600);
}

.loading::before {
    content: "⏳";
    display: inline-block;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

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

.error-message {
    background: linear-gradient(135deg, #fee2e2, #fecaca);
    color: var(--danger);
    padding: 1rem;
    border-radius: 10px;
    border-left: 4px solid var(--danger);
}

.cross-links {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.cross-link {
    color: var(--primary);
    text-decoration: none;
    border-bottom: 1px dashed var(--primary);
    cursor: pointer;
}

.cross-link:hover {
    color: var(--primary-dark);
}

footer {
    text-align: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.7rem;
}

@media (max-width: 768px) {
    body { padding: 1rem; }
    .card { padding: 1.2rem; }
    .tab-btn { padding: 0.4rem 0.8rem; font-size: 0.7rem; }
    header h1 { font-size: 1.5rem; }
    .info-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .input-group { flex-direction: column; }
    .btn-primary, .btn-secondary, .btn-danger { width: 100%; }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-200);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 3px;
}