:root {
    --sidebar-color: #0b1014;
    --header-color: #090E12;
    --text-color: #c7c9d3;
    --primary-color: #623cea;
    --highlight-color: #79af16;
    --positive-color: #30d158;
    --border-color: #2d2f3b;
    --card-bg-color: #0b1014;
    --button-bg-color: #3a3b4f;
    --button-hover-color: #10161a;
    --green: #9ADE1D;
}

:root[data-color-scheme="dark"] {
    --design-color: #a4f02f;
    --background-color: #090E12;
    --background-color-side: #0c1216;
    --text-color-h1: #FFFFFF;
    --text-color-h2: #FFFFFF;
    --text-color-p2: #A1A1A1;
    --text-color-p: #DDDDDD;
    --button-color: #0c1216;
    --icon-color: #FFFFFF;
    --num-color: #090e12;
}

/* Светлая тема */
:root[data-color-scheme="light"] {
    --design-color: #a4f02f;
    --background-color: #F6F6F6;
    --background-color-side: #EAEAEA;
    --text-color-h1: #090e12;
    --text-color-h2: #FFFFFF;
    --text-color-p2: #555555;
    --text-color-p: #090e12;
    --button-color: #FFFFFF;
    --icon-color: #090e12;
    --num-color: #090e12;
}

a {
    background-color: transparent;
}
a:active,
a:hover {
    outline: 0;
}
abbr[title] {
    border-bottom: 1px dotted;
}
b,
strong {
    font-weight: 700;
}
dfn {
    font-style: italic;
}
mark {
    color: #000;
    background: #ff0;
}
small {
    font-size: 80%;
}
sub,
sup {
    vertical-align: baseline;
    font-size: 75%;
    line-height: 0;
    position: relative;
}
sup {
    top: -0.5em;
}
sub {
    bottom: -0.25em;
}
img {
    border: 0;
}
svg:not(:root) {
    overflow: hidden;
}
hr {
    box-sizing: content-box;
    height: 0;
}
pre {
    overflow: auto;
}
code,
kbd,
pre,
samp {
    font-family: 'JetBrains Mono', monospace;
    font-size: 1em;
}
button,
input,
optgroup,
select,
textarea {
    color: inherit;
    font: inherit;
    margin: 0;
}
button {
    overflow: visible;
}
button,
select {
    text-transform: none;
}
button,
html input[type="button"],
input[type="reset"] {
    -webkit-appearance: button;
    cursor: pointer;
}
button[disabled],
html input[disabled] {
    cursor: default;
}
button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0;
    padding: 0;
}
input {
    line-height: normal;
}
input[type="checkbox"],
input[type="radio"] {
    box-sizing: border-box;
    padding: 0;
}
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    height: auto;
}
input[type="search"] {
    -webkit-appearance: none;
}
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

a {
color: inherit;
text-decoration: inherit;
font-size: inherit;
}

::selection {
background: #9ADE1D;
color: black;
}
::-moz-selection {
background: #9ADE1D;
color: black;
}

button:focus, a:focus {
    outline: none;
    box-shadow: none;
}

button {
    user-select: auto;
}

* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}

* {
    user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
}

body {
    margin: 0 auto;
    font-family: "Jost", sans-serif;
    background-color: var(--background-color-side);
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
    padding-top: var(--safe-area-top);
    padding-bottom: var(--safe-area-bottom);
    padding-left: var(--safe-area-left);
    padding-right: var(--safe-area-right);
}

.header {
    margin-top: var(--safe-area-top);
}

.tab-content {
    text-align: center;
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    color: var(--text-color-h1);
}

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

.bottom-nav {
    box-sizing: border-box;
    position: fixed;
    width: calc(100% - 40px);
    bottom: 0;
    display: flex;
    padding: 10px;
    transition: padding-bottom 0.3s ease;
    z-index: 100;
    margin-left: 20px;
    margin-right: 20px;
    margin-bottom: calc(var(--safe-area-bottom) + 20px); 
    border-radius: 15px;
    justify-content: space-around;
}

.nav-item {
    text-align: center;
    text-decoration: none;
    color: #000;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    transition: background-color 0.3s ease, color 0.3s ease;
    /* flex: 1; Равномерное распределение всех пунктов */
}

.icon-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 0;
    border-radius: 10px;
    background-color: transparent;
    transition: background-color 0.3s ease;
    flex-direction: column;
}

.icon {
    transform: scale(0.8);
    width: 50px;
    height: 35px;
    /* background-color: #dfffce; */
    color: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100px;
    font-size: 18px;
    transition: transform 0.3s ease, background-color 0.5s ease;
}

.text {
    font-size: 10px;
    font-weight: bold;
    text-transform: uppercase;
    color: var(--border-color);
    opacity: 1;
    white-space: nowrap;
    overflow: hidden;
    max-height: 50px;
    transition: opacity 0.3s ease, max-height 0.3s ease;
}

.nav-item.active .icon {
    background-color: #a4f02f;
    color: #090E12;
    font-size: 11pt;
    transform: scale(1.1);
}

.nav-item.active .text {
    opacity: 1;
    max-height: 50px;
    color: #72c224;
}

/* PROFILE CONTENT */

.user-card {
    border-radius: 10px;
    padding: 20px;
    max-width: 700px;
    margin: 0 auto;
}

.user-card h3 {
    line-height: 1;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11pt;
    font-weight: 500;
    color: var(--text-color-h1);
    margin-left: 15px;
    margin-bottom: 20px;
    margin-top: 5px;
}

.user-info {
    display: grid;
    grid-template-columns: 100px auto 90px;
    margin-top: 10px;
    margin-bottom: 30px;
    align-items: center;
    justify-items: center;
}

.user-details {
    justify-self: start;
}

.avatar {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 27px;
    font-weight: 500;
    color: var(--green);
}

.user-details {
    text-align: left;
}

.user-details h2 {
    margin: 0;
    font-size: 16px;
    color: var(--text-color-h1);
}

.user-details p {
    margin: 0;
    font-size: 10px;
    color: var(--text-color-p2);
    font-family: 'JetBrains Mono', monospace;
    line-height: 2;
}

.support-icon i {
    font-size: 20px;
    color: #FF043F;
}
.support-icon a {
    padding: 8px 9px 6px 9px;
    background: var(--background-color-side);
    border-radius: 5px;
}
.topcard {
    background: var(--background-color);
    border-radius: 0 0px 30px 30px;
    transition: max-height 0.5s ease, padding 0.5s ease;
}

.plan-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
    mix-blend-mode: screen;
    pointer-events: none;
    transform: translate(-50%, -50%) scale(2);
}

.plan-card {
    position: relative;
    border-radius: 30px;
    overflow: hidden;
    isolation: isolate;
    color: var(--num-color);
    padding: 20px;
    margin-bottom: 10px;
    transition: background-color 0.3s ease;
}

.plan-card {
    background: linear-gradient(120deg, #9ADE1D, #c4de1d, #1dde4d, #9ADE1D);
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
}

.plan-card.warning {
    /* background: linear-gradient(120deg, #EB1145, #89142A, #FAAC08, #EB1145); */
    background: #EB1145;
    background-size: 300% 300%;
    animation: gradientShift 6s ease infinite;
}
.plan-card.active {
    background: linear-gradient(120deg, #9ADE1D, #c4de1d, #1dde4d, #9ADE1D);
    transition: background-color 0.3s ease;
}

.plan-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: column;
}

.plan-title {
    font-size: 16px;
}

.dayleft {
    display: flex;
    flex-direction: column;
    align-content: center;
    align-items: center;
    justify-content: space-between;
}

.upgrade-btn {
    display: flex;
    gap: 8px;
    background-color: var(--num-color);
    color: #ffffff;
    border: none;
    border-radius: 15px;
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 50px;
    margin-top: 25px;
    box-sizing: border-box;
}

.upgrade-btn:hover {
    background-color: #333333;
}

.upgrade-btn:active {
    transform: scale(1.03);
    background-color: #68de3a;
    color: #000;
}

.plan-name {
    font-size: 33pt;
    font-weight: bold;
    line-height: 1;
    margin: 0;
    text-align: left;
    font-family: 'JetBrains Mono', monospace;
}

.plan-title,
.plan-name {
    display: block;
    text-align: left; /* Чтобы оба элемента были на одной линии слева */
}

.plan-title {
    margin: 5px;
}

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 8px;
}

.stat-item {
    background-color: var(--background-color);
    border-radius: 25px;
    padding: 15px 10px;
    flex: 1;
    display: grid;
    grid-template-columns: 30px auto;
    justify-items: center;
    justify-content: flex-start;
    align-items: center;
    justify-content: space-around;
}

.stat-icon {
    background-color: var(--background-color-side);
    width: 40px;
    height: 40px;
    border-radius: 15px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.stat-icon i {
    font-size: 16px;
    color: var(--text-color-p);
}

.stat-info p {
    margin: auto;
    font-size: 12px;
    color: var(--text-color-p);
}

.stat-info h2 {
    margin: 5px 0 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-color-h1);
}

.keys-container {
    width: 700px;
    margin: 0 auto;
}

.key-item {
    padding: 10px 15px;
    background: var(--background-color);
    margin: 10px 0px;
    border-radius: 10px;
}

.key-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
}

.key-header h3 {
    margin: 0 0 0 10px;
    font-size: 15px;
    font-weight: bold;
    color: var(--text-color-h1);
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
}

.key-toggle {
    background-color: var(--background-color);
    border: none;
    border-radius: 30%;
    padding: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.key-toggle i {
    font-size: 16px;
    color: var(--text-color-h1);
    transition: transform 0.3s ease;
}

.key-details {
    margin-top: 20px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #555555;
    display: none; /* По умолчанию скрыто */
}

.key-details p {
    margin: 0 0 5px;
    font-family: 'JetBrains Mono', monospace;
    word-wrap: break-word;
    word-break: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    text-align: left;
}

.key-item.active .key-details {
    display: block;
}

.key-item.active .key-toggle i {
    transform: rotate(180deg);
}

.key-item.active .key-toggle {
    background: #a4f02f;
}
.key-item.active .key-toggle i {
    color: #000;
}

.key-uid {
    background: var(--background-color);
    padding: 15px;
    border-radius: 8px;
    text-transform: uppercase;
    font-size: 9pt;
    text-align: left;
}

.logout-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background-color: var(--background-color-side);
    color: var(--icon-color);
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    margin-top: 10px;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.qr-display {
    padding: 0;
    opacity: 0; /* Изначально полностью прозрачный */
    height: 0; /* Изначально высота равна нулю */
    visibility: hidden; /* Элемент невидим */
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out, height 0.5s ease-in-out, padding 0.5s ease-in-out; /* Плавность для всех свойств */
}

.qr-display.show {
    opacity: 1; /* Полностью видим */
    height: auto; /* Высота автоматически подстраивается */
    visibility: visible; /* Делаем элемент видимым */
    padding: 15px; /* Восстанавливаем отступы */
}

.qr-display.show canvas {
    width: 100%!important;
    height: 100%!important;
}

.copy-btn i, .generate-qr-btn i {
    font-size: 16px; /* Размер иконки */
}

.copy-btn, .generate-qr-btn {
    display: flex;
    gap: 20px;
    background-color: var(--background-color-side);
    color: var(--text-color-h1);
    border: none;
    border-radius: 8px;
    padding: 13px 20px;
    margin-top: 5px;
    width: 100%;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    align-items: center;
}

.create-key-btn {
    display: block;
    align-items: center;
    justify-content: center;
    background-color: var(--background-color-side); /* Ярко-синий фон кнопки */
    color: var(--text-color-h1); /* Белый текст */
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    margin: 7px 10px;
    width: calc(100% - 20px);
    max-width: 100%;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 2s ease, transform 0.2s ease;
}

/* 
.copy-btn:hover, .generate-qr-btn:hover {
    background-color: #a4f02f;
    color: #333;
    transform: scale(0.99);
    transition: background-color 1s ease, transform 0.2s ease;
}
*/

.copy-btn:active {
    background-color: #a4f02f;
    color: #333;
    transform: scale(0.98);
    transition: background-color 0.5s ease, transform 0.2s ease;
}

/* Прелоадер фоновый */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #090E12; /* Фоновый цвет */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Круговая анимация */
.loader {
    border: 8px solid var(--background-color-side); /* Основной цвет фона */
    border-top: 8px solid #A5F02E; /* Цвет анимации */
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1s linear infinite;
}

/* Анимация вращения */
@keyframes spin {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.plan-card, .stat-item, .key-item {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.plan-card.visible, .stat-item.visible, .key-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.nokeys {
    width: 80%;
    margin: 30px auto;
    color: var(--text-color-p);
}

.info-h3 {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

.info-h3.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Анимация для плавного движения градиента */
@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}


/* Эффект тряски */
.shake-effect {
    display: inline-block;
    animation: shake 0.9s ease-in-out infinite;
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateY(-1px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(1px);
    }
}

/* Адаптивные стили */
@media (max-width: 768px) {
    .stats {
        grid-template-columns: 1fr 1fr;
    }
    .keys-container {
        width: 100%;
        margin: 0 auto;
    }
}