/**
 * ================================================================================
 * KOMICO - Reeds Feature Styles
 * ================================================================================
 * Reeds: A reel-style interface for reading text, viewing images, and gifs
 * from verified users only
 * ================================================================================
 */

/* Reeds Fullscreen Wrapper */
div.reeds-fullscreen-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
    z-index: 9999;
    overflow: hidden;
}

/* Reeds Main Container */
div.reeds-main-container {
    width: 100%;
    height: 100vh;
    background: #000;
    position: relative;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

div.reeds-main-container div.swiper-slide {
    width: 500px;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Reeds Item - Main Content */
div.reeds-main-container div.swiper-slide div.reeds-item {
    position: relative;
    margin-top: -50px;
    width: 100%;
    height: 90%;
    background: inherit;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

/* Content Area - Text/Image/GIF Container */
div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    overflow: hidden;
    position: relative;
    z-index: 1;
}

/* Text-Only Posts */
div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.text-only {
    padding: 40px 30px;
    text-align: center;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.text-only div.reed-text {
    font-size: 24px;
    line-height: 1.6;
    color: #ffffff;
    font-weight: 500;
    word-wrap: break-word;
    word-break: normal;
    overflow-y: auto;
    max-height: 50vh;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    white-space: pre-wrap;
}

/* Image Posts */
div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.image-post img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* GIF Posts */
div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.gif-post img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Multiple Images - Show only first image with counter */
div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.multi-image {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.multi-image img {
    max-width: 100%;
    max-height: 60vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.multi-image .image-counter {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: #ffffff;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    backdrop-filter: blur(5px);
}

/* Text with Image/GIF */
div.reeds-main-container div.swiper-slide div.reeds-item div.reed-text-description {
    padding: 20px;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
    max-height: 20vh;
    margin-top: 10px;
    overflow: hidden;
    word-wrap: break-word;
    word-break: keep-all;
    overflow-wrap: break-word;
}

/* Controls Sidebar */
div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls {
    position: absolute;
    right: var(--km-primary-offset-size, 12px);
    bottom: var(--km-primary-offset-size, 12px);
    z-index: 200;
    display: flex;
    flex-direction: column;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls button {
    background: transparent;
    border: none;
    box-shadow: none;
    outline: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    display: block;
    align-items: center;
    margin-bottom: 14px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls button:last-child {
    margin-bottom: 0px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls button span.ctrls-item__icon {
    width: 30px;
    height: 30px;
    background-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 100%;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls button span.ctrls-item__icon svg {
    width: 30px;
    height: 30px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls button span.ctrls-item__icon svg path {
    fill: #ffffff;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls button span.num {
    display: block;
    text-align: center;
    color: #ffffff;
    font-size: 12px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
}

/* Author Info */
div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    z-index: 5;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    border: 2px solid #ffffff;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.post-username {
    flex: 1;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.post-username a {
    text-decoration: none;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.post-username span.user-name-holder {
    display: flex;
    align-items: center;
    margin-bottom: 2px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.post-username span.user-name-holder__name {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    margin-right: 5px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.post-username span.user-name-holder__badge svg {
    width: 18px;
    height: 18px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.post-username span.user-slug-holder {
    color: rgba(255, 255, 255, 0.8);
    font-size: 14px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__header div.post-username span.post-time {
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    display: block;
    margin-top: 2px;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__desc div.publication-text {
    color: #ffffff;
    font-size: 15px;
    line-height: 1.5;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    word-wrap: break-word;
    word-break: keep-all;
    overflow-wrap: break-word;
    max-height: 3em;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-author__desc div.publication-text:not(.publication-text_collapsed) {
    max-height: none;
}

/* Navigation Arrows - Outside container like reels */
div.reeds-arrows {
    position: fixed;
    left: 90%;
    transform: translateX(-50%);
    bottom: 30px;
    display: flex;
    gap: 20px;
    z-index: 1001;
    width: auto;
}

div.reeds-arrows div.reeds-arrow {
    width: 48px;
    height: 48px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

div.reeds-arrows div.reeds-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

div.reeds-arrows div.reeds-arrow svg {
    width: 24px;
    height: 24px;
    fill: #ffffff;
}

div.reeds-arrows div.reeds-arrow.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Go Back Header */
div.reeds-goback {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 500px;
    padding: 15px 20px;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
}

div.reeds-goback__inner {
    display: flex;
    align-items: center;
    gap: 15px;
}

div.reeds-goback__inner span.go-back {
    cursor: pointer;
    color: #ffffff;
}

div.reeds-goback__inner span.go-back svg {
    width: 28px;
    height: 28px;
    fill: #ffffff;
}

div.reeds-goback__inner span.go-back svg path {
    fill: #ffffff;
}

span.reels-text {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
}

/* Dropdown Container */
div.reeds-dropdown {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

span.reeds-icon {
    cursor: pointer;
    color: #ffffff;
}

span.reeds-icon svg {
    width: 20px;
    height: 20px;
    fill: #ffffff;
}

span.reeds-icon svg path {
    fill: #ffffff;
}

a.reeds-text {
    color: #ffffff;
    text-decoration: none;
    font-size: 16px;
    margin-left: 10px;
    transition: all 0.3s ease;
}

a.reeds-text:hover {
    color: rgba(255, 255, 255, 0.8);
}

a.reeds-text:visited {
    color: rgba(255, 255, 255, 0.8);
}

/* Icon Group (New Post & More Options) */
div.reeds-main-container div.swiper-slide div.reeds-item div.icon-group {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 15px;
    align-items: center;
    z-index: 10;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.icon-group div.more-options-icon {
    cursor: pointer;
    color: #ffffff;
    background: transparent;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

div.reeds-main-container div.swiper-slide div.reeds-item div.icon-group div.more-options-icon svg {
    width: 30px;
    height: 30px;
    margin-top: -30px;
    fill: #ffffff;
}

/* Responsive Styles */
@media (max-width: 768px) {
    div.reeds-main-container div.swiper-slide {
        width: 100%;
    }

    div.reeds-goback {
        width: 100%;
        transform: none;
        left: 0;
    }

    div.reeds-arrows {
        display: none;
    }

    div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.text-only div.reed-text {
        font-size: 20px;
    }

    div.reeds-main-container div.swiper-slide div.reeds-item div.reeds-controls {
        right: 8px;
    }
}

@media (max-width: 480px) {
    div.reeds-main-container div.swiper-slide div.reeds-item div.reed-content.text-only div.reed-text {
        font-size: 18px;
        padding: 30px 20px;
    }

    div.reeds-goback {
        padding: 12px 15px;
    }
}

/* Home Page Reeds Slider */
div.reeds-slider-cr {
    margin: 20px 0;
}

div.reeds-carousel__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 0 10px;
}

div.reeds-carousel__header h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 0;
}

div.reeds-carousel__header a {
    font-size: 14px;
    color: #1da1f2;
    text-decoration: none;
    font-weight: 600;
}

div.reeds-carousel__header a:hover {
    text-decoration: underline;
}

div.reeds-carousel__body {
    overflow: hidden;
}

div.reeds-carousel__item {
    position: relative;
    width: 100%;
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
}

div.reeds-carousel__item a {
    display: block;
    width: 100%;
    height: 100%;
}

div.reeds-carousel__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

div.reeds-carousel__item:hover img {
    transform: scale(1.05);
}

/* Text Reed Preview Styles */
div.reeds-carousel__item.text-reed {
    height: 200px;
    border-radius: 12px;
    overflow: hidden;
}

div.reeds-carousel__item div.text-reed-preview {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 20px;
    color: #ffffff;
}

div.reeds-carousel__item div.text-reed-preview div.text-reed-content {
    font-size: 14px;
    line-height: 1.5;
    font-weight: 500;
    overflow: hidden;
    text-align: center;
}

div.reeds-carousel__item div.text-reed-preview div.text-reed-author {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
}

div.reeds-carousel__item div.text-reed-preview div.text-reed-author img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    object-fit: cover;
}

div.reeds-carousel__item div.text-reed-preview div.text-reed-author span {
    font-size: 13px;
    font-weight: 600;
}

