/* ---------- Reset & Base ---------- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    font-family: 'Inter', 'Lexend Deca', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    padding: 20px;
}

/* ---------- Main Container (2 колонки) ---------- */
.main-container {
    display: flex;
    gap: 24px;
    max-width: 1600px;
    margin: 0 auto;
    height: calc(100vh - 40px);
    min-height: 600px;
}

/* ---------- Левая панель - все домены ---------- */
.domains-panel {
    flex: 1;
    min-width: 300px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.panel-header {
    padding: 20px 24px;
    background: white;
    border-bottom: 2px solid #f0f0f0;
    flex-shrink: 0;
}

    .panel-header h2 {
        font-size: 20px;
        font-weight: 600;
        color: #333;
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
    }

.header-icon {
    font-size: 24px;
}

.domain-count-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
    margin-left: 8px;
}

/* Search box small */
.search-box-small {
    display: flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    transition: all 0.2s ease;
}

    .search-box-small:focus-within {
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
        background: white;
    }

    .search-box-small svg {
        color: #999;
        margin-right: 8px;
        flex-shrink: 0;
    }

.search-input-small {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    outline: none;
}

/* Domains Grid */
.domains-grid {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 200px;
}

/* Domain Card */
.domain-card {
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid #e8e8e8;
    overflow: hidden;
    min-height: 70px;
}

    .domain-card:hover {
        transform: translateX(6px);
        border-color: #667eea;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
        background: white;
    }

    .domain-card.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-color: transparent;
        animation: pulse 0.5s ease;
    }

        .domain-card.active .domain-title,
        .domain-card.active .domain-subtitle,
        .domain-card.active .domain-icon,
        .domain-card.active .domain-arrow {
            color: white;
        }

.domain-card-content {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.domain-icon {
    font-size: 24px;
    flex-shrink: 0;
    color: #667eea;
    transition: transform 0.2s ease;
}

.domain-card:hover .domain-icon {
    transform: scale(1.1);
}

.domain-info {
    flex: 1;
    min-width: 0;
}

.domain-title {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 4px;
    word-break: break-word;
}

.domain-subtitle {
    font-size: 11px;
    color: #999;
    font-family: monospace;
    word-break: break-all;
}

.domain-arrow {
    font-size: 18px;
    color: #ccc;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.domain-card:hover .domain-arrow {
    transform: translateX(4px);
    color: #667eea;
}

.domain-card.active .domain-arrow {
    transform: translateX(4px);
}

/* ---------- Правая панель ---------- */
.subdomains-panel {
    flex: 2;
    min-width: 400px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 24px;
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.subdomains-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.subdomains-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.subdomain-item {
    background: white;
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

    .subdomain-item:hover {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        transform: translateX(6px);
        border-color: transparent;
        box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    }

        .subdomain-item:hover .subdomain-name {
            color: white;
        }

        .subdomain-item:hover .copy-icon {
            filter: brightness(0) invert(1);
            opacity: 1;
        }

.subdomain-name {
    color: #333;
    transition: color 0.2s ease;
    font-weight: 500;
    font-size: 14px;
    font-family: 'Dosis', monospace;
    word-break: break-word;
    flex: 1;
}

.subdomain-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.copy-tooltip {
    font-size: 11px;
    opacity: 0;
    transition: opacity 0.2s ease;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: system-ui;
    white-space: nowrap;
}

.subdomain-item:hover .copy-tooltip {
    opacity: 1;
}

.copy-icon {
    opacity: 0.4;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

/* Copy All Button */
.copy-all-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: 'Inter', sans-serif;
}

    .copy-all-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    .copy-all-btn:active {
        transform: translateY(0);
    }

/* Loading States */
.loading-spinner {
    text-align: center;
    padding: 60px 20px;
}

.spinner-small {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 16px;
}

.empty-state-small {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-sub {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

    .empty-state-sub svg {
        margin-bottom: 20px;
        opacity: 0.4;
    }

    .empty-state-sub p {
        font-size: 16px;
        margin-bottom: 8px;
        color: #666;
    }

    .empty-state-sub small {
        font-size: 12px;
        color: #999;
    }

/* Error Message */
.error-message {
    position: fixed;
    top: 20px;
    right: 20px;
    left: 20px;
    max-width: 400px;
    margin: 0 auto;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    padding: 16px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    animation: slideInRight 0.3s ease;
}

    .error-message p {
        flex: 1;
        margin: 0;
        font-size: 14px;
    }

.error-dismiss {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

    .error-dismiss:hover {
        background: rgba(255, 255, 255, 0.3);
        transform: scale(1.1);
    }

/* ---------- Statistics Cards ---------- */
.stats-container {
    display: flex;
    gap: 16px;
    padding: 16px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #e8e8e8;
    flex-wrap: wrap;
}

.stat-card {
    flex: 1;
    min-width: 100px;
    background: white;
    border-radius: 16px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
    border: 1px solid #e8e8e8;
}

    .stat-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }

.stat-icon {
    font-size: 28px;
}

.stat-info {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    line-height: 1.2;
}

.stat-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 4px;
}

/* Badge для типа (домен/IP) */
.subdomain-type-badge {
    font-size: 10px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.domain-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.ip-badge {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    color: white;
}

/* Responsive для статистики */
@media (max-width: 768px) {
    .stats-container {
        padding: 12px 16px;
        gap: 8px;
    }

    .stat-card {
        min-width: 80px;
        padding: 8px 12px;
    }

    .stat-icon {
        font-size: 20px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 9px;
    }
}

/* ---------- Update Info ---------- */
.update-info {
    padding: 12px 16px;
    background: #f8f9fa;
    border-top: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 11px;
}

.update-status {
    flex: 1;
}

.update-time {
    color: #666;
    display: flex;
    align-items: center;
    gap: 4px;
}

.updating {
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 4px;
    animation: pulse 1.5s ease infinite;
}

.manual-refresh-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 4px;
    color: #666;
}

    .manual-refresh-btn:hover:not(:disabled) {
        background: #667eea;
        border-color: #667eea;
        color: white;
        transform: translateY(-1px);
    }

    .manual-refresh-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Scrollbars */
.domains-grid::-webkit-scrollbar,
.subdomains-content::-webkit-scrollbar {
    width: 6px;
}

.domains-grid::-webkit-scrollbar-track,
.subdomains-content::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 10px;
}

.domains-grid::-webkit-scrollbar-thumb,
.subdomains-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

    .domains-grid::-webkit-scrollbar-thumb:hover,
    .subdomains-content::-webkit-scrollbar-thumb:hover {
        background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    }

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.02);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.domain-highlight {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 600;
    color: white;
    font-size: 14px;
    display: inline-block;
}

/* ---------- Toast Notifications ---------- */
.toast-notification {
    position: fixed;
    bottom: 30px;
    right: 30px;
    min-width: 280px;
    max-width: 400px;
    background: white;
    padding: 14px 20px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
    font-size: 14px;
    font-weight: 500;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

    .toast-notification.success {
        background: linear-gradient(135deg, #00b09b, #96c93d);
        color: white;
    }

    .toast-notification.error {
        background: linear-gradient(135deg, #ff6b6b, #ee5a24);
        color: white;
    }

    .toast-notification.info {
        background: linear-gradient(135deg, #4facfe, #00f2fe);
        color: white;
    }

    .toast-notification.warning {
        background: linear-gradient(135deg, #f093fb, #f5576c);
        color: white;
    }

    .toast-notification span {
        flex: 1;
        word-break: break-word;
    }

    .toast-notification button {
        background: rgba(255, 255, 255, 0.2);
        border: none;
        color: white;
        cursor: pointer;
        width: 28px;
        height: 28px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        font-weight: bold;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }

        .toast-notification button:hover {
            background: rgba(255, 255, 255, 0.3);
            transform: scale(1.1);
        }

/* Анимация для toast */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
    .toast-notification {
        bottom: 20px;
        right: 20px;
        left: 20px;
        min-width: auto;
        max-width: none;
        padding: 12px 16px;
        font-size: 13px;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
        height: auto;
        gap: 16px;
    }

    .domains-panel,
    .subdomains-panel {
        min-width: auto;
        max-height: 400px;
    }

    .panel-header h2 {
        font-size: 16px;
    }

    .domain-title {
        font-size: 12px;
    }

    .subdomain-name {
        font-size: 12px;
    }
}

/* ---------- Blazor Error UI ---------- */
#blazor-error-ui {
    background: rgba(255, 245, 200, 0.95);
    backdrop-filter: blur(12px);
    bottom: 20px;
    left: 20px;
    right: 20px;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    display: none;
    padding: 1rem;
    position: fixed;
    z-index: 1000;
    font-family: 'Inter', system-ui, sans-serif;
    border: 1px solid rgba(255, 215, 0, 0.3);
    animation: slideUp 0.3s ease-out;
}

    #blazor-error-ui .dismiss {
        cursor: pointer;
        position: absolute;
        right: 1rem;
        top: 1rem;
        background: rgba(0, 0, 0, 0.05);
        border-radius: 30px;
        width: 28px;
        height: 28px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s ease;
    }

        #blazor-error-ui .dismiss:hover {
            background: rgba(0, 0, 0, 0.15);
            transform: scale(1.05);
        }
