:root {
    --instagram-gray: #8e8e8e;
    --instagram-black: #262626;
    --page-max-width: 600px;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #fafafa;
}

.main-header {
    position: fixed;
    width: 100%;
    height: 60px;
    background-color: black;
    top: 0;
    z-index: 99;
}

.main-header-content {
    max-width: 800px;
    height: 100%;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 15px;
}

.logo {
    height: 55px;
    width: auto;
    margin-bottom: 0rem!important;
}

.back-link {
    background-color: transparent !important;
    border: none !important;
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
}

.post-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative; /* Ajout de position relative */
    width: 100%;
}


#post_header {
    display: flex;
    align-items: center;
    padding: 14px;
    margin-top: 65px;
    padding-top: 30px; /* Ajout d'un padding en haut pour laisser de l'espace pour la flèche */
}

#post_header .logo_profile {
    margin-right: 14px;
}

#post_header .logo_profile .profile {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

#post_header .pseudo {
    flex-grow: 1;
}

#post_header .pseudo h3 {
    margin: 0;
    color: white;
    font-size: 17px;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 4px;
}

.verified-badge {
    width: 17px;
    height: 17px;
    margin-left: 2px;
}

#post_header .menu {
    cursor: pointer;
    padding: 8px;
}

.menu-dots {
    width: 24px;
    height: 24px;
    background-image: url("data:image/svg+xml,%3Csvg fill='%23FFFFFF' height='24' viewBox='0 0 24 24' width='24' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='12' cy='12' r='2'/%3E%3Ccircle cx='12' cy='4' r='2'/%3E%3Ccircle cx='12' cy='20' r='2'/%3E%3C/svg%3E");
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 100%;
    background-color: #262626;
    border-radius: 8px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    min-width: 150px;
}

.delete-option {
    display: block;
    padding: 12px 16px;
    color: #ed4956;
    text-decoration: none;
    font-size: 14px;
}

.delete-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modify-option {
    display: block;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    font-size: 14px;
}

.modify-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.menu {
    position: relative;
}

#post_content {
    width: 100%;
    background-color: black;
}

#post_content .media {
    width: 100%;
    max-height: calc(var(--page-max-width) * 1.25);
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

#post_infos {
    padding: 12px 16px;
}

.likes-container {
    display: flex;
    align-items: center;
    gap: 16px; /* Espace entre les éléments */
    margin-bottom: 8px;
}

#post_infos .likes {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Supprimez ou commentez margin-bottom: 8px; car il est maintenant sur le conteneur */
}

#post_infos .likes img {
    width: 24px;
    height: 24px;
    cursor: pointer;
}

#post_infos .likes h3 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: white;
}

#post_infos .infos {
    font-size: 14px;
    color: white;
    line-height: 1.4;
}

#post_infos .timestamp {
    margin-top: 8px;
    font-size: 12px;
    color: silver;
    text-transform: uppercase;
}

.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.popup-content {
    background-color: #1a1a1a;
    padding: 20px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    color: white;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.popup-title {
    font-size: 18px;
    font-weight: bold;
}

.popup-close {
    cursor: pointer;
}

.popup-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 15px 0;
}

.popup-label {
    font-size: 14px;
}

.flames-count {
    display: flex;
    align-items: center;
    gap: 5px;
}

.unlock-btn {
    width: 100%;
    background-color: black;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 25px;
    font-size: 16px;
    cursor: pointer;
    margin-top: 20px;
}

.unlock-btn:hover {
    opacity: 0.9;
}

.error-popup {
    text-align: center;
}

.error-popup h3 {
    margin-bottom: 15px;
}

.recharge-btn {
    background-color: #ff4444;
}


/* Modal styles */
.modal {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-dark);
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    z-index: 100;
}

.pin-option {
    display: block;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    font-size: 14px;
    background-color: transparent;
    border: none;
    cursor: pointer;
    width: 100%;
    text-align: left;
}

.pin-option:hover {
    background-color: rgba(255, 255, 255, 0.1);
}


.modal.show {
    transform: translateY(0);
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.show {
    opacity: 1;
}

.modal-content {
    padding: 1.5rem;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 101;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.modal-header h3 {
    font-size: 1.2rem;
    margin: 0;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
}

.report-button {
    width: 100%;
    background: white;
    border: none;
    padding: 15px;
    margin: 5px 0;
    text-align: left;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    cursor: pointer;
    color: black;
    font-weight: 600;
}

.report-button:hover {
    background: #f5f5f5;
}

.submit-report {
    width: 100%;
    background: black;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
}

.submit-report:hover {
    opacity: 0.9;
}

.feed-container {
    padding-top: 65px;
    width: 100%;
}

.reportText, .reportTitle {
    color: black;
}

#reportDetail,
#reportDetail h4,
#reportDetail p {
    color: black;
}


.lock-container {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px; /* Réduit l'espace entre les éléments */
    z-index: 1;
}

/* Ajuster la taille du cadenas */
.lock-container img {
    width: 40%!important; /* Réduit de 40% à 20% */
    height: 40%!important; /* Réduit de 40% à 20% */
    object-fit: contain;
    margin: 0;
}

/* Ajuster le texte */
.lock-container h4 {
    margin: 0;
    font-size: 11px;
    text-align: center;
    width: 100%;
    line-height: 1.2; /* Ajoute pour contrôler l'espacement vertical */
}

/* Ajuster le bouton */
.lock-container button {
    background-color: white;
    color: black;
    border: none;
    border-radius: 20px;
    padding: 6px 16px; /* Réduit le padding */
    font-size: 11px;
    cursor: pointer;
    width: auto;
    min-width: 80px; /* Réduit la largeur minimale */
    margin: 0;
    line-height: 1.2;
}

.post-container {
    position: relative;
}

.media-report-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    z-index: 100;
    background-color: transparent;
    border: none;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    min-width: unset;
    border-radius: 15px;
    cursor: pointer;
}

.media-viewer-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.media-viewer-content {
    max-width: 90%;
    max-height: 90vh;
    position: relative; /* Ajout de cette ligne */
}

.media-viewer-content img,
.media-viewer-content video {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    margin-top: 2rem!important;
}

.close-button {
    position: absolute;
    right: 0;
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    z-index: 1001;
}

.close-button:hover {
    opacity: 0.8;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Pour Firefox */
input[type="number"] {
    -moz-appearance: textfield;
}

.post-container {
    overflow: hidden;
}

#post_content {
    position: relative;
    transition: padding 0.3s ease;
}

#post_content.rotated {
    padding: 56.25% 0 0 0; /* Ratio 16:9 */
}

.media.video-rotated {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    transform: rotate(90deg);
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Ajuster les marges quand la vidéo est en mode rotation */
.post-container.has-rotated-video #post_infos {
    margin-top: calc(100vw - 56.25vw); /* Ajuster en fonction de la hauteur de la vidéo */
    position: relative;
    z-index: 2;
}

/* Conserver les contrôles de la vidéo accessibles */
video.media {
    z-index: 1;
    max-width: 100%;
    max-height: calc(var(--page-max-width) * 1.25);
}

/* Animation de rotation */
@keyframes videoRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(90deg); }
}

/* Style pour l'icône de rotation */
.rotation-icon {
    cursor: pointer;
    transition: transform 0.3s ease;
}

.rotation-icon.active {
    transform: rotate(90deg);
}





/* Styles pour la rotation des vidéos */
.video-container {
    position: relative;
    width: 100%;
    background: black;
}

video.media {
    width: 100%;
    max-height: calc(var(--page-max-width) * 1.25);
    display: block;
    transition: all 0.3s ease;
    transform-origin: center center;
}

/* Classe pour la vidéo en rotation */
video.media.rotated {
    max-height: none;
    height: 100vw !important;
    transform: rotate(90deg);
    transform-origin: center center;
}

/* Ajuster le conteneur quand la vidéo est en rotation */
.video-container.rotated {
    height: 100vw;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Style spécifique pour le conteneur de post avec vidéo rotée */
.post-container.has-rotated-video {
    background: black;
}

/* Style pour l'icône de rotation */
.rotation-button {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    color: white;
}