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

html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    overflow-x: hidden;
}

:root {
    --primary: #3B82F6;
    --primary-hover: #2563EB;
    --primary-light: #60A5FA;
    --accent: #22D3EE;
    --accent-hover: #06B6D4;
    --secondary: #6b7280;
    --success: #22D3EE;
    --danger: #ef4444;
    --warning: #f59e0b;
    --background: #F5F6F7;
    --surface: #2C2F33;
    --border: #3C3F43;
    --text-primary: #F5F6F7;
    --text-secondary: #9CA3AF;
    --text-muted: #6B7280;
    --charcoal: #1A1A1C;
    --gunmetal: #2C2F33;
    --off-white: #F5F6F7;
    --electric-blue: #3B82F6;
    --mint-teal: #22D3EE;
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -2px rgba(0, 0, 0, 0.3);
    --shadow-accent: 0 4px 12px rgba(59, 130, 246, 0.3);
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    background: var(--off-white);
    min-height: 100vh;
    padding: 0;
    margin: 0;
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 15px;
}

.container {
    max-width: 1080px;
    margin: 0 auto;
    padding: 40px 24px;
}

header {
    text-align: center;
    margin-bottom: 64px;
    padding-top: 32px;
}

.logo {
    font-size: 2.75rem;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Helvetica Neue', Arial, sans-serif;
    display: inline-block;
}

.logo-bold {
    font-weight: 700;
    color: var(--text-primary);
}

.logo-thin {
    font-weight: 300;
    color: var(--accent);
    letter-spacing: 0.02em;
}

.subtitle {
    font-size: 1.0625rem;
    color: var(--text-secondary);
    font-weight: 400;
    letter-spacing: -0.01em;
}

.card {
    background: #ffffff;
    border-radius: 2px;
    padding: 32px;
    margin-bottom: 24px;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15), 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.card.compact {
    padding: 28px 32px;
}

.card-header {
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e5e7eb;
}

.card h2 {
    margin: 0;
    color: #1A1A1C;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e7eb;
}

.tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    color: #9CA3AF;
    margin-bottom: -1px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-radius: 0;
}

.tab-btn::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--electric-blue);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tab-btn:hover {
    color: #1A1A1C;
    background: none;
}

.tab-btn:hover::after {
    width: 100%;
    background: #e5e7eb;
}

.tab-btn.active {
    color: var(--electric-blue);
    font-weight: 600;
    background: none;
}

.tab-btn.active::after {
    width: 100%;
    background: var(--electric-blue);
}

.tab-content {
    display: none;
}

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

/* Text Input */
#domain-input {
    width: 100%;
    min-height: 120px;
    padding: 12px 16px;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    resize: vertical;
    transition: all 0.2s ease;
    background: #f9fafb;
    color: #1A1A1C;
    line-height: 1.6;
}

#domain-input:focus {
    outline: none;
    border: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: #ffffff;
}

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

/* File Upload */
.file-upload {
    text-align: center;
    padding: 40px 24px;
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    transition: all 0.2s ease;
    background: var(--background);
}

.file-upload:hover {
    border-color: var(--accent);
    background: rgba(71, 179, 157, 0.03);
}

#file-input {
    display: none;
}

.file-label {
    display: block;
    cursor: pointer;
    color: var(--accent);
    font-weight: 500;
    font-size: 0.875rem;
    transition: color 0.2s ease;
}

.file-label:hover {
    color: var(--accent-hover);
}

.file-name {
    margin-top: 12px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.file-list {
    margin-top: 16px;
    max-height: 240px;
    overflow-y: auto;
}

.file-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 6px;
    background: var(--gunmetal);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    border: 1px solid var(--border);
}

.file-list-item .file-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

.file-list-item .file-info .file-icon {
    color: var(--electric-blue);
    font-size: 1rem;
}

.file-list-item .file-info .file-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.file-list-item .file-info .file-details .file-name-text {
    font-weight: 500;
    color: var(--text-primary);
}

.file-list-item .file-info .file-details .file-stats {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.file-list-item .remove-file {
    background: transparent;
    color: var(--danger);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 4px 10px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 500;
    transition: all 0.2s ease;
}

.file-list-item .remove-file:hover {
    background: rgba(239, 68, 68, 0.1);
    border-color: var(--danger);
}

/* TLD Selection */
.tld-selection {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.875rem;
    border: none;
    background: #f9fafb;
    color: #9CA3AF;
}

.checkbox-label:hover {
    background: #f3f4f6;
    color: #6B7280;
}

.checkbox-label input[type="checkbox"]:checked + span {
    color: #9CA3AF;
    font-weight: 500;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--electric-blue);
}

.custom-tld {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

#custom-tld-input {
    flex: 1;
    padding: 10px 14px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    background: #f9fafb;
    color: #1A1A1C;
    transition: all 0.2s ease;
}

#custom-tld-input:focus {
    outline: none;
    border: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: #ffffff;
}

/* Options */
.options-row {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.delay-setting {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.875rem;
}

.delay-setting label {
    font-weight: 500;
    color: var(--text-secondary);
}

#delay-input,
#max-workers-input {
    padding: 8px 12px;
    border: none;
    border-radius: var(--radius-sm);
    width: 90px;
    font-size: 0.875rem;
    background: #f9fafb;
    color: #1A1A1C;
    transition: all 0.2s ease;
}

#delay-input:focus,
#max-workers-input:focus {
    outline: none;
    border: none;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.2);
    background: #ffffff;
}

.checkbox-label input[type="checkbox"]#use-whois {
    width: 18px;
    height: 18px;
    accent-color: var(--electric-blue);
}

/* Buttons */
.actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.btn-primary, .btn-secondary, .btn-small, .btn-danger {
    padding: 10px 24px;
    border: none;
    border-radius: 9999px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--electric-blue) !important;
    color: white !important;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
    font-weight: 500;
    border: none !important;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.3), transparent);
    transition: left 0.5s ease;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: var(--primary-hover) !important;
    color: white !important;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4), 0 0 0 1px rgba(34, 211, 238, 0.3);
    transform: translateY(-1px);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--gunmetal) !important;
    color: var(--off-white) !important;
    border: 1px solid var(--border) !important;
    padding: 10px 20px;
}

.btn-secondary:hover {
    background: #3C3F43 !important;
    border-color: var(--electric-blue) !important;
    color: var(--electric-blue) !important;
}

.btn-small {
    padding: 6px 14px;
    font-size: 0.8125rem;
    background: var(--electric-blue) !important;
    color: white !important;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.3);
    font-weight: 500;
    border: none !important;
}

.btn-small:hover {
    background: var(--primary-hover) !important;
    color: white !important;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.4);
}

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

.btn-danger:hover {
    background: #dc2626;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

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

/* Progress */
.progress-bar-container {
    width: 100%;
    height: 8px;
    background: var(--border);
    border-radius: 999px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--electric-blue) 0%, var(--mint-teal) 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 999px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.parallel-info {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-style: normal;
    margin-top: 4px;
}

/* Domain List */
.domain-list-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 12px;
    background: var(--background);
}

.domain-status-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid var(--border);
}

.domain-status-item:hover {
    background: rgba(0, 102, 204, 0.02);
    border-color: #cbd5e1;
}

.domain-status-item .domain-name {
    flex: 1;
    font-weight: 500;
    color: var(--text-primary);
}

.domain-status-item .status-badge-mini {
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: capitalize;
    min-width: 80px;
    text-align: center;
}

.status-waiting {
    background: rgba(168, 85, 247, 0.1);
    color: var(--primary);
}

.status-checking {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-available {
    background: rgba(71, 179, 157, 0.12);
    color: var(--accent);
    font-weight: 500;
}

.status-taken {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.status-unknown {
    background: rgba(100, 116, 139, 0.1);
    color: var(--secondary);
}

.status-cancelled {
    background: rgba(148, 163, 184, 0.1);
    color: var(--text-muted);
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

@keyframes pulse-progress {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

/* Results */
.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.results-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1.125rem;
    font-weight: 600;
}

.summary {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.summary-item {
    padding: 16px 20px;
    border-radius: var(--radius);
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 100px;
    text-align: center;
    border: 1px solid var(--border);
    background: var(--surface);
}

.summary-item.available {
    background: rgba(71, 179, 157, 0.08);
    border-color: rgba(71, 179, 157, 0.25);
    color: var(--accent);
}

.summary-item.taken {
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.2);
    color: var(--danger);
}

.summary-item.unknown {
    background: rgba(245, 158, 11, 0.05);
    border-color: rgba(245, 158, 11, 0.2);
    color: var(--warning);
}

.summary-label {
    font-size: 0.75rem;
    font-weight: 500;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.summary-value {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Filters */
.filters {
    display: flex;
    gap: 16px;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    background: var(--gunmetal);
    cursor: pointer;
    color: var(--off-white);
    transition: all 0.2s ease;
}

.filter-group select:focus {
    outline: none;
    border-color: var(--electric-blue);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.table-container {
    overflow-x: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--gunmetal);
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8125rem;
}

thead {
    background: var(--background);
}

th {
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

td {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    color: var(--text-primary);
}

tbody tr {
    transition: background 0.15s ease;
}

tbody tr:hover {
    background: rgba(0, 102, 204, 0.01);
}

tbody tr:last-child td {
    border-bottom: none;
}

.status-badge {
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 500;
    display: inline-block;
    letter-spacing: -0.01em;
}

/* AI Generator */
.ai-generator textarea:focus,
.ai-generator input:focus,
.ai-generator select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.1);
}

#ai-domains-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
}

.ai-domain-item {
    padding: 8px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    cursor: pointer;
    text-align: center;
    font-weight: 500;
}

.ai-domain-item:hover {
    background: rgba(0, 102, 204, 0.03);
    border-color: #cbd5e1;
    transform: translateY(-1px);
}

/* Debug Panel */
#debug-panel {
    margin-bottom: 16px;
    padding: 16px;
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    body {
        padding: 16px;
    }
    
    header {
        margin-bottom: 32px;
    }
    
    .logo {
        font-size: 2rem;
    }
    
    .card {
        padding: 16px;
        border-radius: 2px;
        border: none;
    }
    
    .card.compact {
        padding: 16px;
    }
    
    .summary {
        flex-direction: row;
        justify-content: center;
    }
    
    .filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-group {
        justify-content: space-between;
    }
    
    table {
        font-size: 0.75rem;
    }
    
    th, td {
        padding: 10px 12px;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

footer a {
    color: #374151 !important;
    text-decoration: none !important;
}

footer a:hover {
    color: #1f2937 !important;
    text-decoration: none !important;
}

/* Exclude footer-powered links from above styles */
footer .footer-powered,
footer.footer .footer-powered {
    color: #888888 !important;
}

footer .footer-powered *,
footer.footer .footer-powered * {
    color: #777777 !important;
}

footer .footer-powered a,
footer.footer .footer-powered a {
    color: #666666 !important;
}

footer .footer-powered a:hover,
footer.footer .footer-powered a:hover,
footer .footer-powered a:visited,
footer.footer .footer-powered a:visited,
footer .footer-powered a:active,
footer.footer .footer-powered a:active,
footer .footer-powered a:link,
footer.footer .footer-powered a:link {
    color: #666666 !important;
}
