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

:root {
    --yellow: #f5d86e;
    --bg-dark: #333;
    --light-gray: #dddcdc;
}

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

body {
    font-family: 'Manrope', sans-serif;
    background: var(--bg-dark);
    color: #fff;
    max-width: 430px;
    margin: 0 auto;
    padding: 16px;
}

.glass-card {
    position: relative;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.14) 0%,
        rgba(255, 255, 255, 0.07) 50%,
        rgba(255, 255, 255, 0.16) 100%
    );
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 24px;
    box-shadow:
        0 16px 36px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.glass-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(
        125deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0) 60%,
        rgba(255, 255, 255, 0.12) 100%
    );
    pointer-events: none;
    opacity: 0.7;
}

.glass-card > * {
    position: relative;
    z-index: 1;
}

.accent-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border-radius: 18px;
    border: none;
    padding: 14px 22px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(
        135deg,
        rgba(243, 194, 17, 0.377) 0%,
        rgba(240, 193, 25, 0.295) 50%,
        rgba(243, 196, 24, 0.377) 100%
    );
    color: #ffffff;
    transition: all 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    box-shadow: 
        0 8px 32px rgba(245, 216, 110, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -1px 0 rgba(179, 152, 46, 0.2);
}

.accent-btn i {
    font-size: 16px;
}

.accent-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 36px rgba(245, 216, 110, 0.45);
    background: linear-gradient(
        135deg,
        rgba(245, 213, 99, 0.35) 0%,
        rgba(248, 213, 87, 0.22) 50%,
        rgba(245, 212, 92, 0.35) 100%
    );
    box-shadow: 
        0 12px 40px rgba(245, 216, 110, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.5),
        inset 0 -1px 0 rgba(179, 152, 46, 0.25);
}

.accent-btn.secondary {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.accent-btn.secondary:hover {
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.28);
}

.accent-btn.secondary i {
    font-size: 18px;
    opacity: 0.9;
}

.card-title {
    font-family: 'Oswald', sans-serif;
    font-size: clamp(20px, 4.2vw, 26px);
    font-weight: 600;
    color: rgba(255, 255, 255, 0.95);
}

.card-subtitle {
    font-size: 14px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.7);
}

.top-bar {
    background: var(--yellow);
    color: #000;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(12px, 3vw, 16px) clamp(16px, 4vw, 24px);
    font-size: clamp(16px, 4vw, 20px);
    margin-bottom: 10px;
    flex-shrink: 0;
    max-width: min(1000px, 90vw);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    height: 75px;
}

/* Адаптивность для планшетов */
@media (min-width: 768px) {
    .top-bar {
        width: calc(100%);
        max-width: min(1000px, 85vw);
        padding: clamp(12px, 3vw, 16px) clamp(20px, 4vw, 28px);
    }
}

/* Адаптивность для десктопов */
@media (min-width: 924px) {
    .top-bar {
        width: calc(100% );
        max-width: min(1000px, 80vw);
        padding: 14px clamp(24px, 4vw, 32px);
    }
}


/* Адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .top-bar {
        max-width: min(1000px, 95vw);
        padding: clamp(10px, 3vw, 14px) clamp(14px, 4vw, 18px);
        font-size: clamp(14px, 4vw, 18px);
        margin-bottom: 8px;
    }
}

/* Принудительный сброс всех состояний при добавлении класса */
.reset-all-states * {
    transform: none !important;
    box-shadow: none !important;
    background: initial !important;
    border-color: initial !important;
    transition: none !important;
}

/* Убираем все :active, :hover, :focus состояния принудительно */
button:active, 
button:focus, 
button:hover,
.back-btn:active,
.back-btn:focus, 
.back-btn:hover,
.accent-btn:active,
.accent-btn:focus,
.accent-btn:hover {
    transform: scale(1) !important;
    background: initial !important;
    border-color: initial !important;
    box-shadow: none !important;
}

/* Отключаем все переходы временно */
.no-transitions * {
    transition: none !important;
}

@media (max-width: 360px) {
    .top-bar {
        width: calc(100% - 20px);
        padding: 8px 12px;
        font-size: 14px;
        margin-bottom: 6px;
    }
}

.title {
    font-family: 'Oswald', sans-serif;
    font-size: 28px;
    font-weight: 300;
    text-align: center;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 15px;
    text-align: center;
    color: #ccc;
    margin-bottom: 20px;
}

.upload-btn {
    font-family: 'Manrope', sans-serif;
    width: calc(100% - 40px); /* Увеличиваем отступы для мобильных */
    padding: clamp(16px, 4vw, 20px);
    background: var(--yellow);
    border-radius: 50px;
    color: #000;
    font-size: clamp(18px, 4vw, 18px);
    font-weight: 700;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s;
    margin: 2px 0; 
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    box-sizing: border-box;
    max-width: 760px; /* Ограничение максимальной ширины кнопки */
}

.upload-btn:hover {
    background: #f8e085;
}

.upload-btn i {
    font-size: 25px;
}

.quick-action .button-icon-test {
    filter: brightness(0) invert(1); /* Делает черные иконки белыми */
    transition: filter 0.3s ease;
}

.quick-action:hover .button-icon-test {
    filter: brightness(0) invert(1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
}


/* Адаптивность для очень маленьких экранов */
@media (max-width: 480px) {
    .upload-btn {
        width: calc(100% - 30px);
        max-width: min(1000px, 95vw);
        padding: clamp(14px, 4vw, 18px);
        font-size: clamp(16px, 4vw, 17px);
    }
    
    .upload-btn i {
        font-size: 22px;
    }
}

@media (max-width: 360px) {
    .upload-btn {
        width: calc(100% - 20px);
        padding: 12px 16px;
        font-size: 15px;
    }
    
    .upload-btn i {
        font-size: 20px;
    }
}

.back-btn {
    background: transparent;
    border: none;
    font-size: 28px;
    margin-right: 10px;
    cursor: pointer;
    color: #ffffff;
}

.back-btn.reset-state {
    transform: scale(1) !important;
    border-color: rgba(255, 255, 255, 0.2) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    box-shadow: none !important;
    transition: all 0.1s ease !important;
}

.back-btn {
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}
/* Убираем подсветку для всех интерактивных элементов */
button, .back-btn, .logo-link {
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

/* Принудительный сброс фокуса */
button:focus, .back-btn:focus {
    outline: none !important;
    box-shadow: none !important;
}

.back-btn i{
    color: #ffffff;
}

.button-icon{
    width: 40px;
    height: 40px;
}

.button-link{
    width: 35px;
    height: 35px;
    margin-bottom: 4px;
}

.button-icon-test{
    width: 48px;
    height: 48px;

}

.button-icon-tools{
    width: 40px;
    height: 40px;
}

.item-content {
    font-size: 15px;
    line-height: 1.5;
    color: #ffffff;
    text-align: left;
    font-weight: 500;
    /* Добавляем свойства для лучших переносов */
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto; /* Автоматические переносы для поддерживающих браузеров */
}

/* Для браузеров, которые поддерживают hyphens */
@supports (hyphens: auto) {
    .item-content {
        hyphens: auto;
        hyphenate-limit-chars: 6 3 2; /* мин. длина слова, мин. букв до/после переноса */
    }
}

.app-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.55);
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 4000;
}

.app-loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.app-loading-overlay .loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    background: #ebeaea;
    color: #000;
    padding: 22px 25px;
    border-radius: 18px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.app-loading-overlay .spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-top-color: #1c1c1e;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.app-toast-container {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 10000;
    width: auto;
    max-width: none;
    align-items: center;
}

.app-toast {
    font-family: 'Manrope', sans-serif;
    font-weight: 500;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.15) 100%);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 15px 30px;
    border-radius: 12px;
    text-align: center;
    white-space: nowrap;
    box-shadow: 0 8px 25px rgba(0,0,0,0.2);
    opacity: 0;
    transform: translateY(-20px);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    width: fit-content;
}

.app-toast.visible {
    opacity: 1;
    transform: translateY(0);
}


.hidden {
    display: none !important;
}

.loading-state {
    text-align: center;
    color: #666;
    padding: 20px 0;
}

.empty-state {
    text-align: center;
    color: #ffffff;
    padding: 20px;
}
