@import "colours.css";
@import "components/calendar.css";
@import "components/notifications.css";
@import "components/posts.css";
@import "components/gridLayout.css";

:root .btn-primary {
    --bs-btn-bg: var(--rr-primary);
    --bs-btn-hover-bg: var(--rr-primary-dark);
    --bs-btn-hover-border-color: var(--rr-primary-dark);

    border: unset;
    border-radius: 4px;
    box-shadow: inset 0 -15px 0 -10px var(--rr-primary-dark);
}

:root .btn-primary:disabled {
    background-color: #BACDB0;
}

:root .btn-secondary {
    --bs-btn-bg: var(--rr-secondary);
    --bs-btn-hover-bg: #0a1c2c;
    --bs-btn-hover-border-color: #0a1c2c;

    border: unset;
    border-radius: 4px;

    box-shadow: inset 0 -15px 0 -10px #0a1c2c;
}

:root .btn-light {
    border: unset;
    border-radius: 4px;
    box-shadow: inset 0 -15px 0 -10px var(--bs-btn-hover-bg);
    color: #353535;
}

:root .btn-danger {
    --bs-btn-bg: #FF6961;

    border: unset;
    border-radius: 4px;
    box-shadow: inset 0 -15px 0 -10px #C9544D;
}

:root .btn-calendar {
    --bs-btn-bg: #95999D;
    --bs-btn-hover-bg: #6D6B6B;
    --bs-btn-hover-border-color: var(--rr-primary);
    border: unset;
    border-radius: 4px;
    text-decoration: none;
    padding: 0 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: clip;
    width: 100%;
}

div.card:hover .renovationTitle {
    text-decoration: underline;
}

.pointer-hover:hover {
    cursor: pointer;
}

.renovationTitle {
    text-decoration: none;
    color: black;
}


div.card-hover {
    top: 0;
    transition: top ease .2s;
}

div.card-hover:hover {
    top: -5px;
}

a.card-hover {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

/* pagination */
.pagination .page-link {
    border-radius: 6px;
    background-color: #fff;
    color: #353535;

    border: 1px solid #ddd;

    margin: 0 6px;
}

.pagination .page-link:hover {
    background-color: var(--rr-primary);
    border-color: var(--rr-primary);
    color: #fff;
}

.pagination .page-item.active .page-link {
    background-color: var(--rr-primary);
    border-color: var(--rr-primary);
    color: #fff;
}

.pagination {
    flex-wrap: wrap;
}

.pagination .page-link:focus {
    box-shadow: none;
}

/* styled search button */
.input-styled {
    width: 120px;
    padding: 6px 10px;
    border: 1px solid #BACDB0;
    border-radius: 4px;
    outline: none;
    background-color: #fff;
    color: #353535;
    box-shadow: inset 0 -5px 0 -3px var(--rr-primary);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.input-styled:focus {
    border-color: var(--rr-primary);
    box-shadow: 0 0 5px rgba(var(--rr-primary), 0.5);
}

.form-inline {
    display: flex;
    gap: 8px;
    align-items: center;
}

.list-group-horizontal-sm {
    gap: 10px;
}

.list-group-horizontal-sm .list-group-item {
    border: none !important;
    border-radius: 5px !important;
    padding: 7px 10px;
    white-space: nowrap;
    background-color: var(--rr-secondary);
    color: #fff;
}

.tags-strip { gap: 10px; }

.tags-strip .list-group-item {
    border: none !important;
    border-radius: 5px !important;
    padding: 7px 10px;
    white-space: nowrap;
    background-color: var(--rr-secondary);
    color: #fff;
}


/* Copied from https://github.com/tailwindlabs/tailwindcss/discussions/4515#discussioncomment-2112460 */
.min-safe-h-screen {
    /* equivalent to 100dvh in major browsers */
    min-height: calc(
            100vh - env(safe-area-inset-bottom, 0) - env(safe-area-inset-top, 0)
    );
}

@supports (-webkit-touch-callout: none) {
    .min-safe-h-screen {
        /* for ios safari 15, safe-area-inset-bottom is 0, so a special fix apply here */
        min-height: -webkit-fill-available;
    }
}

.icon-wrapper {
    display: inline-block;  /* Shrink wraps its content */
    position: relative;     /* So that .plus-icon is positioned relative to it */
}

/* The plus sign positioned in the top right of the container */
.plus-button {
    position: absolute;
    top: -5px;    /* adjust as needed */
    right: -15px;  /* adjust as needed */
    background-color: #d3d4d5;
    opacity: 0.5;
    width: 15px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    font-size: 12px; /* Adjust the font size of the + */
    font-family: monospace;
}

.plus-button:hover {
    opacity: 1;
    background-color: #7a7a7a;
    color: white;
}
/* Search Box CSS*/
#suggestions {
    border: 1px solid #ccc;
    border-top: none;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    list-style: none;
    padding: 0;
    margin: 0;
    position: absolute;
    width: 400px;
    display: none;
    z-index: 1000;
}
#suggestions li {
    padding: 8px;
    cursor: pointer;
}
#suggestions li:hover {
    background: #f0f0f0;
}
#result {
    padding: 20px;
    width: 400px;
}

.autocomplete {
    position: relative;
}


.autocomplete-items {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 99;
    border: 1px solid #d4d4d4;
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    background-color: #fff;
}


.autocomplete-items div {
    padding: 10px;
    cursor: pointer;
}


.autocomplete-items div:hover {
    background-color: #e9e9e9;
}


.autocomplete-active {
    background-color: #e3f2fd !important;
    color: #333;
}

#viewTagsList .list-group-item {
    background-color: var(--rr-secondary);
    color: white;
    border: none !important;
    border-radius: 5px !important;
    padding: 7px 10px;
    display: inline-block;
}

#viewTagsList .list-group-item a {
    color: white !important;
    text-decoration: none !important;
}

#viewTagsList .list-group-item a:hover {
    text-decoration: underline !important;
}

/* Taken from https://www.w3schools.com/howto/howto_css_hide_arrow_number.asp to hide arrows on number inputs */
.hide-arrows::-webkit-outer-spin-button, .hide-arrows::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.hide-arrows[type=number] {
    -moz-appearance: textfield;
}

.avatar {
    width: 2.5em;
    height: 2.5em;
    min-width: 2.5em;
    min-height: 2.5em;
    object-fit: cover;
    aspect-ratio: 1;
    outline: 2px solid #ffffff;
}

.avatar:not(:first-child) {
    margin-left: -0.75em;
}

.verification-input {
    text-align: center;
    width: 60px !important;
    height: 60px !important;
}

#searchInput.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25);
}

/* Custom tooltip styling for search errors */
.search-error-tooltip .tooltip-inner {
    background-color: #dc3545;
    color: white;
    font-size: 0.875rem;
}

.search-error-tooltip .tooltip-arrow::before {
    border-bottom-color: #dc3545;
}

/* Bootstrap medium breakpoint */
@media (min-width: 768px) {
    .verification-input {
        width: 120px !important;
        height: 120px !important;
        font-size: 1.5rem !important;

    }
}

/* Reserve space for feedback icon */
#caption {
    padding-right: 2.25rem !important;
}

.no-outline {
    border: none; !important;
    outline: none; !important;
    box-shadow: none; !important;
    background-color: transparent;
}

.no-outline:focus {
    border: none; !important;
    outline: none; !important;
    box-shadow: none; !important;
    background-color: transparent;
}

.comment-form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    appearance: none;
    background-color: var(--bs-body-bg);
    resize: none;
    border: none;
    outline: none;
    box-shadow: none;
}

.comment-form-control:focus {
    border: none;
    outline: none;
    box-shadow: none;
}

.comment-container {
    padding: 10px;
    border: 1px solid;
    border-color: var(--bs-border-color-translucent);
    border-radius: 4px;
    transition: border-color 0.2s ease;
    display: flex;
    flex-wrap: wrap; /* Allow wrapping on small screens */
    gap: 8px; /* Add consistent spacing */
}

.comment-container:focus-within {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

.comment-container textarea {
    border: none;
    outline: none;
    width: 100%;
    background: transparent;
    min-width: 0; /* Allow textarea to shrink */
}

.comment-container.is-invalid {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.2rem rgba(220, 53, 69, 0.25) !important;
}

/* Make the textarea container flexible */
.comment-container .col-auto.d-flex.flex-grow-1 {
    flex: 1;
    min-width: 120px; /* Minimum width to prevent over-shrinking */
}

/* Container for character count and submit button */
.comment-container .col-auto.d-flex.align-content-center {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* Responsive behavior for very small screens */
@media (max-width: 400px) {
    .comment-container {
        flex-direction: column; /* Stack elements vertically */
        align-items: stretch;
    }

    .comment-container .col-auto.d-flex.align-content-center {
        justify-content: space-between; /* Spread character count and button */
        margin-top: 8px;
    }

    /* Ensure textarea takes full width when stacked */
    .comment-container .col-auto.d-flex.flex-grow-1 {
        width: 100%;
        min-width: unset;
    }
}

.character-count {
    background: rgba(255, 255, 255, 0.9);
    font-size: 0.875rem;
    color: #6c757d;
    pointer-events: none;
}
.submit-arrow-custom {
    color: darkgrey !important;
}

.submit-arrow-custom:hover {
    transform: scale(1.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-comment-icon:hover {
    transform: scale(1.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-caption {
    white-space: pre-line;
}

.heart-icon {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
    cursor: pointer;
    position: relative;
}

/* Hover effect - smooth scale up */
.heart-icon:hover {
    transform: scale(1.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Clicked/Liked state - smooth transition to solid */
.heart-icon.liked {
    color: #e74c3c !important; /* Red color for liked state */
    transform: scale(1.1);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); /* Bouncy effect */
}

.hashtag {
    color: #0D6EFD;
}

/* https://stackoverflow.com/questions/20300138/is-it-possible-to-add-placeholder-in-div-tag */
[contenteditable=true]:empty:not(:focus):before {
    content: attr(data-text);
}

.usersTitle {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Hover on liked heart */
.heart-icon.liked:hover {
    transform: scale(1.3);
    filter: brightness(1.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Two-line clamp for captions */
.post-caption--2line {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    word-break: break-word;
    min-height: 2.4rem;
}



/* Animation for when heart is clicked (like) */
@keyframes heartLike {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4) rotate(5deg);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Animation for when heart is unclicked (unlike) */
@keyframes heartUnlike {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.4) rotate(5deg);
    }
    100% {
        transform: scale(1.1);
    }
}

/* Classes to trigger animations */
.heart-icon.animate-like {
    animation: heartLike 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

.heart-icon.animate-unlike {
    animation: heartUnlike 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55) forwards;
}

/* Optional: Pulse effect for liked hearts */
.heart-icon.liked.pulse {
    animation: heartPulse 2s ease-in-out infinite;
}

@keyframes heartPulse {
    0%, 100% {
        transform: scale(1.1);
    }
    50% {
        transform: scale(1.2);
    }
}

/* From https://stackoverflow.com/questions/46747320/limit-the-height-in-videojs-in-fluid-mode */
.video-js.vjs-fluid,
.video-js.vjs-16-9,
.video-js.vjs-4-3,
video.video-js,
video.vjs-tech {
    max-height: calc(100vh - 64px);
    position: relative !important;
    width: 100%;
    height: auto !important;
    max-width: 100% !important;
    padding-top: 0 !important;
    line-height: 0;
}

/* Fix the control bar due to us resetting the line-height on the video-js */
.vjs-control-bar {
    line-height: 1;
}

/* Clickable follower/following count styling */
.profile-count-clickable {
    cursor: pointer;
}

.profile-count-clickable:hover {
    text-decoration: underline;
}

.notification-content {
    flex: 1 1 0;
    min-width: 0;
}

.notification-text {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-width: 0;
}


.nav-link.position-relative { position: relative; }

.notification-dot {
    position: absolute;
    top: 2px;
    right: 10px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #e3342f;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.95);
    z-index: 20;
    pointer-events: none;
}

.notification-dot-mobile {
    position: absolute;
    top: 12px;
    left: 0;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e3342f;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.95);
    z-index: 20;
    pointer-events: none;
}

.notification-dot-hamburger {
    position: absolute;
    top: 23px;
    left: 14px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #e3342f;
    box-shadow: 0 0 0 1px rgba(255,255,255,0.95);
    z-index: 20;
    pointer-events: none;
}

.alert-primary {
    --bs-alert-color: #ffffff !important;
    --bs-alert-bg: var(--rr-secondary) !important;
    --bs-alert-border-color: var(--rr-primary-dark) !important;
    --bs-alert-link-color: #ffffff !important;
}