/* ========== POST MODAL ========== */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    overflow: hidden;
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: calc(90vh / 1.1);
    margin: calc(5vh / 1.1) auto;
    background-color: white;
    border-radius: 12px;
    overflow: hidden;
    animation: modalFade 0.3s;
}

@keyframes modalFade {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    color: #666;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10;
    line-height: 1;
}

.close:hover {
    color: #333;
}

/* ========== CAROUSEL ========== */
.modal-body {
    display: grid;
    grid-template-columns: 1fr 380px;
    height: 100%;
}

.modal-carousel {
    position: relative;
    background-color: black;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-height: 500px;
}

.carousel-container {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-slide {
    display: none;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.carousel-slide.active {
    display: block;
}

.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.3);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s;
    z-index: 5;
}

.carousel-nav:hover {
    background-color: rgba(255, 255, 255, 0.5);
}

.carousel-nav.prev {
    left: 20px;
}

.carousel-nav.next {
    right: 20px;
}

.slide-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    z-index: 5;
}

/* ========== POST INFO PANEL ========== */
.modal-info {
    padding: 30px;
    overflow-y: auto;
    background-color: white;
    display: flex;
    flex-direction: column;
}

.post-header {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #efefef;
}

.post-date {
    color: #8e8e8e;
    font-size: 14px;
    margin-bottom: 15px;
}

.post-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    width: 100%;
}

.buy-btn, .copy-link-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 30px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    flex: 1;
}

.buy-btn {
    background: #0095f6;
    color: white;
}

.buy-btn:hover {
    background: #0081d6;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,149,246,0.3);
}

.copy-link-btn {
    background: #f0f0f0;
    color: #262626;
    border: 1px solid #dbdbdb;
}

.copy-link-btn:hover {
    background: #e4e4e4;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.copy-link-btn.copied {
    background: #00c851;
    color: white;
    border-color: #00c851;
}

.copy-link-btn.copied .copy-icon {
    animation: pop 0.3s ease;
}

@keyframes pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.copy-link-btn .mobile {
    display: none;
}

.copy-link-btn .desktop {
    display: inline;
}

@media (min-width: 1025px) {
    .copy-link-btn .mobile { display: none; }
    .copy-link-btn .desktop { display: inline; }
}

@media (max-width: 1024px) {
    .copy-link-btn .mobile { display: inline; }
    .copy-link-btn .desktop { display: none; }
}

.copy-link-btn.copied .desktop,
.copy-link-btn.copied .mobile {
    display: none;
}

.copy-link-btn.copied::after {
    content: "Скопировано!";
    display: inline;
}

.post-text {
    font-size: 16px;
    line-height: 1.6;
    color: #262626;
    white-space: pre-wrap;
    word-break: break-word;
    margin-bottom: 20px;
    flex: 1;
}

.post-text a {
    color: #0095f6;
    text-decoration: none;
}

.post-text a:hover {
    text-decoration: underline;
}

.post-hashtag {
    color: #0095f6;
    font-weight: 500;
}


