/* NEW: сообщаем браузеру, что сайт тёмный — нативные контролы станут тёмными */
:root {
    color-scheme: dark;
}

/* NEW: утилити-класс для скрытия элементов при необходимости */
.hidden {
    display: none !important;
}

/* Основные цвета для тёмной темы */
:root {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --header-footer-bg: #1e1e1e;
    --button-bg: #333333;
    --active-btn-bg: #444444;
    --accent-color: #7c4dff;
    --item-bg: #2d2d2d;
    --search-bg: #3d3d3d;
    --error-color: #ff5252;
    --success-color: #4caf50;
}

/* Общие стили */
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
}

/* Шапка */
header {
    background-color: var(--header-footer-bg);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent-color);
}

.header-buttons {
    display: flex;
    gap: 10px;
}

.header-btn {
    background-color: var(--button-bg);
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s ease;
}

.header-btn:hover {
    background-color: var(--active-btn-bg);
    transform: translateY(-2px);
}

.header-btn.active {
    background-color: var(--accent-color);
    color: white;
    box-shadow: 0 4px 8px rgba(124, 77, 255, 0.3);
}

/* Кнопка переключения языка */
.language-toggle {
    background-color: var(--button-bg);
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    color: var(--text-color);
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 50px;
    text-align: center;
}

.language-toggle:hover {
    background-color: var(--active-btn-bg);
    transform: translateY(-2px);
}

.language-toggle:active {
    transform: translateY(0);
}

/* Хлебные крошки */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-grow: 1;
    margin-left: 20px;
    flex-wrap: wrap;
}

.breadcrumb {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.breadcrumb:hover {
    background-color: rgba(124, 77, 255, 0.1);
    color: var(--accent-color);
}

.breadcrumb.home {
    font-weight: bold;
}

.breadcrumb-separator {
    color: #777;
    margin: 0 5px;
}

.breadcrumb.back {
    background-color: var(--accent-color);
    color: white;
    margin-right: 10px;
    padding: 6px 10px;
}

.breadcrumb.back:hover {
    background-color: #6b3cea;
}

/* Основное содержимое */
main {
    flex: 1;
    padding: 20px 0;
}

.section-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.content-section {
    display: none;
    animation: fadeIn 0.5s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Информационный раздел */
.info-content {
    background-color: var(--item-bg);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.info-wrapper {
    display: flex;
    align-items: center;
    gap: 30px;
}

.info-image {
    width: 200px;
    height: 200px;
    border-radius: 12px;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
    position: relative;
    z-index: 2;
}

/* Анимация увеличения изображения при наведении */
.info-image:hover {
    transform: scale(1.1);
    border-width: 4px;
    border-color: #8e6cff;
    box-shadow: 
        0 8px 25px rgba(124, 77, 255, 0.4),
        0 0 0 6px rgba(124, 77, 255, 0.1);
    z-index: 10;
}

/* Плавное увеличение для плавного эффекта */
.info-wrapper:hover .info-image {
    transform: scale(1.1);
}

.info-text {
    flex: 1;
}

.info-text p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    position: relative;
    padding-left: 20px;
}

.info-text p::before {
    content: "•";
    color: var(--accent-color);
    position: absolute;
    left: 0;
    font-weight: bold;
}

/* Стили для хранилища */
.storage-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
    flex-wrap: wrap;
    background-color: var(--item-bg);
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.search-box {
    display: flex;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    position: relative;
}

.search-box input {
    flex: 1;
    padding: 10px 40px 10px 15px;
    border: 2px solid var(--header-footer-bg);
    border-radius: 20px;
    background-color: var(--search-bg);
    color: var(--text-color);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(124, 77, 255, 0.2);
}

.search-btn, .clear-search {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.search-btn {
    right: 40px;
    opacity: 0.7;
}

.search-btn:hover {
    opacity: 1;
}

.clear-search {
    right: 10px;
    opacity: 0.5;
    padding: 5px;
}

.clear-search:hover {
    opacity: 1;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.sort-options select {
    padding: 10px 15px;
    border: 2px solid var(--header-footer-bg);
    border-radius: 20px;
    background-color: var(--search-bg);
    color: var(--text-color);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
}

.sort-options select:focus {
    outline: none;
    border-color: var(--accent-color);
}

/* Элементы хранилища */
.storage-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

.storage-item {
    background-color: var(--item-bg);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    transition: all 0.3s ease;
    border-left: 3px solid var(--accent-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.storage-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.item-icon {
    font-size: 28px;
    margin-right: 15px;
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    min-width: 0;
}

.item-info h3 {
    margin: 0 0 5px 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
}

.item-info p {
    margin: 0;
    font-size: 13px;
    color: #aaa;
    line-height: 1.4;
}

.file-size {
    font-size: 12px !important;
    color: #888 !important;
    margin-top: 5px !important;
}

.open-folder, .download-btn {
    padding: 8px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.open-folder {
    background-color: var(--accent-color);
    color: white;
}

.open-folder:hover {
    background-color: #6b3cea;
    transform: translateY(-1px);
}

.download-btn {
    background-color: var(--success-color);
    color: white;
}

.download-btn:hover {
    background-color: #43a047;
    transform: translateY(-1px);
}

/* Статусы и сообщения */
.storage-status {
    text-align: center;
    padding: 20px;
    color: #aaa;
}

.error-message {
    color: var(--error-color);
    background-color: rgba(255, 82, 82, 0.1);
    padding: 10px 15px;
    border-radius: 8px;
    border-left: 3px solid var(--error-color);
}

.no-items {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #777;
    font-style: italic;
}

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Футер с текстурой мятой бумаги */
footer {
    background-color: var(--header-footer-bg);
    padding: 80px 0 30px;
    position: relative;
    margin-top: 60px;
    overflow: hidden;
}

.footer-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../sources/black_paper.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.4;
    z-index: 1;
}

/* Затемнение для лучшей читаемости текста */
.footer-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        45deg,
        rgba(30, 30, 30, 0.7) 0%,
        rgba(30, 30, 30, 0.5) 50%,
        rgba(30, 30, 30, 0.7) 100%
    );
    z-index: 2;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 3;
}

.footer-logo {
    font-size: 32px;
    font-weight: bold;
    color: var(--accent-color);
    margin-bottom: 20px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.footer-small-logo {
    position: absolute;
    top: 30px;
    left: 30px;
    font-size: 18px;
    font-weight: bold;
    color: var(--accent-color);
    z-index: 3;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.5);
}

/* Социальные кнопки */
.social-buttons {
    display: flex;
    justify-content: center;
    gap: 18px;
    margin-top: 25px;
    flex-wrap: wrap;
    position: relative;
    z-index: 3;
}

.social-button {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(51, 51, 51, 0.8);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    text-decoration: none;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.social-button .social-icon {
    width: 26px;
    height: 26px;
    object-fit: contain;
    filter: brightness(0.9);
    transition: all 0.3s ease;
}

/* Общие стили при наведении для всех кнопок */
.social-button:hover {
    transform: scale(1.15) translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
    border-color: rgba(255, 255, 255, 0.3);
}

.social-button:hover .social-icon {
    filter: brightness(0) invert(1); /* Белая иконка при наведении */
    transform: scale(1.1);
}

/* Индивидуальные цвета фона при наведении */
.social-button.youtube:hover { 
    background-color: #FF0000 !important; /* YouTube красный */
}

.social-button.twitch:hover { 
    background-color: #9146FF !important; /* Twitch фиолетовый */
}

.social-button.telegram:hover { 
    background-color: #0088cc !important; /* Telegram синий */
}

.social-button.discord:hover { 
    background-color: #5865F2 !important; /* Discord синий */
}

.social-button.tiktok:hover { 
    background-color: #000000 !important; /* TikTok черный */
}

/* Анимация "пульсации" для кнопок */
.social-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.3s ease;
}

.social-button:hover::before {
    width: 100%;
    height: 100%;
    opacity: 0;
}

/* Адаптивность */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-buttons {
        width: 100%;
        justify-content: center;
    }
    
    .language-toggle {
        order: -1;
        margin-bottom: 10px;
    }
    
    .breadcrumbs {
        width: 100%;
        margin: 10px 0 0 0;
        justify-content: center;
    }
    
    .info-wrapper {
        flex-direction: column;
        text-align: center;
    }
    
    .info-image {
        width: 150px;
        height: 150px;
        margin-bottom: 20px;
    }
    
    /* Адаптация анимации для мобильных */
    .info-image:hover {
        transform: scale(1.05);
        border-width: 3px;
    }
    
    .info-text p::before {
        display: none;
    }
    
    .info-text p {
        padding-left: 0;
    }
    
    .storage-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        max-width: 100%;
    }
    
    /* Адаптивность для футера */
    footer {
        padding: 60px 0 25px;
        margin-top: 40px;
    }
    
    .footer-logo {
        font-size: 28px;
        margin-bottom: 15px;
    }
    
    .footer-small-logo {
        position: static;
        margin-bottom: 15px;
        display: block;
    }
    
    .social-buttons {
        gap: 15px;
    }
    
    .social-button {
        width: 50px;
        height: 50px;
    }
    
    .social-icon {
        width: 24px;
        height: 24px;
    }
}

@media (max-width: 480px) {
    .storage-items {
        grid-template-columns: 1fr;
    }
    
    .section-container {
        padding: 0 15px;
    }
    
    .storage-item {
        padding: 12px;
    }
    
    /* Адаптивность для футера */
    footer {
        padding: 50px 0 20px;
    }
    
    .footer-logo {
        font-size: 24px;
    }
    
    .social-buttons {
        gap: 12px;
    }
    
    .social-button {
        width: 45px;
        height: 45px;
    }
    
    .social-icon {
        width: 22px;
        height: 22px;
    }
}