.float-join-kissan {
    position: fixed;
    top: 40%;
    right: 0;
    z-index: 12;
    width: 110px;
    height: auto;
}

.float-join-kissan img {
    border: 0;
    width: 100%;
    height: auto !important;
}

@media (max-width: 768px) {
    .float-join-kissan {
        width: 70px;
    }
}

.mosaic-section {
    background-color: #1f1f1f;
    padding: 5rem 0;
}

.mahindra-mosaic {
    position: relative;
    width: 100%;
    height: auto;
    border: #DA291C solid 1px;
    padding: 30px;
    margin-top: 40px;
}

/* Header with search and controls */
.header-mosaic {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    padding: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1;
    backdrop-filter: blur(10px);
}

/* Search box at top left */
.search-container {
    position: relative;
    width: 260px;
}

.search-input {
    width: 100%;
    padding: 5px 45px 5px 15px;
    background: #333;
    border: 1px solid #888888;
    border-radius: 6px;
    color: #fff;
    font-size: 16px;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: #ff0000;
    /* box-shadow: 0 0 10px rgba(78, 205, 196, 0.3); */
}

.search-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    display: none;
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: rgba(20, 20, 20, 0.95);
    border-radius: 10px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    margin-top: 10px;
    border: 1px solid #444;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    z-index: 101;
    backdrop-filter: blur(10px);
}

.search-result-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border-bottom: 1px solid #333;
    cursor: pointer;
    transition: background 0.2s;
}

.search-result-item:hover {
    background: rgba(78, 205, 196, 0.2);
}

.result-thumb {
    width: 40px;
    height: 53px;
    background-size: cover;
    background-position: center;
    margin-right: 12px;
    border-radius: 5px;
    flex-shrink: 0;
    background-color: #333;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-name {
    font-weight: 600;
    color: #fff;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

.result-location {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
    display: none;
}

.result-email {
    font-size: 12px;
    color: #aaa;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: left;
}

/* Controls at top right */
.controls-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 5px;
    /* background: rgba(40, 40, 40, 0.8); */
    background: #333;
    padding: 5px 5px;
    border-radius: 6px;
    border: 1px solid #888888;
    margin-left: 10px;
}

.controls-btn {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    font-size: 14px;
}

/* .zoom-btn {} */

/* .zoom-btn:hover {
    background: rgba(78, 205, 196, 0.2);
} */

.zoom-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.zoom-btn:disabled:hover {
    background: none;
}

.zoom-value {
    min-width: 50px;
    text-align: center;
    font-weight: 600;
    color: #4ecdc4;
    font-size: 14px;
    display: none;
}

.reset-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.reset-btn:disabled:hover {
    background: none;
}

/* Responsive thumbnail sizing - 1.5vw width with 3:4 aspect ratio */
.user-thumb {
    background-size: cover;
    background-position: center;
    background-color: #4b0911;
    opacity: 0.9;
    transition: all 0.3s;
    position: relative;
    cursor: pointer;
    width: 1vw;
    /* 1.5% of viewport width */
    height: calc(1vw * 4 / 3);
    /* Maintain 3:4 aspect ratio */
}

.user-thumb:hover {
    opacity: 1;
    transform: scale(1.05);
    z-index: 10;
}

.user-thumb.thumb-active {
    opacity: 1;
    box-shadow: 0 0 0 1px #FC0000, 0 0 20px rgba(252, 0, 0, 0.3);
    z-index: 20;
    transform: scale(1.1);
}

/* Popup Modal */
.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    backdrop-filter: blur(10px);

    /* opacity: 1;
    visibility: visible; */
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #2a2a2a;
    border-radius: 15px;
    width: 100%;
    height: 100%;
    /* max-width: 900px; */
    /* max-height: 90vh; */
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8);
    /* transform: translateY(30px); */
    transition: transform 0.3s;
    border: 1px solid #444;
}

.modal-overlay.active .modal-content {
    transform: translateY(0);
}

/* .modal-header {
    padding: 20px 25px;
    background: #222;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #444;
} */

/* .modal-title {
    font-size: 22px;
    color: #4ecdc4;
    display: flex;
    align-items: center;
    gap: 10px;
} */

.modal-close {
    position: absolute;
    background: none;
    border: none;
    color: #fff;
    font-size: 28px;
    line-height: 16px;
    cursor: pointer;
    transition: color 0.3s;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    right: 10px;
    top: 10px;
    background-color: #4A4A4A;
}

.modal-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    display: flex;
    padding: 0;
    /* max-height: calc(90vh - 70px); */
    /* overflow: hidden; */
    height: 100%;
    align-items: center;
    padding: 50px 50px 30px 50px;
    gap: 20px;
    flex-direction: column;

    max-height: 100%;
    overflow: auto;
}

.modal-post {
    position: relative;
    margin: 0 auto;
    width: 60%;
    display: flex;
    flex-direction: column;
}

.modal-post.postSocial {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.modal-post.postSocial .user-video {
    width: 100%;
    height: 100%;
    margin-bottom: 0px;
}

.modal-post.postSocial .user-info {
    width: 40%;
    padding-left: 20px;
}


.modal-post.postSocial .video-container iframe {
    aspect-ratio: 1 / 1;
}

@media (max-width: 768px) {
    .modal-overlay {
        position: fixed;
        max-height: 100vh;
        overflow: auto;
    }
}

.user-info {
    /* width: 35%; */
    width: 100%;
    padding: 0px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: left;
}

.user-image-large {
    width: 100%;
    max-width: 140px;
    aspect-ratio: 3/4;
    background-size: cover;
    background-position: center;
    border-radius: 10px;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.5);
    border: #fff solid 2px;
    display: none;
}

.user-details h3 {
    color: #fff;
    margin-bottom: 5px;
    font-size: 30px;
}

.user-details p {
    color: #fff;
    padding-bottom: 10px;
    font-size: 18px;
    line-height: 1.5em;
}

.user-video {
    /* width: 65%; */
    width: 100%;
    padding: 0px;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
}

.video-container {
    flex: 1;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: #fff solid 4px;
    width: 100%;
    margin: 0 auto;
}

.video-container iframe {
    width: 100%;
    height: 100%;
    border: none;
    aspect-ratio: 16 / 9;
}

.video-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #777;
    font-size: 18px;
}

.video-placeholder i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #555;
}

/* Mosaic container */
.mosaic-container {
    position: relative;
    top: 0px;
    left: 0;
    width: 100%;
    height: auto;
    overflow: hidden;
    margin-top: 30px;
}

.mosaic-viewport {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: grab;
    -webkit-mask-image: url('../../images/main-1.svg');
    mask-image: url('../../images/main-1.svg');
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: top;
    mask-position: top;
}

.mosaic-viewport.panning {
    cursor: grabbing;
}

.mosaic-grid {
    position: absolute;
    display: grid;
    grid-auto-flow: dense;
    transform-origin: 0 0;
    will-change: transform;
    transition: transform 0.3s ease-out;
}

/* Responsive design */

@media (max-width: 768px) {
    .modal-body {
        flex-direction: column;
        padding: 60px 20px 30px 20px;
        justify-content: center;
    }

    .modal-post {
        width: 100%;
    }

    .user-info,
    .user-video {
        width: 100%;
    }

    .user-details h3 {
        font-size: 20px;
    }

    .user-details p {
        font-size: 16px;
        line-height: 1.6em;
    }

    .video-container {
        width: 100%;
    }

    .modal-close {
        font-size: 16px;
        line-height: 16px;
        width: 25px;
        height: 25px;
    }

    .mahindra-mosaic {
        padding: 10px;
    }

    .mosaic-viewport {
        width: 99%;
        height: 99%;
    }

    .search-container {
        width: 100%;
        order: 1;
    }

    .controls-container {
        justify-content: space-between;
        order: 2;
    }

    /* .mosaic-container {
        top: 120px;
        height: calc(100vh - 120px);
    } */

    /* .zoom-controls {
        padding: 6px 12px;
    } */

    /* .zoom-btn {
        width: 32px;
        height: 32px;
        font-size: 16px;
    } */

    .zoom-value {
        font-size: 13px;
        min-width: 45px;
    }

    .reset-btn {
        padding: 6px 15px;
        font-size: 13px;
    }

    .user-info,
    .user-video {
        width: 100%;
    }

    .user-info {
        gap: 10px;
        /* display: none; */
    }

    .modal-post.postSocial {
        width: 100%;
        flex-direction: column;
        height: auto;
    }

    .modal-post.postSocial .user-video {
        width: 100%;
        height: auto;
        margin-bottom: 20px;
    }

    .modal-post.postSocial .user-info {
        width: 100%;
        padding-left: 0px;
    }
}

/* Mobile-specific styles for better thumbnail sizing */
/* @media (max-width: 768px) {
    .user-thumb {
        width: 3vw;
        height: calc(3vw * 4 / 3);
    }
} */

/* @media (max-width: 480px) {
    .user-thumb {
        width: 4vw;
        height: calc(4vw * 4 / 3);
    }
} */

@media (max-width: 768px) and (orientation: landscape) {
    /* .mosaic-container {
        top: 70px;
        height: calc(100vh - 70px);
    } */

    .search-container {
        width: 50%;
    }

    .controls-container {
        width: auto;
    }

    /* .user-thumb {
        width: 2vw;
        height: calc(2vw * 4 / 3);
    } */
}