/* ==========================================================
   Telegram Fonts Generator – Styles
   ========================================================== */

/* --- Reset --- */
.tfg *, .tfg *::before, .tfg *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* --- Variables --- */
.tfg {
    --tfg-blue: #2AABEE;
    --tfg-blue-dark: #1E96D1;
    --tfg-blue-light: #E8F5FD;
    --tfg-blue-glow: rgba(42,171,238,0.15);
    --tfg-bg: #F4F8FB;
    --tfg-card: #FFFFFF;
    --tfg-border: #E2EAF1;
    --tfg-text: #1A2B3C;
    --tfg-text-dim: #7A8FA0;
    --tfg-success: #34C759;
    --tfg-radius: 14px;
    --tfg-shadow: 0 2px 8px rgba(26,43,60,0.06);
    --tfg-shadow-hover: 0 4px 20px rgba(42,171,238,0.12);
    --tfg-font: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
    --tfg-max-w: 720px;
}

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

/* --- Hero --- */
.tfg-hero {
    text-align: center;
    margin-bottom: 32px;
    animation: tfgFadeDown .5s ease-out;
}
.tfg-hero-icon {
    margin-bottom: 12px;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(42,171,238,0.3));
    animation: tfgFloat 3s ease-in-out infinite;
}
.tfg-title {
    font-size: 32px;
    font-weight: 800;
    color: var(--tfg-text);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
    background: linear-gradient(135deg, #1A2B3C 0%, #2AABEE 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.tfg-subtitle {
    font-size: 15px;
    color: var(--tfg-text-dim);
    font-weight: 400;
}

/* --- Input --- */
.tfg-input-wrap {
    margin-bottom: 24px;
    animation: tfgFadeDown .5s ease-out .1s both;
}
.tfg-input-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--tfg-text-dim);
    margin-bottom: 8px;
}
.tfg-input-box {
    position: relative;
    background: var(--tfg-card);
    border: 2px solid var(--tfg-border);
    border-radius: var(--tfg-radius);
    transition: border-color .25s, box-shadow .25s;
    box-shadow: var(--tfg-shadow);
}
.tfg-input-box:focus-within {
    border-color: var(--tfg-blue);
    box-shadow: 0 0 0 4px var(--tfg-blue-glow);
}
.tfg-input-box textarea {
    display: block;
    width: 100%;
    padding: 16px 44px 16px 18px;
    border: none;
    background: transparent;
    font-size: 17px;
    font-family: var(--tfg-font);
    color: var(--tfg-text);
    resize: none;
    outline: none;
    line-height: 1.45;
}
.tfg-input-box textarea::placeholder {
    color: #B8C8D6;
}
.tfg-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    width: 28px;
    height: 28px;
    border: none;
    background: #E8ECF0;
    color: #8899A6;
    font-size: 18px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: .2s;
    line-height: 1;
}
.tfg-clear-btn:hover {
    background: #D0D6DC;
    color: #5C6D7E;
}

/* --- Results info --- */
.tfg-results-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
    animation: tfgFadeDown .5s ease-out .2s both;
}
.tfg-results-info span {
    font-size: 13px;
    font-weight: 600;
    color: var(--tfg-text-dim);
}

/* --- Results list --- */
.tfg-results {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* --- Font Card --- */
.tfg-card {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    background: var(--tfg-card);
    border: 1px solid var(--tfg-border);
    border-radius: 0;
    transition: background .2s, box-shadow .2s, border-color .2s;
    position: relative;
    cursor: default;
}
.tfg-card:first-child {
    border-radius: var(--tfg-radius) var(--tfg-radius) 0 0;
}
.tfg-card:last-child {
    border-radius: 0 0 var(--tfg-radius) var(--tfg-radius);
}
.tfg-card:only-child {
    border-radius: var(--tfg-radius);
}
.tfg-card + .tfg-card {
    border-top: none;
}
.tfg-card:hover {
    background: var(--tfg-blue-light);
    border-color: rgba(42,171,238,0.25);
    z-index: 1;
}
.tfg-card:hover + .tfg-card {
    border-top-color: rgba(42,171,238,0.25);
}

/* Number badge */
.tfg-card-num {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--tfg-bg);
    color: var(--tfg-text-dim);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-right: 14px;
    transition: .2s;
}
.tfg-card:hover .tfg-card-num {
    background: var(--tfg-blue);
    color: #fff;
}

/* Font preview text */
.tfg-card-text {
    flex: 1;
    font-size: 17px;
    color: var(--tfg-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
    line-height: 1.5;
    user-select: all;
}

/* Style label */
.tfg-card-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--tfg-text-dim);
    background: var(--tfg-bg);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
    margin: 0 12px;
    flex-shrink: 0;
    transition: .2s;
}
.tfg-card:hover .tfg-card-label {
    background: rgba(42,171,238,0.1);
    color: var(--tfg-blue-dark);
}

/* Copy button */
.tfg-copy-btn {
    padding: 7px 18px;
    border: 2px solid var(--tfg-border);
    border-radius: 10px;
    background: var(--tfg-card);
    color: var(--tfg-text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    flex-shrink: 0;
    white-space: nowrap;
    font-family: var(--tfg-font);
}
.tfg-copy-btn:hover {
    border-color: var(--tfg-blue);
    color: var(--tfg-blue);
    background: var(--tfg-blue-light);
}
.tfg-copy-btn.tfg-copied {
    border-color: var(--tfg-success);
    background: #ECFDF0;
    color: var(--tfg-success);
    pointer-events: none;
}

/* Entry animation */
.tfg-card-enter {
    animation: tfgSlideUp .35s ease-out both;
}

/* --- Show More --- */
.tfg-showmore-wrap {
    text-align: center;
    margin-top: 20px;
    animation: tfgFadeDown .5s ease-out .3s both;
}
.tfg-showmore-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 36px;
    border: 2px solid var(--tfg-blue);
    border-radius: 14px;
    background: transparent;
    color: var(--tfg-blue);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    transition: all .25s;
    font-family: var(--tfg-font);
}
.tfg-showmore-btn:hover {
    background: var(--tfg-blue);
    color: #fff;
    box-shadow: 0 6px 24px rgba(42,171,238,0.25);
    transform: translateY(-1px);
}
.tfg-showmore-btn:active {
    transform: translateY(0);
}
.tfg-showmore-btn svg {
    transition: transform .25s;
}
.tfg-showmore-btn:hover svg {
    transform: translateY(2px);
}

/* Progress bar */
.tfg-progress {
    margin-top: 12px;
    height: 4px;
    background: var(--tfg-border);
    border-radius: 4px;
    max-width: 280px;
    margin-left: auto;
    margin-right: auto;
    overflow: hidden;
}
.tfg-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--tfg-blue), #50C8F0);
    border-radius: 4px;
    transition: width .4s ease;
    width: 10%;
}

/* Hidden */
.tfg-hidden { display: none !important; }

/* --- Animations --- */
@keyframes tfgFadeDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tfgSlideUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes tfgFloat {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-6px); }
}

/* --- Copy toast --- */
.tfg-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(--tfg-font);
    box-shadow: 0 8px 32px rgba(0,0,0,0.18);
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    display: flex;
    align-items: center;
    gap: 8px;
}
.tfg-toast.tfg-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.tfg-toast svg {
    color: var(--tfg-success);
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .tfg { padding: 20px 12px 36px; }
    .tfg-title { font-size: 24px; }
    .tfg-card { padding: 12px 10px; }
    .tfg-card-text { font-size: 14px; }
    .tfg-card-label { display: none; }
    .tfg-card-num { width: 24px; height: 24px; font-size: 10px; margin-right: 10px; }
    .tfg-copy-btn { padding: 6px 14px; font-size: 12px; }
}
