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

:root {
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #6b7280;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --background: #0a0a0f;
    --surface: rgba(15, 23, 42, 0.8);
    --surface-hover: rgba(30, 41, 59, 0.9);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border: rgba(71, 85, 105, 0.3);
    --border-active: rgba(59, 130, 246, 0.5);
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    --shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    --gradient: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--background);
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(59, 130, 246, 0.1) 0%, transparent 50%),
        radial-gradient(circle at 75% 75%, rgba(168, 85, 247, 0.1) 0%, transparent 50%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    width: 100%;
    margin: 0;
    padding: 0 20px;
}

.header {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 40px 20px;
    text-align: center;
    margin-bottom: 30px;
    border-radius: 0 0 20px 20px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0.6;
    z-index: -1;
}

.logo-section {
    margin-bottom: 20px;
}

.header-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--primary-color);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
    object-fit: cover;
    transition: all 0.3s ease;
}

.header-logo:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.5);
}

.header-content h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.5);
    background: linear-gradient(135deg, #f8fafc 0%, #94a3b8 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.header-content p {
    font-size: 1.2rem;
    opacity: 0.9;
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.header-content i {
    margin-right: 15px;
    color: var(--primary-color);
}

.brand-section {
    margin-top: 15px;
}

.brand-name {
    font-family: 'Segoe UI', 'SF Pro Display', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 1.4rem;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 50%, #ec4899 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
}

.brand-name::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #a855f7 100%);
    border-radius: 2px;
}

.main-content {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    padding: 0 20px;
}

.generation-section,
.countries-section,
.results-section {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

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

.section-header h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.section-header h2 i {
    margin-right: 15px;
    color: var(--primary-color);
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.generation-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
}

.control-group {
    display: flex;
    flex-direction: column;
}

.control-group label {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text-primary);
}

.control-group label i {
    margin-right: 8px;
    color: var(--primary-color);
}

.control-select {
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(10px);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.control-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

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

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2563eb 100%);
    color: white;
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(59, 130, 246, 0.4);
}

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

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

.btn-secondary:hover {
    background: #4b5563;
    transform: translateY(-2px);
}

.btn-outline {
    background: var(--glass-bg);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    backdrop-filter: blur(10px);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(59, 130, 246, 0.2);
    border-left: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-spinner p {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

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

.countries-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.country-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 2px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.country-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.country-card:hover::before {
    opacity: 0.5;
}

.country-card:hover {
    transform: translateY(-8px);
    border-color: var(--border-active);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6);
}

.country-card.selected {
    border-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.country-card.selected::before {
    opacity: 0.3;
}

.country-card.inactive {
    opacity: 0.5;
    cursor: not-allowed;
}

.country-card.inactive:hover {
    transform: none;
    border-color: var(--glass-border);
}

.country-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    position: relative;
    z-index: 1;
}

.country-info h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 4px;
}

.country-status {
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.country-status.active {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.country-status.inactive {
    background: rgba(239, 68, 68, 0.2);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.country-flag {
    position: relative;
    z-index: 1;
}

.flag-image {
    width: 48px;
    height: 32px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--glass-border);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.country-stats {
    position: relative;
    z-index: 1;
}

.stats-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.stats-label {
    color: var(--text-secondary);
}

.stats-value {
    color: var(--text-primary);
    font-weight: 600;
}

.results-section {
    display: none;
}

.results-section.show {
    display: block;
    animation: slideIn 0.5s ease;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
}

.results-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
}

.results-header h2 i {
    margin-right: 10px;
    color: var(--success-color);
}

.results-info {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.results-actions {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.address-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px 12px 0 0;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px 12px 0 0;
}

.tab-btn.active {
    color: var(--primary-color);
    background: var(--glass-bg);
    border-bottom: 2px solid var(--primary-color);
}

.tab-btn:hover:not(.active) {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.tab-content {
    display: none;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
}

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

.results-container {
    border-radius: 12px;
}

.address-item {
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    padding: 12px 16px;
    margin-bottom: 2px;
    font-family: 'Courier New', monospace;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.address-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.address-item:first-child {
    border-radius: 12px 12px 0 0;
}

.address-item:hover {
    background: var(--surface-hover);
}

.address-text {
    flex: 1;
    color: var(--text-primary);
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.copy-btn:hover {
    color: var(--primary-color);
    background: var(--glass-bg);
}

.footer {
    text-align: center;
    padding: 40px 20px;
    border-top: 1px solid var(--border);
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-radius: 20px 20px 0 0;
    margin-top: 40px;
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.footer-content p {
    color: var(--text-secondary);
    margin: 0;
}

.telegram-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #0088cc 0%, #229ed9 100%);
    color: white;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 25px rgba(0, 136, 204, 0.3);
}

.telegram-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 35px rgba(0, 136, 204, 0.4);
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 600;
    z-index: 1000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    background: rgba(16, 185, 129, 0.9);
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
}

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

.results-container::-webkit-scrollbar {
    width: 8px;
}

.results-container::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 4px;
}

.results-container::-webkit-scrollbar-thumb:hover {
    background: var(--border-active);
}

@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .header {
        padding: 30px 20px;
        margin-bottom: 20px;
    }
    
    .header-logo {
        width: 60px;
        height: 60px;
    }
    
    .header-content h1 {
        font-size: 2.2rem;
    }
    
    .brand-name {
        font-size: 1.2rem;
    }
    
    .main-content {
        padding: 0 15px;
        gap: 20px;
    }
    
    .generation-controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .countries-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }
    
    .footer-content {
        gap: 15px;
    }
    
    .telegram-link {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 10px;
    }
    
    .header {
        padding: 25px 15px;
    }
    
    .header-logo {
        width: 50px;
        height: 50px;
    }
    
    .header-content h1 {
        font-size: 1.8rem;
    }
    
    .brand-name {
        font-size: 1rem;
    }
    
    .main-content {
        padding: 0 10px;
        gap: 15px;
    }
    
    .generation-section,
    .countries-section,
    .results-section {
        padding: 20px;
    }
    
    .country-card {
        padding: 20px;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 0.9rem;
    }
}
