
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700&display=swap');

:root {
    --primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-solid: #667eea;
    --secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --secondary-solid: #f093fb;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    --dark: #0d1117;
    --dark-secondary: #161b22;
    --dark-tertiary: #21262d;
    --light: #e94560;
    --text-primary: #f0f6fc;
    --text-secondary: #7d8590;
    --text-muted: #6e7681;
    --border: rgba(240, 246, 252, 0.1);
    --glass: rgba(13, 17, 23, 0.8);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
    --radius: 12px;
    --radius-lg: 16px;
}

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

body {
    font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.08) 0%, transparent 70%),
        radial-gradient(circle at 40% 80%, rgba(240, 147, 251, 0.05) 0%, transparent 70%),
        linear-gradient(135deg, var(--dark) 0%, var(--dark-secondary) 50%, var(--dark-tertiary) 100%);
    z-index: -1;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

.header {
    text-align: center;
    margin-bottom: 3rem;
}

.logo-section {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: white;
    box-shadow: var(--shadow);
}

.logo-text h1 {
    font-size: 3rem;
    font-weight: 700;
    background: var(--primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.logo-text p {
    color: var(--text-secondary);
    font-size: 1.2rem;
    font-weight: 400;
}

.telegram-section {
    margin-top: 2rem;
    text-align: center;
}

.telegram-channel {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #0088cc 0%, #1DA1F2 100%);
    border-radius: var(--radius-lg);
    color: white;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 8px 20px rgba(0, 136, 204, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.telegram-channel:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(0, 136, 204, 0.4);
    color: white;
    text-decoration: none;
}

.telegram-channel i {
    font-size: 1.5rem;
}

.channel-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.channel-name {
    font-size: 1.1rem;
    margin-bottom: 0.2rem;
}

.channel-desc {
    font-size: 0.9rem;
    opacity: 0.8;
    font-weight: 400;
}

.main-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.card {
    background: var(--glass);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid var(--border);
}

.card-header i {
    font-size: 1.5rem;
    background: var(--primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-header h2 {
    font-size: 1.3rem;
    font-weight: 600;
    flex: 1;
}

.card-content {
    padding: 2rem;
}

.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: end;
    flex-wrap: wrap;
}

.input-field {
    flex: 1;
    position: relative;
}

.input-field label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.input-field input,
.input-field select {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.input-field input:focus,
.input-field select:focus {
    outline: none;
    border-color: var(--primary-solid);
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    background: rgba(0, 0, 0, 0.6);
}

.input-field i {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    color: var(--text-muted);
    font-size: 1rem;
}

.port-group {
    display: flex;
    gap: 0.5rem;
}

.port-group input {
    flex: 1;
    padding-left: 1rem;
}

.btn-icon {
    width: 48px;
    height: 48px;
    background: var(--success);
    border: none;
    border-radius: var(--radius);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.btn-icon:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.toggle-field {
    display: flex;
    align-items: center;
    min-width: fit-content;
    justify-content: flex-start;
    flex-shrink: 0;
}

.toggle {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: relative;
    width: 50px;
    height: 24px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    transition: all 0.3s ease;
}

.slider:before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 2px;
    top: 2px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.toggle input:checked + .slider {
    background: var(--primary-solid);
}

.toggle input:checked + .slider:before {
    transform: translateX(26px);
}

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

.radio-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 1rem 1.5rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.02);
    min-width: 120px;
    justify-content: center;
    text-align: center;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-solid);
    transform: translateY(-1px);
}

.radio-option input {
    opacity: 0;
    width: 0;
    height: 0;
}

.radio-mark {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border);
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.radio-option input:checked + .radio-mark {
    border-color: var(--primary-solid);
    background: rgba(102, 126, 234, 0.1);
}

.radio-option input:checked + .radio-mark:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    background: var(--primary-solid);
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

.radio-option input:checked {
    + .radio-mark {
        border-color: var(--primary-solid);
    }
    + .radio-mark + span {
        color: var(--primary-solid);
        font-weight: 600;
    }
}

.radio-option span:last-child {
    font-weight: 500;
    color: var(--text-primary);
    transition: all 0.3s ease;
}

.btn-action {
    padding: 0.75rem 1.5rem;
    background: var(--warning);
    border: none;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: end;
}

.btn-action:hover {
    background: #d97706;
    transform: translateY(-1px);
}

.full-width {
    width: 100%;
}

.dns-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.dns-option {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
}

.dns-option:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-solid);
}

.dns-option input {
    opacity: 0;
    width: 0;
    height: 0;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border);
    border-radius: 4px;
    position: relative;
    transition: all 0.3s ease;
}

.dns-option input:checked + .checkmark {
    background: var(--primary-solid);
    border-color: var(--primary-solid);
}

.dns-option input:checked + .checkmark:after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 0.8rem;
}

.dns-info {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.dns-ip {
    font-weight: 600;
    color: var(--text-primary);
}

.dns-type {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.action-buttons {
    display: flex;
    gap: 1rem;
}

.btn {
    flex: 1;
    padding: 1rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

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

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

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

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

.btn-download:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(240, 147, 251, 0.4);
}

.btn-download:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.config-output {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
    min-height: 300px;
    margin-bottom: 1.5rem;
    overflow-x: auto;
}

.download-actions {
    display: flex;
    gap: 1rem;
}

.key-item {
    margin-bottom: 1.5rem;
}

.key-item label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.key-display {
    display: flex;
    gap: 0.5rem;
}

.key-display input {
    flex: 1;
    padding: 0.75rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text-primary);
    font-family: 'Fira Code', monospace;
    font-size: 0.8rem;
}

.btn-copy-key {
    padding: 0.75rem;
    background: var(--success);
    color: white;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 48px;
}

.btn-copy-key:hover {
    background: #16a34a;
    transform: scale(1.05);
}

.notification {
    position: fixed;
    top: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    color: white;
    font-weight: 500;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
    max-width: 300px;
    backdrop-filter: blur(20px);
}

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

.notification.success {
    background: rgba(16, 185, 129, 0.9);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.notification.error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
    }
    
    .logo-section {
        flex-direction: column;
        gap: 1rem;
    }
    
    .logo-text h1 {
        font-size: 2.5rem;
    }
    
    .radio-group {
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    }
    
    .form-row {
        gap: 1.5rem;
    }
}

@media (max-width: 900px) {
    .form-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .toggle-field {
        width: auto;
        justify-content: flex-start;
    }
    
    .btn-action {
        align-self: stretch;
        width: 100%;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    .card-content {
        padding: 1.5rem 1rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .toggle-field {
        min-width: auto;
        width: 100%;
        justify-content: flex-start;
        margin-bottom: 1rem;
    }
    
    .toggle-field.full-width {
        justify-content: space-between;
    }
    
    .radio-group {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .radio-option {
        min-width: auto;
        width: 100%;
        padding: 1rem;
        justify-content: flex-start;
    }
    
    .dns-grid {
        grid-template-columns: 1fr;
    }
    
    .action-buttons,
    .download-actions {
        flex-direction: column;
    }
    
    .key-display {
        flex-direction: column;
    }
    
    .port-group {
        flex-direction: row;
    }
    
    .port-group input {
        min-width: 0;
    }
    
    .notification {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
    
    .input-field input,
    .input-field select {
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .logo-text h1 {
        font-size: 2rem;
    }
    
    .card-header {
        padding: 1rem 1.5rem;
    }
    
    .card-content {
        padding: 1rem;
    }
}
