/* ==========================================================
   Telegram QR Code Generator – Styles
   ========================================================== */
.tqrg *,.tqrg *::before,.tqrg *::after{box-sizing:border-box;margin:0;padding:0}

.tqrg {
    --q-dark: #1E1E1E;
    --q-card: #2A2A2A;
    --q-border: #3A3A3A;
    --q-text: #FFFFFF;
    --q-dim: #8A8A8A;
    --q-green: #7CC47F;
    --q-green-dark: #5DA860;
    --q-accent: #2AABEE;
    --q-input-bg: #F5F5F5;
    --q-radius: 16px;
    --q-max: 960px;
    --q-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

    max-width: var(--q-max);
    margin: 0 auto;
    padding: 32px 16px 48px;
    font-family: var(--q-font);
    color: var(--q-text);
    line-height: 1.5;
}

/* --- Hero --- */
.tqrg-hero {
    text-align: center;
    font-size: 30px;
    font-weight: 800;
    color: #1A2B3C;
    margin-bottom: 28px;
    letter-spacing: -0.5px;
    padding: 24px 16px;
    background: linear-gradient(135deg, #d4f0d4 0%, #e8f5e8 40%, #f0f9f0 100%);
    border-radius: 20px;
    line-height: 1.25;
}

/* --- Main Card --- */
.tqrg-card {
    display: flex;
    background: var(--q-dark);
    border-radius: var(--q-radius);
    overflow: hidden;
    box-shadow: 0 16px 60px rgba(0,0,0,0.25);
    min-height: 480px;
}

/* --- LEFT PANEL --- */
.tqrg-left {
    flex: 1;
    padding: 0;
    display: flex;
    flex-direction: column;
}

/* Tab bar */
.tqrg-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border-bottom: 1px solid var(--q-border);
    padding: 16px 20px 0;
}
.tqrg-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 14px 12px;
    border: none;
    background: transparent;
    color: var(--q-dim);
    font-size: 11px;
    font-weight: 600;
    font-family: var(--q-font);
    cursor: pointer;
    transition: .2s;
    border-radius: 10px 10px 0 0;
    border: 1px solid transparent;
    border-bottom: none;
    position: relative;
    white-space: nowrap;
}
.tqrg-tab svg { opacity: .6; transition: opacity .2s; }
.tqrg-tab:hover { color: var(--q-text); }
.tqrg-tab:hover svg { opacity: .9; }
.tqrg-tab.active {
    color: var(--q-text);
    background: var(--q-card);
    border-color: var(--q-border);
}
.tqrg-tab.active svg { opacity: 1; }
.tqrg-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0; right: 0;
    height: 2px;
    background: var(--q-card);
}

/* Forms */
.tqrg-forms {
    flex: 1;
    padding: 24px 24px 28px;
}
.tqrg-form {
    display: none;
}
.tqrg-form.active { display: block; }
.tqrg-form-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--q-text);
    margin-bottom: 16px;
}
.tqrg-field-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--q-dim);
    margin-bottom: 8px;
}
.tqrg-input {
    display: block;
    width: 100%;
    padding: 14px 16px;
    border: none;
    border-radius: 10px;
    background: var(--q-input-bg);
    color: #1A2B3C;
    font-size: 15px;
    font-family: var(--q-font);
    outline: none;
    transition: box-shadow .2s;
}
.tqrg-input:focus {
    box-shadow: 0 0 0 3px rgba(42,171,238,0.2);
}
.tqrg-input::placeholder { color: #B0B0B0; }
.tqrg-textarea { resize: vertical; min-height: 120px; }

/* --- RIGHT PANEL --- */
.tqrg-right {
    width: 360px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 20px;
    background: var(--q-dark);
}

/* QR area */
.tqrg-qr-area {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 20px;
}

/* QR Frame */
.tqrg-qr-frame {
    width: 260px;
    height: 260px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    overflow: hidden;
}
.tqrg-qr-frame canvas {
    display: block;
    max-width: 230px;
    max-height: 230px;
}
.tqrg-qr-brand {
    position: absolute;
    bottom: 6px;
    right: 10px;
    font-size: 10px;
    font-weight: 700;
    color: #ccc;
    letter-spacing: .5px;
}

/* Style carousel (vertical) */
.tqrg-styles-rail {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 62px;
}
.tqrg-styles-arrow {
    width: 32px;
    height: 24px;
    border: none;
    background: rgba(255,255,255,0.06);
    color: var(--q-dim);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
}
.tqrg-styles-arrow:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}
.tqrg-styles-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 210px;
    overflow: hidden;
    padding: 2px;
}
.tqrg-style-thumb {
    width: 52px;
    height: 52px;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    overflow: hidden;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s, transform .15s;
    flex-shrink: 0;
}
.tqrg-style-thumb:hover {
    transform: scale(1.08);
}
.tqrg-style-thumb.active {
    border-color: var(--q-accent);
    box-shadow: 0 0 0 2px rgba(42,171,238,0.3);
}
.tqrg-style-thumb canvas {
    display: block;
    width: 44px;
    height: 44px;
}

/* --- Action buttons --- */
.tqrg-actions {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 320px;
}
.tqrg-act-btn {
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-family: var(--q-font);
    font-weight: 600;
    transition: .2s;
}
.tqrg-act-save {
    flex: 1;
    padding: 14px 0;
    background: linear-gradient(135deg, var(--q-green), var(--q-green-dark));
    color: #fff;
    font-size: 16px;
    letter-spacing: .3px;
}
.tqrg-act-save:hover {
    filter: brightness(1.1);
    box-shadow: 0 4px 16px rgba(124,196,127,0.3);
}
.tqrg-act-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.08);
    color: var(--q-dim);
}
.tqrg-act-icon:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
}

/* --- Toast --- */
.tqrg-toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1A2B3C;
    color: #fff;
    padding: 12px 24px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: var(--q-font);
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tqrg-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .tqrg-card { flex-direction: column; }
    .tqrg-right { width: 100%; padding: 20px 16px; }
    .tqrg-hero { font-size: 22px; padding: 16px 12px; }
    .tqrg-tabs { overflow-x: auto; flex-wrap: nowrap; padding: 12px 12px 0; }
    .tqrg-tab { padding: 8px 10px 10px; font-size: 10px; }
    .tqrg-qr-frame { width: 220px; height: 220px; }
    .tqrg-qr-frame canvas { max-width: 190px; max-height: 190px; }
}
