@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;
}


.top-bar {
    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%    
    );
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-radius: 50px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: clamp(12px, 3vw, 16px) clamp(16px, 4vw, 24px);
    margin-bottom: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.25),
        inset 0 -1px 0 rgba(0, 0, 0, 0.05);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/* Контейнер для бликов в хедере */
.top-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        135deg,
        transparent 0%,
        rgba(255, 255, 255, 0.3) 30%, /* Более яркие белые блики */
        transparent 70%
    );
    border-radius: 50px;
    opacity: 0.6;
    pointer-events: none;
}

/* Эффект градиентной рамки для хедера */
.top-bar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.3),
        rgba(245, 216, 110, 0.2),
        rgba(255, 255, 255, 0.3),
        rgba(245, 216, 110, 0.2)
    );
    border-radius: 52px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

/* Адаптивность для планшетов */
@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);
        margin-bottom: 15px;
    }

}

@media (max-width: 360px) {
    .top-bar {
        width: calc(100% - 20px);
        padding: 8px 12px;
        margin-bottom: 12px;
    }
    
    .logo {
        height: 40px;
        width: 200px;
    }
}

.creation-btn {
    width: 100%;
    max-width: 380px;
    min-height: 140px;
    background: var(--light-gray);
    border-radius: 20px;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    padding: 18px;
    text-align: center;
    margin: 0;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.creation-btn:hover {
    transform: translateY(-6px);
    background: #e8e8e8;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.creation-btn i {
    font-size: 32px;
    color: #333;
}

.logo {
    margin-top: 2px;
    height: 50px;
    width: 250px;
    object-fit: contain; /* Сохраняет пропорции логотипа */
}

.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;
}


/* Layout for the three creation buttons */
.buttons-container {
    display: grid;
    gap: 16px;
    grid-template-columns: 1fr;
    justify-items: center;
    align-items: start;
    margin-bottom: 88px; /* allow space for fixed upload button */
}

/* On wider screens use two columns and make the third button span both columns centered below */
@media (min-width: 560px) {
    .buttons-container {
        grid-template-columns: repeat(2, minmax(220px, 1fr));
        grid-auto-rows: minmax(140px, auto);
        gap: 18px;
        align-items: stretch;
    }
    /* Make the third button span both columns and stay centered */
    .buttons-container .creation-btn:nth-child(3) {
        grid-column: 1 / -1;
        justify-self: center;
        max-width: 540px;
    }
}

@media (min-width: 920px) {
    .buttons-container {
        gap: 24px;
        margin-bottom: 120px;
    }
}

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

.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: #444;
    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;
}

/* Анимация появления и исчезновения */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-20px);
    }
}


@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.hidden {
    display: none !important;
}

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

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

.conspect-item:not(:last-child)::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: min(333px, 90vw); /* Максимум 333px, но не более 90% ширины экрана */
    height: 1px;
    background: #7e7d7d;
}
