/* ============================================= */
/*                    ПОДВАЛ                     */
/* ============================================= */
.site-footer {
    background-color: var(--light-gray);
    color: var(--text-secondary);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
    padding: 3rem 0 1.5rem 0;
    font-family: 'Nunito', sans-serif;
    transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

[data-theme="dark"] .site-footer {
    background-color: var(--bg-secondary);
    box-shadow: inset 0 2px 8px rgba(0,0,0,0.1);
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
    align-items: start;
}

/* Логотип - левая часть */
.logo-column {
    flex: 0 1 280px;
    min-width: 250px;
}

/* Группа ссылок - центральная часть */
.footer-links-group {
    display: flex;
    gap: 3rem;
    flex: 0 1 auto;
    margin: 0 auto;
}

/* Колонки внутри группы ссылок */
.footer-links-group .footer-column {
    flex: 0 0 auto;
}

/* Колонка поддержки - правая часть */
.support-column {
    flex: 0 0 180px;
    text-align: right;
    min-width: 150px;
}

.footer-column {
    min-height: 40px;
}

.footer-column h4 {
    display: inline-block;
    position: relative;
    font-size: 1.1rem;
    color: var(--primary);
    margin-bottom: 0.8rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.footer-column h4::after {
    content: '';
    display: block;
    width: 100%;
    height: 2px;
    background: var(--primary);
    margin-top: 4px;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.footer-column a,
.footer-link-button {
    font-size: 0.95rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-link-button {
    padding: 0;
    border: 0;
    background: transparent;
    font-family: inherit;
    line-height: inherit;
    cursor: pointer;
}

.footer-column a:hover,
.footer-link-button:hover {
    color: var(--primary);
}

.footer-column ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-column li {
    margin-bottom: 8px;
}

.authenticated-footer {
    display: grid;
    grid-template-columns: minmax(220px, 1.35fr) repeat(5, minmax(0, 1fr));
    gap: 0;
    max-width: 1440px;
}

.authenticated-logo-column {
    min-width: 0;
    padding-right: 2rem;
}

.authenticated-footer-column {
    min-width: 0;
    padding: 0 2rem;
    text-align: left;
}

.authenticated-footer-column:first-child {
    padding-left: 0;
}

.authenticated-footer-column:last-child {
    padding-right: 0;
}

.platforms-column a {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
}

.platforms-column i {
    width: 1.1rem;
    color: var(--text-secondary);
    text-align: center;
}

.footer-support-text {
    max-width: 220px;
    margin: 0 0 1rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}

.authenticated-support-column .support-links {
    justify-content: flex-start;
}

.footer-logo img {
    height: 42px;
    margin-bottom: 0.75rem;
    transition: filter 0.3s ease;
}

[data-theme="dark"] .footer-logo img {
    filter:
        brightness(0)
        invert(0.7)
        sepia(0.3)
        hue-rotate(200deg)
        saturate(1.8)
        brightness(0.85);
}

.footer-description {
    font-size: 0.95rem;
    color: var(--text-secondary);
    transition: color 0.3s ease;
    max-width: 250px;
}

.support-links {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 0;
    border: none;
    list-style: none;
}

.support-links li {
    margin: 0;
}

.support-btn {
    width: 42px;
    height: 42px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    background-color: transparent;
    border: 1.5px solid var(--medium-gray);
    color: var(--text-secondary);
    transition: all 0.3s ease;
}

.support-btn:hover {
    border-color: var(--secondary);
    background-color: rgba(90, 114, 233, 0.06);
    box-shadow: 0 0 6px rgba(90, 114, 233, 0.1);
    transform: translateY(-2px);
}

[data-theme="dark"] .support-btn:hover {
    background-color: rgba(90, 114, 233, 0.1);
    box-shadow: 0 0 8px rgba(90, 114, 233, 0.2);
}

.support-btn i {
    color: var(--text-secondary);
    transition: color 0.3s ease;
}

.support-btn:hover i {
    color: var(--secondary);
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid var(--medium-gray);
    margin-top: 2rem;
    padding-top: 1rem;
    transition: border-color 0.3s ease;
}

.footer-bottom p {
    font-size: 0.85rem;
    color: var(--dark-gray);
    transition: color 0.3s ease;
}

/* =========================== */
/*       АДАПТИВНОСТЬ          */
/* =========================== */
/* Для широких экранов (1201px - 1400px) */
@media (min-width: 1201px) {
    .authenticated-footer-column {
        border-left: 1px solid var(--medium-gray);
    }
}

@media (max-width: 1400px) and (min-width: 1201px) {
    .footer-links-group {
        gap: 3.5rem;
        margin: 0 3rem;
    }
}

/* Для стандартных десктопов (1025px - 1200px) */
@media (max-width: 1200px) and (min-width: 1025px) {
    .footer-container {
        justify-content: space-around;
        gap: 1.5rem;
    }

    .logo-column {
        flex: 0 1 240px;
    }

    .footer-links-group {
        gap: 2.5rem;
        margin: 0 1rem;
    }

    .support-column {
        flex: 0 0 160px;
    }

    .authenticated-footer {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 2.5rem;
        max-width: 1000px;
    }

    .authenticated-logo-column {
        padding-right: 0;
    }

    .authenticated-footer-column {
        padding: 0;
    }
}


/* Для мобильных устройств и планшетов (до 640px) */
@media (max-width: 1024px) {
    .site-footer {
        padding: 2.5rem 0 1.5rem 0;
    }

    .footer-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2.5rem;
        padding: 0 16px;
        justify-content: normal;
    }

    .authenticated-footer {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
        max-width: 640px;
        text-align: left;
    }

    .authenticated-footer-column {
        padding: 0;
    }

    .logo-column,
    .footer-links-group,
    .support-column {
        width: 100%;
        max-width: 320px;
        flex: 0 0 auto;
        min-width: auto;
    }

    .footer-links-group {
        display: flex;
        flex-direction: column;
        gap: 1.8rem;
    }

    .footer-logo img {
        height: 40px;
        margin: 0 auto 0.8rem auto;
    }

    .footer-description {
        margin: 0 auto;
        font-size: 0.9rem;
        max-width: 280px;
    }

    .footer-column h4 {
        margin-bottom: 1rem;
        font-size: 1.05rem;
    }

    .footer-column ul li {
        margin-bottom: 0.6rem;
    }

    .footer-column a,
    .footer-link-button {
        font-size: 0.9rem;
    }

    .support-column {
        text-align: center;
        margin-top: 0.5rem;
    }

    .support-links {
        justify-content: center;
        gap: 16px;
    }

    .authenticated-support-column .support-links {
        justify-content: flex-start;
    }

    .support-btn {
        width: 44px;
        height: 44px;
        font-size: 1.3rem;
    }

    .footer-bottom {
        margin-top: 2.5rem;
        padding-top: 1.2rem;
    }

    .footer-bottom p {
        font-size: 0.8rem;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .site-footer {
        padding: 1.85rem 0 1rem;
    }

    .footer-container:not(.authenticated-footer) {
        display: grid;
        grid-template-columns: minmax(210px, 0.95fr) minmax(260px, 1.1fr) minmax(150px, 0.65fr);
        align-items: start;
        gap: 1.25rem;
        max-width: 920px;
        text-align: left;
    }

    .authenticated-footer {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.35rem 2rem;
        max-width: 920px;
        text-align: left;
    }

    .logo-column,
    .footer-links-group,
    .support-column {
        max-width: none;
    }

    .footer-links-group {
        flex-direction: row;
        gap: 1.5rem;
        margin: 0;
    }

    .footer-logo img {
        height: 36px;
        margin: 0 0 0.45rem;
    }

    .footer-description {
        margin: 0;
        max-width: 230px;
    }

    .footer-column h4 {
        margin-bottom: 0.55rem;
        font-size: 0.98rem;
    }

    .footer-column ul li {
        margin-bottom: 0.4rem;
    }

    .footer-column a,
    .footer-link-button {
        font-size: 0.86rem;
        line-height: 1.3;
    }

    .support-column {
        margin-top: 0;
        text-align: left;
    }

    .support-links,
    .authenticated-support-column .support-links {
        justify-content: flex-start;
        gap: 8px;
    }

    .support-btn {
        width: 38px;
        height: 38px;
        border-radius: 9px;
        font-size: 1.05rem;
    }

    .footer-bottom {
        margin-top: 1.35rem;
        padding-top: 0.8rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .site-footer {
        padding: 1.6rem 0 0.95rem;
    }

    .footer-container:not(.authenticated-footer) {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
        gap: 1.15rem 1.5rem;
        max-width: 680px;
        text-align: left;
    }

    .authenticated-footer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 1.15rem 1.5rem;
        max-width: 680px;
        text-align: left;
    }

    .footer-container:not(.authenticated-footer) .support-column {
        grid-column: 1 / -1;
    }

    .logo-column,
    .footer-links-group,
    .support-column {
        max-width: none;
    }

    .footer-links-group {
        flex-direction: row;
        gap: 1.25rem;
        margin: 0;
    }

    .footer-logo img {
        height: 34px;
        margin: 0 0 0.4rem;
    }

    .footer-description {
        margin: 0;
        max-width: 240px;
        font-size: 0.84rem;
    }

    .footer-column h4 {
        margin-bottom: 0.5rem;
        font-size: 0.95rem;
    }

    .footer-column ul li {
        margin-bottom: 0.35rem;
    }

    .footer-column a,
    .footer-link-button {
        font-size: 0.84rem;
        line-height: 1.28;
    }

    .support-column {
        margin-top: 0;
        text-align: left;
    }

    .support-links,
    .authenticated-support-column .support-links {
        justify-content: flex-start;
        gap: 8px;
    }

    .support-btn {
        width: 36px;
        height: 36px;
        border-radius: 9px;
        font-size: 1rem;
    }

    .footer-bottom {
        margin-top: 1.15rem;
        padding-top: 0.75rem;
    }
}

/* Compact mobile footer */
@media (max-width: 640px) {
    .site-footer {
        padding: 1.35rem 0 0.85rem;
    }

    .footer-container {
        gap: 1.25rem;
        padding: 0 12px;
    }

    .authenticated-footer {
        grid-template-columns: 1fr;
        gap: 1.15rem;
        max-width: 360px;
        text-align: center;
    }

    .authenticated-footer-column,
    .support-column {
        text-align: center;
    }

    .logo-column,
    .footer-links-group,
    .support-column {
        max-width: 360px;
    }

    .footer-links-group {
        gap: 1rem;
    }

    .footer-logo img {
        height: 34px;
        margin-bottom: 0.35rem;
    }

    .footer-description {
        font-size: 0.82rem;
        line-height: 1.35;
    }

    .footer-column h4 {
        margin-bottom: 0.45rem;
        font-size: 0.95rem;
    }

    .footer-column h4::after {
        margin-top: 2px;
    }

    .footer-column ul li {
        margin-bottom: 0.35rem;
    }

    .footer-column a,
    .footer-link-button {
        font-size: 0.84rem;
        line-height: 1.25;
    }

    .footer-support-text {
        margin: 0 auto 0.55rem;
        font-size: 0.8rem;
        line-height: 1.35;
        max-width: 280px;
    }

    .support-column {
        margin-top: 0;
    }

    .support-links,
    .authenticated-support-column .support-links {
        display: grid;
        grid-template-columns: repeat(4, 38px);
        justify-content: center;
        gap: 8px;
        width: 100%;
    }

    .support-btn {
        width: 38px;
        height: 38px;
        border-radius: 9px;
        font-size: 1.05rem;
    }

    .footer-bottom {
        margin-top: 1.25rem;
        padding-top: 0.7rem;
    }

    .footer-bottom p {
        font-size: 0.76rem;
    }
}

@media (max-width: 400px) {
    .footer-container {
        gap: 1rem;
        padding: 0 10px;
    }

    .footer-links-group {
        gap: 0.85rem;
    }

    .authenticated-footer {
        grid-template-columns: 1fr;
        max-width: 320px;
        text-align: center;
    }

    .authenticated-footer-column {
        text-align: center;
    }

    .footer-support-text {
        margin-right: auto;
        margin-left: auto;
    }

    .authenticated-support-column .support-links {
        justify-content: center;
    }

    .footer-logo img {
        height: 32px;
    }

    .support-links,
    .authenticated-support-column .support-links {
        grid-template-columns: repeat(4, 34px);
        gap: 7px;
    }

    .support-btn {
        width: 34px;
        height: 34px;
        border-radius: 8px;
        font-size: 0.98rem;
    }

    .footer-bottom {
        margin-top: 1rem;
    }
}

/* Улучшенные transition для плавности */
.site-footer * {
    transition: color 0.3s ease, background-color 0.3s ease, border-color 0.3s ease,
                box-shadow 0.3s ease, transform 0.3s ease, filter 0.3s ease;
}
