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

/* Global dark scrollbar styles */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}

*::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 3px;
}

*::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000000;
    height: 100vh;
    color: #e0e0e0;
    overflow: hidden;
    padding-top: 80px;
    transition: padding-top 0.3s ease;
}

body.search-active {
    padding-top: 85px;
}

/* Search Progress Bar */
.search-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 0;
    background: linear-gradient(90deg, #ff0066 0%, #ff6600 15%, #ffcc00 30%, #66ff00 45%, #00ff66 60%, #00ccff 75%, #6600ff 90%, #ff0066 100%);
    overflow: hidden;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    z-index: 1000;
    will-change: height, opacity;
}

.search-progress-bar.active {
    height: 5px;
    opacity: 1;
}

.search-progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.8), rgba(255, 255, 255, 0.5), transparent);
    transform: translateX(-100%);
    animation: shine 2s ease-in-out infinite;
    will-change: transform;
}

@keyframes shine {
    0% { transform: translateX(-100%); }
    50% { transform: translateX(0%); }
    100% { transform: translateX(100%); }
}

/* Layout for new architecture */
.app-layout {
    display: flex;
    height: calc(100vh - 80px);
}

.main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    /* Предотвращение дергания при загрузке */
    min-height: calc(100vh - 80px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.main-content-margin {
    margin-left: 0px !important;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Плавные переходы для основного контента */
.main-content.loading {
    opacity: 0.8;
    transform: translateY(10px);
}

.main-content.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Стили для предотвращения дергания при загрузке */
#loading {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#loading[style*="display: block"] {
    opacity: 1;
    transform: translateY(0);
}

#results {
    min-height: 100px;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

#results.loading {
    opacity: 0.5;
    transform: translateY(10px);
}

/* Скелетон анимация для плавной загрузки */
.skeleton {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1) 25%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.1) 75%);
    background-size: 400% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

@keyframes skeleton-loading {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

/* Стабилизация высоты при переходах */
.container {
    min-height: calc(100vh - 80px);
    transition: all 0.3s ease;
}

/* Desktop Navigation */
.desktop-nav {
    width: 100px;
    background: rgba(20, 20, 20, 0.9);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 80px;
    left: 0;
    bottom: 0;
    z-index: 100;
}

.desktop-nav .nav-menu {
    list-style: none;
    padding: 1em 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1em;
}

.desktop-nav .nav-item {
    margin: 0;
}

.desktop-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1em 0.5em;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: all 0.3s ease;
    border-radius: 8px;
    font-weight: 400;
    font-size: 0.9em;
    margin: 0 0.5em;
    min-height: 70px;
}

.desktop-nav .nav-link:hover {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.desktop-nav .nav-item.active .nav-link {
    background: transparent;
    color: rgba(255, 255, 255, 0.9);
    border: none;
}

.desktop-nav .nav-icon {
    font-size: 1.8em;
    margin-bottom: 0;
    display: block;
}

.desktop-nav .nav-icon svg {
    width: 32px;
    height: 32px;
}

.desktop-nav .nav-text {
    display: none;
}

/* Mobile Navigation */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(25px) saturate(1.2);
    -webkit-backdrop-filter: blur(25px) saturate(1.2);
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    z-index: 1000;
    height: 60px;
}

/* Fallback for Safari iOS */
@supports not (backdrop-filter: blur(25px)) {
    .mobile-nav {
        background: rgba(0, 0, 0, 0.95);
    }
}

.mobile-nav .nav-menu {
    list-style: none;
    display: flex;
    height: 100%;
    margin: 0;
    padding: 0;
}

.mobile-nav .nav-item {
    flex: 1;
    display: flex;
}

.mobile-nav .nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
    padding: 0.5em;
}

.mobile-nav .nav-link:hover {
    color: rgba(255, 255, 255, 0.8);
}

.mobile-nav .nav-item.active .nav-link {
    color: rgba(255, 255, 255, 0.9);
}

.mobile-nav .nav-icon {
    font-size: 1.5em;
    margin-bottom: 0;
}

.mobile-nav .nav-icon svg {
    width: 28px;
    height: 28px;
}

.mobile-nav .nav-text {
    display: none;
}

/* Adapting main-content for desktop navigation */
.main-content {
    margin-left: 100px;
}

/* State before search - hide search field in header */
body.no-search {
    padding-top: 80px;
}

body.no-search .header-search {
    display: none;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 80px;
    background: #000000;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 999;
    display: flex;
    align-items: center;
    padding: 0 20px 0 0;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    transition: top 0.3s ease;
}

body.search-active .header {
    top: 5px;
}

.logo {
    background-clip: text;
    margin-right: 25px;
    transition: all 0.3s ease;
    cursor: pointer;
    margin: auto;
    width: 100px;
    text-align: center;
    left: 0;
    position: inherit;
}

.logo:hover {
    transform: scale(1.05);
    opacity: 0.8;
}

.header-search {
    flex: 1;
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
    margin-left: 100px;
}

.header-search-input {
    width: 100%;
    padding: 20px 80px 20px 30px;
    font-size: 1.4em;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #e0e0e0;
    outline: none;
    transition: all 0.3s ease;
    font-weight: 300;
}

.header-search-input:focus {
    background: rgba(255, 255, 255, 0.02);
}

.header-search-input::placeholder {
    color: #666;
    font-weight: 300;
}

.header-search-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: #666;
    border: none;
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
}

.header-search-btn:hover {
    color: #999;
    transform: translateY(-50%) scale(1.1);
}

.header-search-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: translateY(-50%);
}

.app-container {
    display: flex;
    height: calc(100vh - 80px);
}

.error {
    background: rgba(255, 107, 107, 0.2);
    color: #ffcccb;
    padding: 15px;
    border-radius: 15px;
    margin: 20px 0;
    display: none;
    border: 1px solid rgba(255, 107, 107, 0.3);
}

@media (max-width: 768px) {
    /* Hide desktop nav and show mobile nav */
    .desktop-nav {
        display: none;
    }

    .logo {
        width: 64px;
    }

    .mobile-nav {
        display: block;
    }

    /* Remove left margin for main-content */
    .main-content {
        margin-left: 0 !important;
        margin-bottom: 50px; /* Place for bottom navigation */
    }

    /* Update app-layout for mobile */
    .app-layout {
        padding-bottom: 0;
    }

    .header {
        padding: 0 15px;
        height: 70px;
    }
    
    .header-search{
        margin-left: 40px;
    }
    
    .header-search-input {
        font-size: 1.1em;
        padding: 15px 60px 15px 20px;
    }
    
    .header-search-btn {
        width: 40px;
        height: 40px;
        font-size: 1.3em;
        right: 15px;
    }
    
    body {
        padding-top: 70px;
        height: 100vh;
        padding-bottom: 60px;
    }
    
    body.no-search {
        padding-top: 70px;
        padding-bottom: 60px;
    }
} 