/*
    Arrow box for dark and light theme, e.g. displayed in card elements
*/
.arrow_box {
    position: relative;
    border: 1px solid #D2D2D2;
}

html.dark-mode .arrow_box {
    border-color: #2B273D;
}

.arrow_box:after,
.arrow_box:before {
    top: 100%;
    left: 50%;
    border: solid transparent;
    content: "";
    height: 0;
    width: 0;
    position: absolute;
    pointer-events: none;
}

.arrow_box:after {
    border-color: rgba(0, 0, 0, 0);
    border-top-color: #fff;
    border-width: 15px;
    margin-left: -15px;
}

html.dark-mode .arrow_box:after {
    border-top-color: #2B273D;
}

.arrow_box:before {
    border-color: rgba(0, 0, 0, 0);
    border-top-color: #D2D2D2;
    border-width: 21px;
    margin-left: -21px;
}

html.dark-mode .arrow_box:before {
    border-top-color: #2B273D;
}

a {
    color: #0C6EFD !important;
}

a:hover {
    color: #c9d1d9;
}

/*
    General Body, font-family, background-color, color
 */
body {
    background: #e5eff7;
    color: #0d1117;
    transition: background-color 0.3s, color 0.3s;
    font-family: 'Roboto Mono', monospace;
}

html.dark-mode body {
    background-color: #1C1C2D;
    color: #c9d1d9;
}

.box-bg {
    background: #191827;
    color: #c9d1d9;
}

@media (max-width: 768px) {
    body {
        font-size: 12px;
    }

    .card-title {
        font-size: 16px !important;
    }

    #navigation {
        display: none;
    }

    #social {
        display: none;
    }
}

@media (max-width: 576px) {
    .col-4.d-flex {
        justify-content: center !important;
    }
}

.btn-wikpy {
    background: #2B273D;
    border: 1px solid #212529;
    border-radius: 5px;
    color: #c9d1d9;
    font-size: 16px;
    opacity: 0.9;
}

.btn-wikpy:hover {
    background: #2B273D;
    border: 1px solid #212529;
    border-radius: 5px;
    color: #ffffff;
    cursor: pointer;
    opacity: 1;
}

.category-bg {
    background: #FFFFFF;
    transition: background-color 0.3s, color 0.3s;
}

html.dark-mode .category-bg {
    background: #1C1C2D;
}

/*
    General design for card elements for dark and light theme
 */
html.dark-mode .card {
    background-color: #2B273D;
}

html.dark-mode .card-header {
    background-color: #2B273D;
}

html.dark-mode .card-title,
html.dark-mode .card-body {
    color: #c9d1d9;
}

/*
    Dark mode toggle switch
 */
.switch {
    position: relative;
    display: inline-block;
    width: 40px;
    height: 20px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 20px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: #0c6efd;
}

input:checked+.slider:before {
    transform: translateX(20px);
}

/*
    Sticky sidebar
*/
html.dark-mode .sticky-sidebar .list-group-item {
    background-color: #2B273D;
    color: #c9d1d9;
}

html.dark-mode .sticky-sidebar .fw-bolder {
    color: #c9d1d9;
}

html.dark-mode .sticky-sidebar .badge {
    background-color: #1f6feb !important;
    color: #ffffff;
}

@media (max-width: 768px) {
    .sticky-sidebar {
        position: static;
    }
}

/* New styles for scrollbar */
.sticky-sidebar::-webkit-scrollbar {
    width: 6px;
}

.sticky-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.sticky-sidebar::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* For Firefox */
.sticky-sidebar {
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}

/* Dark mode scrollbar */
html.dark-mode .sticky-sidebar::-webkit-scrollbar-track {
    background: #1c2128;
}

html.dark-mode .sticky-sidebar::-webkit-scrollbar-thumb {
    background: #30363d;
}

html.dark-mode .sticky-sidebar::-webkit-scrollbar-thumb:hover {
    background: #4a5460;
}

html.dark-mode .sticky-sidebar {
    scrollbar-color: #30363d #1c2128;
}

@media (min-width: 768px) {
    .sticky-sidebar {
        position: sticky;
        top: 20px;
        /* Adjust this value based on your header height */
        max-height: calc(100vh - 60px);
        overflow-y: auto;
        scroll-behavior: smooth;
    }
}

/*
    Social Icons
 */
.social-icon {
    fill: #ffffff !important;
    transition: fill 0.3s ease;
}

.social-icon path {
    fill: #ffffff !important;
}

html.dark-mode .social-icon {
    fill: #c9d1d9 !important;
}

html.dark-mode .social-icon path {
    fill: #c9d1d9 !important;
}

/*
    Tweet category / topic filter
 */
.list-group-item.active {
    background-color: #007bff;
    color: white;
}

html.dark-mode .list-group-item.active {
    background-color: #1f6feb;
    color: #c9d1d9;
}

.list-group-item.active .badge {
    background-color: white !important;
    color: #007bff !important;
}

html.dark-mode .list-group-item.active .badge {
    background-color: #c9d1d9 !important;
    color: #1f6feb !important;
}

@media (max-width: 768px) {
    .list-group-item {
        padding: 10px 15px;
    }
}

.clickable-box {
    cursor: pointer;
    opacity: 0.9;
}

.image-container {
    overflow: hidden;
    width: 100%;
}

.zoom-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.clickable-box:hover .zoom-image {
    transform: scale(1.03);
    opacity: 1;
}

.content {
    transition: opacity 0.3s ease;
}

.clickable-box:hover .content {
    opacity: 0.8;
}

.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background-color: #2B273D;
    color: #fff;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: none;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: 1px solid #212529;
    z-index: 1000;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.scroll-to-top:hover {
    opacity: 1;
}

/* Profile Header Styles */
.profile-header-bg {
    background-image: url('../images/profile_header_data_mountain.webp');
    background-size: cover;
    background-position: center;
    height: 200px;
    width: 100%;
    border-top-left-radius: 5px;
    border-top-right-radius: 5px;
}

.profile-avatar-container {
    position: relative;
    margin-top: -65px;
    margin-left: 20px;
    width: 130px;
    height: 130px;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 15px;
    /* Rounded square as per example */
    border: 4px solid #15202b;
    /* Dark border to match background */
    background-color: #15202b;
    object-fit: cover;
}

.profile-info {
    margin-top: 10px;
    padding-left: 15px;
    padding-right: 15px;
}

.profile-name {
    font-weight: 800;
    font-size: 24px;
    color: #c9d1d9;
    line-height: 1.2;
}

.profile-handle {
    color: #6e767d;
    font-size: 15px;
    margin-bottom: 10px;
}

.profile-bio {
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 15px;
}

.profile-meta {
    color: #6e767d;
    font-size: 14px;
    margin-bottom: 15px;
}

.profile-stats {
    display: flex;
    gap: 20px;
    color: #ffffff;
    font-size: 14px;
}

.profile-stat-count {
    font-weight: 700;
    color: #ffffff;
}

.profile-stat-label {
    color: #6e767d;
}

.edit-profile-btn {
    background-color: transparent;
    border: 1px solid #6e767d;
    color: #ffffff;
    font-weight: 700;
    border-radius: 20px;
    padding: 5px 15px;
    transition: background-color 0.2s;
}

.edit-profile-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

html.dark-mode .scroll-to-top {
    background-color: #1f6feb;
    color: #ffffff;
}

/* Tweet Hub Layout Styles */
.tweet-profile-pic {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 50%;
    background-color: #191827;
}

.social-profile-pic {
    background-color: #1C1C2D;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    object-fit: cover;
}

.tweet-header-info {
    display: flex;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.tweet-meta {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.tweet-username {
    font-weight: 800;
    margin-right: 10px;
    color: #0d1117;
}

html.dark-mode .tweet-username {
    color: #c9d1d9;
}

.tweet-date {
    color: #6c757d;
    font-size: 0.9em;
}

html.dark-mode .tweet-date {
    color: #8b949e;
}

.tweet-category-badge {
    margin-left: auto;
}

.tweet-category-pill {
    background-color: #1C1C2D;
    border: 1px solid #212529;
    border-radius: 10px;
    color: #c9d1d9;
    padding: 0.25rem;
}

@media (max-width: 576px) {
    .tweet-header-info {
        align-items: flex-start;
    }

    .tweet-meta {
        flex-wrap: wrap;
    }

    .tweet-category-badge {
        margin-left: auto;
    }
}

.tweet-hover {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.tweet-hover:hover {
    transform: scale(1.01);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15) !important;
}

.category-hover {
    transition: background-color 0.2s ease, transform 0.2s ease;
    cursor: pointer;
}

.category-hover:hover {
    transform: scale(1.02);
    background-color: #f8f9fa;
}

html.dark-mode .category-hover:hover {
    background-color: #30363d;
}

/* Logo hover effect */
.logo-hover {
    transition: transform 0.3s ease;
    transform-origin: center center;
}

.logo-hover:hover {
    transform: scale(1.05);
}