/* ── ОБЁРТКА ── */
.ghfd-wrap {
    --g-bg:   #0d0d12;
    --g-card: #16161f;
    --g-inp:  #1e1e2a;
    --g-brd:  #2a2a38;
    --g-fg:   #f0f0f5;
    --g-warp: #3b82f6;
    --g-warp2:#06b6d4;
    --g-vless:#a855f7;
    --g-vless2:#ec4899;
    background: var(--g-bg);
    border-radius: 24px;
    max-width: 480px;
    margin: 28px auto;
    color: var(--g-fg);
    box-shadow: 0 0 0 1px var(--g-brd), 0 40px 80px rgba(0,0,0,.6);
    overflow: visible;
    font-family: 'Inter', sans-serif;
}

/* ── ШАПКА ── */
.ghfd-header {
    display: flex; align-items: center; gap: 14px;
    padding: 20px 24px;
    background: var(--g-card);
    border-bottom: 1px solid var(--g-brd);
    border-radius: 24px 24px 0 0;
}
.ghfd-logo {
    width: 46px; height: 46px; flex-shrink: 0;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px; color: #fff;
}
.ghfd-header-text { flex: 1; min-width: 0; }
.ghfd-title { font-size: 16px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ghfd-sub   { font-size: 11px; color: #888; margin-top: 2px; }

/* ── ПЕРЕКЛЮЧАТЕЛЬ ── */
.ghfd-mode-switch {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-left: auto;
}
.ghfd-mode-label {
    font-size: 11px; font-weight: 700; letter-spacing: .5px;
    color: #555; transition: .3s; white-space: nowrap;
}
.ghfd-mode-label.active.warp-label {
    background: linear-gradient(135deg, var(--g-warp), var(--g-warp2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ghfd-mode-label.active.vless-label {
    background: linear-gradient(135deg, var(--g-vless), var(--g-vless2));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.ghfd-toggle { position: relative; display: inline-block; width: 44px; height: 24px; }
.ghfd-toggle input { opacity: 0; width: 0; height: 0; }
.ghfd-slider {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--g-inp); border: 1px solid var(--g-brd);
    border-radius: 24px; transition: .4s;
}
.ghfd-slider:before {
    content: ''; position: absolute;
    width: 16px; height: 16px; left: 3px; bottom: 3px;
    background: #555; border-radius: 50%; transition: .4s;
}
.ghfd-toggle input:checked ~ .ghfd-slider {
    background: linear-gradient(135deg, var(--g-vless), var(--g-vless2));
    border-color: transparent;
}
.ghfd-toggle input:checked ~ .ghfd-slider:before {
    transform: translateX(20px); background: #fff;
}

/* ── BODY ── */
.ghfd-body { padding: 20px 24px 24px; background: var(--g-bg); border-radius: 0 0 24px 24px; }

.ghfd-section { display: flex; flex-direction: column; gap: 10px; animation: ghfd-in .25s ease; }
@keyframes ghfd-in { from { opacity:0; transform: translateY(6px); } to { opacity:1; transform:none; } }

/* ── СТРОКИ WARP ── */
.awg-row {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--g-card); border: 1px solid var(--g-brd);
    border-radius: 14px; padding: 11px 16px; transition: border-color .2s;
}
.awg-row:focus-within { border-color: var(--g-warp); }
.awg-label {
    font-size: 13px; color: #888; font-weight: 500;
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.awg-label i { color: #555; font-size: 12px; }

.awg-select,
.awg-custom-select { width: 165px; min-width: 165px; max-width: 165px; }

.awg-select {
    background: var(--g-inp); border: 1px solid var(--g-brd);
    border-radius: 10px; padding: 8px 28px 8px 10px;
    color: #fff; font-size: 13px; outline: none; cursor: pointer;
    box-sizing: border-box; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
    transition: border-color .2s;
}
.awg-select:focus { border-color: var(--g-warp); }
.awg-select::-webkit-inner-spin-button,
.awg-select::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.awg-select[type=number] { -moz-appearance: textfield; text-align: center; padding: 8px 10px; }

.awg-custom-field { padding: 0 4px; }
.awg-input {
    width: 100%; box-sizing: border-box;
    background: var(--g-inp); border: 1px solid var(--g-brd);
    border-radius: 12px; padding: 12px 16px;
    color: #fff; font-size: 13px; outline: none; transition: border-color .2s;
}
.awg-input:focus        { border-color: var(--g-warp); }
.awg-input::placeholder { color: #444; }

/* ── КАСТОМНЫЙ ДРОПДАУН ── */
.awg-row-endpoint { position: relative; overflow: visible; }
.awg-custom-select { position: relative; box-sizing: border-box; }
.awg-cs-selected {
    display: flex; align-items: center; justify-content: space-between; gap: 6px;
    background: var(--g-inp); border: 1px solid var(--g-brd);
    border-radius: 10px; padding: 8px 10px;
    color: #fff; font-size: 13px; cursor: pointer;
    transition: border-color .2s; user-select: none;
    width: 100%; box-sizing: border-box;
}
.awg-cs-selected:hover { border-color: var(--g-warp); }
.awg-cs-selected > i { color: #555; font-size: 11px; flex-shrink: 0; transition: transform .2s; }
.awg-custom-select.open .awg-cs-selected { border-color: var(--g-warp); }
.awg-custom-select.open .awg-cs-selected > i { transform: rotate(180deg); }
.awg-cs-list {
    display: none; position: absolute;
    bottom: calc(100% + 6px); right: 0; width: 200px;
    background: #1a1a26; border: 1px solid #2a2a38;
    border-radius: 12px; overflow: hidden;
    box-shadow: 0 -8px 32px rgba(0,0,0,.6); z-index: 999;
}
.awg-custom-select.open .awg-cs-list { display: block; }
.awg-cs-option {
    padding: 9px 14px; font-size: 13px; color: #ccc;
    cursor: pointer; transition: background .15s;
    display: flex; align-items: center; gap: 8px; white-space: nowrap;
}
.awg-cs-option:hover    { background: rgba(59,130,246,.15); color: #fff; }
.awg-cs-option.selected { background: rgba(59,130,246,.1);  color: #60a5fa; }
.awg-flag-img { width: 16px; height: 12px; border-radius: 2px; flex-shrink: 0; }

/* ── VLESS ПОЛЯ ── */
.ghfd-vless-info {
    background: rgba(168,85,247,.08); border: 1px solid rgba(168,85,247,.2);
    border-radius: 12px; padding: 12px 16px;
    font-size: 13px; color: #c084fc; line-height: 1.5;
    display: flex; gap: 10px; align-items: flex-start;
}
.ghfd-vless-info i { margin-top: 2px; flex-shrink: 0; }

.ghfd-field { display: flex; flex-direction: column; gap: 6px; }
.ghfd-field-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .5px; color: #666;
    display: flex; align-items: center; gap: 6px;
}
.ghfd-field-hint { font-size: 11px; color: #444; padding-left: 4px; }

/* ── КНОПКИ ── */
.ghfd-btn-wrap { margin-top: 4px; }

.ghfd-btn {
    position: relative; overflow: hidden;
    width: 100%; padding: 16px;
    border: none; border-radius: 16px;
    font-size: 15px; font-weight: 700; color: #fff;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: transform .2s, box-shadow .2s, background .4s;
}
.ghfd-btn:hover:not(:disabled)  { transform: translateY(-2px); }
.ghfd-btn:active:not(:disabled) { transform: scale(.98); }
.ghfd-btn:disabled { cursor: wait; opacity: .7; }

.ghfd-btn-warp {
    background: linear-gradient(135deg, var(--g-warp), var(--g-warp2));
    box-shadow: 0 4px 20px rgba(59,130,246,.35);
}
.ghfd-btn-vless {
    background: linear-gradient(135deg, var(--g-vless), var(--g-vless2));
    box-shadow: 0 4px 20px rgba(168,85,247,.35);
}

.ghfd-btn-progress {
    position: absolute; bottom: 0; left: 0; height: 3px; width: 0;
    background: rgba(255,255,255,.6); border-radius: 0 0 16px 16px;
    transition: width 1s ease;
}
.ghfd-btn-content { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; }

/* Состояния */
.ghfd-btn[data-state="loading"].ghfd-btn-warp { animation: ghfd-pulse-blue 1.4s infinite; }
.ghfd-btn[data-state="loading"].ghfd-btn-vless { animation: ghfd-pulse-purple 1.4s infinite; }
.ghfd-btn[data-state="done"]  { background: linear-gradient(135deg, #10b981, #059669) !important; box-shadow: 0 4px 20px rgba(16,185,129,.4) !important; animation: none !important; }
.ghfd-btn[data-state="error"] { background: linear-gradient(135deg, #ef4444, #b91c1c) !important; box-shadow: 0 4px 20px rgba(239,68,68,.4) !important; animation: none !important; }

@keyframes ghfd-pulse-blue   { 0%,100% { box-shadow: 0 4px 20px rgba(59,130,246,.4); } 50% { box-shadow: 0 4px 32px rgba(59,130,246,.7); } }
@keyframes ghfd-pulse-purple { 0%,100% { box-shadow: 0 4px 20px rgba(168,85,247,.4); } 50% { box-shadow: 0 4px 32px rgba(168,85,247,.7); } }

/* ── СТАТУС ── */
.ghfd-status {
    max-height: 0; overflow: hidden; font-size: 13px; text-align: center;
    border-radius: 12px; transition: all .3s; margin-top: 0;
}
.ghfd-status.visible  { max-height: 60px; margin-top: 12px; padding: 12px 16px; }
.ghfd-status.loading  { background: rgba(245,158,11,.1);  color: #fcd34d; border: 1px solid rgba(245,158,11,.25); }
.ghfd-status.success  { background: rgba(16,185,129,.1);  color: #4ade80; border: 1px solid rgba(16,185,129,.25); }
.ghfd-status.error    { background: rgba(239,68,68,.1);   color: #fca5a5; border: 1px solid rgba(239,68,68,.25); }

/* ── VLESS РЕЗУЛЬТАТ ── */
.ghfd-vless-result { margin-top: 4px; animation: ghfd-in .3s ease; }
.ghfd-result-label {
    font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px;
    color: #4ade80; display: flex; align-items: center; gap: 7px; margin-bottom: 10px;
}
.ghfd-result-box {
    display: flex; align-items: center;
    background: var(--g-inp); border: 1.5px solid rgba(74,222,128,.3);
    border-radius: 14px; overflow: hidden;
}
.ghfd-result-box input {
    flex: 1; background: none; border: none; outline: none;
    padding: 13px 16px; color: #4ade80; font-size: 12px; font-family: monospace;
}
.ghfd-result-box button {
    background: none; border: none; border-left: 1px solid var(--g-brd);
    padding: 13px 16px; color: #888; cursor: pointer; font-size: 15px; transition: color .2s;
}
.ghfd-result-box button:hover { color: #4ade80; }
.ghfd-result-hint {
    font-size: 12px; color: #555; margin-top: 8px; padding-left: 4px; line-height: 1.5;
}

@media (max-width: 480px) {
    .ghfd-body { padding: 16px; }
    .awg-select, .awg-custom-select { width: 140px; min-width: 140px; max-width: 140px; }
    .ghfd-mode-switch { gap: 6px; }
    .ghfd-mode-label { font-size: 10px; }
}
