﻿/* ============================================
   RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Roboto, system-ui, sans-serif;
    background-color: rgb(191, 173, 222);
    overflow-x: hidden;
    padding: 20px;
}

/* ============================================
   WRAPPER
   ============================================ */
.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding-bottom: 70px;
}

.content-wrapper {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* ============================================
   DESKTOP
   ============================================ */
.theme-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    width: 240px;
}

.theme-panel--left {
    align-items: flex-end;
    margin-right: 15px;
}

.theme-panel--right {
    align-items: flex-start;
    margin-left: 15px;
}

.theme-card {
    position: relative;
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(60, 20, 100, 0.15);
}

.theme-card img {
    width: 100%;
    display: block;
}

/* ============================================
   BUTTONS
   ============================================ */
.theme-buttons {
    position: absolute;
    bottom: 12px;
    right: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 5;
}

.theme-btn {
    padding: 6px 12px;
    background: rgba(245,245,220,0.8);
    border-radius: 20px;
    font-size: 0.76rem;
    text-decoration: none;
    color: #000;
    font-weight: bold;
    line-height: 1.15;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
}

/* ============================================
   CENTER IMAGE
   ============================================ */
.center-wrapper {
    position: relative;
    margin: 0 10px;
    flex-shrink: 0;
    z-index: 2;
}

.center-wrapper::before {
    content: "";
    position: absolute;
    inset: -8px -12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 22px;
    box-shadow: 0 6px 16px rgba(72, 37, 112, 0.06);
    backdrop-filter: blur(2px);
    z-index: -1;
}

.main-image {
    position: relative;
    width: clamp(140px, 20vw, 260px);
    display: block;
}

/* ============================================
   MOBILE GRID (РУЛЕТКА)
   ============================================ */
.mobile-themes-grid {
    display: none;
}

@media (max-width: 768px) {

    .content-wrapper {
        flex-direction: column;
    }

    .center-wrapper {
        margin: -10px 0 18px;
    }

    .center-wrapper::before {
        inset: -6px -10px;
        border-radius: 18px;
        box-shadow: 0 5px 12px rgba(72, 37, 112, 0.05);
    }

    .theme-panel {
        display: none;
    }

    .mobile-themes-grid {
        display: flex;
        flex-direction: column;

        height: 65vh;
        overflow-y: auto;

        gap: 14px;
        padding: 10px 0 138px;

        scroll-snap-type: y mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-themes-grid::-webkit-scrollbar {
        display: none;
    }

    .mobile-themes-grid .theme-card {
        flex: 0 0 auto;
        width: 92%;
        margin: 0 auto;
        scroll-snap-align: center;
    }

    .mobile-themes-grid .theme-card img {
        max-height: 220px;
        object-fit: cover;
    }
}

/* ============================================
   FOOTER
   ============================================ */
.main-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    font-size: 14px; /* или нужный вам размер */
    background: rgba(255,255,255,0.9);
    text-align: center;
    padding: 10px;
}
/* ============================================
   EXPANDED CARD MODAL
   ============================================ */
#overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#overlay.active {
    opacity: 1;
}

#expanded-card-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1001;
    pointer-events: none;
}

.expanded-card-wrapper {
    position: absolute;
    pointer-events: auto;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    cursor: pointer;
}

.expanded-card-wrapper.animating {
    opacity: 1;
}

.expanded-card-wrapper.visible {
    opacity: 1;
}

.expanded-card {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.expanded-card img {
    width: 100%;
    display: block;
}

.expanded-card .theme-buttons {
    position: absolute;
    bottom: 16px;
    right: 12px;
    gap: 8px;
}

.expanded-card .theme-btn {
    padding: 8px 16px;
    font-size: 1rem;
    background: rgba(245, 245, 220, 0.85);
}

body.modal-open {
    overflow: hidden;
}
/* ============================================
   CHAT BUTTON
   ============================================ */
.chat-button {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 999;
    
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    box-shadow: 0 4px 12px rgba(60, 20, 100, 0.15);
    
    text-decoration: none;
    font-size: 24px;
    
    transition: all 0.25s ease;
    border: 1px solid rgba(210, 180, 140, 0.3);
}

.chat-button:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: scale(1.05);
    box-shadow: 0 6px 16px rgba(60, 20, 100, 0.2);
    border-color: rgba(180, 150, 110, 0.5);
}

.chat-button:active {
    transform: scale(0.98);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .chat-button {
        bottom: 50px;
        right: 5px;
        width: 45px;
        height: 45px;
        font-size: 22px;
    }
}

/* Чтобы не перекрывало футер на мобильных */
@media (max-width: 480px) {
    .chat-button {
        bottom: 50px;
        right: 2px;
        width: 42px;
        height: 42px;
        font-size: 20px;
    }
}

/* ============================================
   ADMIN BUTTON (невидимая)
   ============================================ */
.admin-button {
    position: fixed;
    bottom: 140px;
    right: 20px;
    z-index: 999;
    
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(1px);
    border-radius: 50%;
    box-shadow: none;
    
    text-decoration: none;
    font-size: 20px;
    
    transition: all 0.3s ease;
    border: 1px solid rgba(210, 180, 140, 0.1);
    opacity: 0.3;
    color: rgba(0, 0, 0, 0.3);
}

.admin-button:hover {
    background: rgba(255, 255, 255, 0.4);
    opacity: 0.6;
    border-color: rgba(180, 150, 110, 0.2);
}

/* Адаптация для мобильных */
@media (max-width: 768px) {
    .admin-button {
        bottom: 105px;
        right: 5px;
        width: 45px;
        height: 45px;
        font-size: 18px;
        opacity: 0.25;
    }
}

@media (max-width: 480px) {
    .admin-button {
        bottom: 102px;
        right: 2px;
        width: 42px;
        height: 42px;
        font-size: 16px;
        opacity: 0.2;
    }
}

/* Полностью скрытая версия (раскомментировать для максимальной невидимости) */
/*
.admin-button {
    opacity: 0.05;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
}
.admin-button:hover {
    opacity: 0.15;
    background: rgba(255, 255, 255, 0.1);
}
*/

/* ============================================
   MOBILE LOGO SWITCH
   ============================================ */
.main-image--mobile {
    display: none;
}

@media (max-width: 768px) and (orientation: portrait) {
    .main-image--desktop {
        display: none;
    }
    
    .main-image--mobile {
        display: block;
	width: clamp(180px, 50vw, 230px) !important;
    }
}

/* ============================================
   QUICK ACTIONS
   ============================================ */
.quick-actions {
    position: fixed;
    left: 50%;
    bottom: 82px;
    z-index: 990;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
    width: min(86vw, 470px);
    pointer-events: none;
}

.quick-action {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: 700;
    font-size: 16px;
    letter-spacing: 0;
    color: #fff;
    background: linear-gradient(180deg, #3f9f82 0%, #2f7d68 100%);
    box-shadow: 0 8px 18px rgba(36, 49, 47, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.28);
    pointer-events: auto;
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.quick-action:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 20px rgba(36, 49, 47, 0.2);
    filter: brightness(1.04);
}

.quick-action--chat {
    background: linear-gradient(180deg, #6f63d4 0%, #5a4eb5 100%);
}

@media (max-width: 768px) {
    body { padding: 12px; }
    .quick-actions {
        bottom: 52px;
        flex-direction: column;
        align-items: stretch;
        width: min(78vw, 300px);
    }

    .quick-action {
        width: 100%;
        min-height: 42px;
        font-size: 16px;
    }

    .main-footer {
        font-size: 12px;
        line-height: 1.35;
    }
}
