* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    --primary-color: #667eea;
    --primary-dark: #5a6fd8;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.95);
    --border-color: #e5e7eb;
    --border-light: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    font-feature-settings: 'cv02', 'cv03', 'cv04', 'cv11';
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--primary-gradient);
    opacity: 0.03;
    pointer-events: none;
    z-index: -1;
}

header {
    text-align: center;
    padding: 60px 20px 40px;
    background: var(--primary-gradient);
    color: white;
    position: relative;
    overflow: hidden;
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg width="60" height="60" viewBox="0 0 60 60" xmlns="http://www.w3.org/2000/svg"><g fill="none" fill-rule="evenodd"><g fill="%23ffffff" fill-opacity="0.05"><circle cx="30" cy="30" r="4"/></g></svg>') repeat;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

h1 {
    font-size: clamp(32px, 6vw, 48px);
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
    position: relative;
    z-index: 1;
}

.subtitle {
    font-size: clamp(16px, 3vw, 20px);
    opacity: 0.9;
    font-weight: 400;
    max-width: 600px;
    margin: 0 auto;
    line-height: 1.5;
    position: relative;
    z-index: 1;
}

main {
    flex: 1;
    padding: 40px 20px 20px;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.search-section {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    padding: 32px;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 32px;
    transition: all 0.3s ease;
}

.search-section:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
}

.input-group {
    position: relative;
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.025em;
}

input[type="text"] {
    width: 100%;
    padding: 20px 24px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s ease;
    background: var(--bg-secondary);
    color: var(--text-primary);
    position: relative;
    z-index: 1;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-secondary);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

input[type="text"]::placeholder {
    color: var(--text-light);
    font-weight: 400;
}

.input-group::after {
    content: '🔍';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    opacity: 0.5;
    pointer-events: none;
    margin-top: 16px;
}

.button-container {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    justify-content: center;
}

button {
    padding: 16px 32px;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 160px;
    min-height: 56px;
    position: relative;
    overflow: hidden;
    letter-spacing: 0.025em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

button:hover::before {
    left: 100%;
}

.primary-btn {
    background: var(--primary-gradient);
    color: white;
    box-shadow: var(--shadow-md);
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.primary-btn:active {
    transform: translateY(0);
}

.secondary-btn {
    background: var(--bg-secondary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
    display: none;
}

.secondary-btn:hover {
    background: var(--bg-primary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.spinner {
    display: none;
    margin: 40px auto;
    border: 4px solid var(--border-light);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.results-section {
    margin-top: 20px;
    flex: 1;
    display: none;
    flex-direction: column;
    min-height: 0;
}

.results-section.show {
    display: flex;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.results-section ul {
    list-style: none;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.results-section ul::-webkit-scrollbar {
    width: 6px;
}

.results-section ul::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

.results-section ul::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.results-section ul::-webkit-scrollbar-thumb:hover {
    background: var(--text-light);
}

.results-section li {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-light);
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', 'Roboto Mono', monospace;
    font-size: 14px;
    transition: all 0.2s ease;
    word-break: break-all;
    line-height: 1.5;
    position: relative;
}

.results-section li:last-child {
    border-bottom: none;
}

.results-section li.result-count {
    background: var(--primary-gradient);
    color: white;
    font-weight: 700;
    text-align: center;
    border-bottom: none;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 20px 24px;
    letter-spacing: 0.025em;
}

.results-section li.subdomain-item {
    cursor: pointer;
    min-height: 56px;
    display: flex;
    align-items: center;
    background: var(--bg-secondary);
}

.results-section li.subdomain-item:hover {
    background: linear-gradient(90deg, rgba(102, 126, 234, 0.05), rgba(102, 126, 234, 0.1));
    border-left: 4px solid var(--primary-color);
    padding-left: 20px;
    transform: translateX(4px);
}

.results-section li.subdomain-item::after {
    content: '📋';
    position: absolute;
    right: 20px;
    opacity: 0;
    transition: opacity 0.2s ease;
    font-size: 16px;
}

.results-section li.subdomain-item:hover::after {
    opacity: 0.7;
}

.results-section li.error-message {
    color: var(--error-color);
    text-align: center;
    font-style: italic;
    background: linear-gradient(135deg, #fef2f2, #fee2e2);
    border: 1px solid #fecaca;
    font-family: 'Inter', sans-serif;
    padding: 24px;
    font-size: 16px;
    border-radius: var(--radius-md);
    margin: 16px;
}

.copy-feedback {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--success-color);
    color: white;
    padding: 12px 20px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 14px;
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 20px));
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    pointer-events: none;
}

.copy-feedback.show {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
}

button:disabled {
    background: var(--border-color) !important;
    color: var(--text-light) !important;
    border-color: var(--border-color) !important;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

button:disabled::before {
    display: none;
}

footer {
    padding: 32px 20px;
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-light);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    margin-top: auto;
    flex-wrap: wrap;
    gap: 16px;
}

footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

footer a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.telegram-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-md);
}

.telegram-link:hover {
    transform: translateY(-2px) scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    header {
        padding: 40px 15px 30px;
    }
    
    main {
        padding: 20px 15px 15px;
    }
    
    .search-section {
        padding: 24px;
        margin-bottom: 24px;
    }
    
    input[type="text"] {
        padding: 18px 20px;
        font-size: 16px;
    }
    
    .button-container {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    
    button {
        width: 100%;
        min-height: 52px;
    }
    
    .results-section ul {
        max-height: 50vh;
    }
    
    .results-section li {
        padding: 16px 20px;
        font-size: 13px;
        min-height: 52px;
    }
    
    .results-section li.result-count {
        padding: 18px 20px;
        font-size: 15px;
    }
    
    footer {
        flex-direction: column;
        text-align: center;
        padding: 24px 15px;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .search-section {
        padding: 20px;
        border-radius: var(--radius-lg);
    }
    
    input[type="text"] {
        padding: 16px 18px;
    }
    
    button {
        padding: 14px 24px;
        min-height: 48px;
        font-size: 15px;
    }
    
    .results-section li {
        padding: 14px 18px;
        font-size: 12px;
        min-height: 48px;
    }
    
    .copy-feedback {
        top: 10px;
        right: 10px;
        padding: 10px 16px;
        font-size: 13px;
        transform: translateX(calc(100% + 10px));
    }
    
    .copy-feedback.show {
        transform: translateX(0);
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    :root {
        --text-primary: #f9fafb;
        --text-secondary: #d1d5db;
        --text-light: #9ca3af;
        --bg-primary: #111827;
        --bg-secondary: #1f2937;
        --bg-card: rgba(31, 41, 55, 0.95);
        --border-color: #374151;
        --border-light: #2d3748;
    }
    
    body::before {
        opacity: 0.1;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    button::before {
        display: none;
    }
}