/* core/static/css/custom.css */

/* ========== Global Layout ========== */
body {
    padding-top: 70px; /* Adjust based on navbar height */
}

/* ========== Cards ========== */
.card img {
    height: 200px;
    object-fit: cover;
}

.card-title a {
    color: #000;
}
.card-title a:hover {
    text-decoration: underline;
}

/* ========== Navbar ========== */
.navbar-nav .nav-link img {
    object-fit: cover;
}

/* ========== Media/Comments ========== */
.media {
    border-left: 2px solid #ddd;
    padding-left: 15px;
    margin-bottom: 10px;
}

/* Comment images */
.comment-profile-pic {
    width: 30px;
    height: 30px;
    object-fit: cover; /* Ensures the image covers the area without distortion */
}

/* ========== Profile Pics ========== */
.img-small {
    width: 30px;
    height: 30px;
    object-fit: cover;
    border: 2px solid #fff; /* Optional: Adds a white border around the image */
    box-shadow: 0 0 5px rgba(0,0,0,0.1); /* Optional: Adds a subtle shadow */
}

.profile-pic {
    max-width: 100%; /* Ensures the image doesn't overflow its container */
    width: 40px; /* Default size */
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
}

@media (min-width: 768px) {
    .profile-pic {
        width: 100px; /* Larger size for bigger screens */
        height: 100px;
    }
}

/* ========== Heart / Reaction Counts ========== */
.heart-count {
    transition: color 0.3s ease, transform 0.2s ease, background-color 0.3s ease;
    color: #333; /* Adjust color to match your design */
    font-weight: normal; /* Ensure it's not bold */
}

.heart-count.updated {
    background-color: #ffe0b2 !important; /* Light orange highlight */
    padding: 2px 5px;
    border-radius: 3px;
}

/* ========== Bootstrap Icons / Heart Icons ========== */
.bi {
    margin-right: 5px;          /* Space between icon and count */
    font-size: 1.2rem;          /* Adjust icon size */
    vertical-align: middle;     /* Align icon vertically with text */
}

.bi-heart, .bi-heart-fill {
    cursor: pointer;             /* Indicate clickable */
    transition: color 0.3s ease; /* Smooth color transition */
}

.bi-heart-fill {
    color: #dc3545;              /* Red color for hearted */
}

.heart-count {
    margin-left: 2px;           /* Space between label and count */
}

.heart-button:hover i {
    color: #c82333;             /* Darker red on hover */
}

.heart-button:hover {
    opacity: 0.8;               /* Slight transparency on hover */
}

/* "spinning" or "active" heart states */
.heart-icon {
    cursor: pointer;
    transition: color 0.3s;
}
.heart-icon.active {
    color: red;
}
.heart-icon.spinning {
    animation: spin 1s infinite;
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ========== Comments Section ========== */
.comments-section {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 5px;
}

.list-group-item {
    border: none;
    border-bottom: 1px solid #dee2e6;
}
.list-group-item:last-child {
    border-bottom: none;
}

/* ========== Modal Responsiveness ========== */
@media (max-width: 576px) {
    .modal-dialog {
        max-width: 90%;
    }
}

/* ========== Floating Back Button ========== */
.floating-back-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    padding: 10px 15px;
    border-radius: 50px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* ========== File Previews (Images / Videos) ========== */
#images-preview-container img {
    max-width: 200px;
    margin-right: 10px;
    margin-bottom: 10px;
}

#video-preview {
    max-width: 100%;
    height: auto;
}

/* ========== Aspect-Ratio Classes ========== */
/*
   If you're not using Bootstrap 5's built-in "ratio ratio-16x9",
   this custom approach simulates a 16:9 container.
   Make sure to nest your actual content inside.
*/
.aspect-ratio {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16/9 ratio */
}

.aspect-ratio-16x9 {
    /* By itself, this can be redundant if you're already using .aspect-ratio.
       If you want to use BOTH classes together in HTML like:
         <div class="aspect-ratio aspect-ratio-16x9">
       that's fine, but keep in mind .aspect-ratio is already 16:9.
       You can also just use .aspect-ratio alone.
    */
    /* padding-bottom: 56.25%; // removed duplication if using above .aspect-ratio */
}

/* Force absolutely-positioned children to fill .aspect-ratio container */
.aspect-ratio > .carousel-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ========== Video Wrapper ========== */
.video-wrapper img,
.video-wrapper video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.play-video-btn {
    cursor: pointer;
}


/* static/css/custom.css */
.navbar .nav-link .nav-icon {
  width: 40px !important;
  height: auto !important;
  max-height: 50px !important; /* adjust as needed */
  object-fit: contain;
}


.navbar {
  position: relative;
  z-index: 9999; /* High z-index to keep navbar on top - was 9999 */
}

.navbar .dropdown-menu {
  z-index: 10000; /* Ensure dropdown menu appears above other elements - was 10000 */
  position: absolute; /* Make sure dropdown is taken out of normal flow */
}


/* In static/css/custom.css */

@media (min-width: 768px) { 
  /* Apply custom width starting at the medium breakpoint or adjust as needed */
  .col-fifth {
    flex: 0 0 20%;
    max-width: 20%;
  }
}

.content-item {
  position: relative;
}

.my-reaction-wrapper {
  position: relative;
  z-index: 10; /* or a higher number than .reaction-counts */
}
.btn-smiley-react {
  position: relative;
  z-index: 20; /* ensures the button is above .reaction-counts */
}
.reaction-counts {
  position: absolute;
  bottom: 0;
  left: 0;
  z-index: 1; /* or some lower number */
  background-color: rgba(0,0,0,0.5);
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 0.9em;
}

.reaction-menu {
    display: block !important; /* override display: flex is okay too */
    opacity: 1 !important;
    visibility: visible !important;
    position: relative !important;
    background-color: magenta !important;
    color: black !important;
    height: auto !important;
    z-index: 9999 !important;
}

/* Force every <img> inside a .card to be exactly 120px tall and crop via object-fit:cover */
.card .card-img-top {
  height: 120px !important;
  object-fit: cover !important;
}

html, body {
  /* existing props… */
  touch-action: pan-y;
}
