/* ============================================
   Kolshie Custom Styles
   Consolidated from all page templates
   ============================================ */

/* ============================================
   Common Page Styles
   ============================================ */

.legal-link {
    color: #212529 !important;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color .15s ease, text-decoration-thickness .15s ease;
}

.legal-link:hover,
.legal-link:focus {
    color: #0056b3 !important;
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

/* Page Navigation */
.page-nav {
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

.page-nav .navbar-nav .nav-link {
    color: #343a40;
    font-weight: 500;
}

.page-nav .navbar-nav .nav-link:hover {
    color: #007bff;
}

/* Page Cards */
.page-card {
    border-radius: 12px;
    overflow: hidden;
    border: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    transition: box-shadow .25s ease, transform .25s ease;
}

.page-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .1);
    transform: translateY(-2px);
}

.page-card .blog-media {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.page-card .blog-media img {
    transition: transform .4s ease;
}

.page-card:hover .blog-media img {
    transform: scale(1.05);
}

.page-card img {
    transition: transform .4s ease;
}

.page-card:hover img {
    transform: scale(1.05);
}

/* Page Sidebar Cards */
.page-sidebar-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 0;
}

.page-sidebar-card .sidebar-title {
    font-weight: 600;
    font-size: .95rem;
}

.page-sidebar-card .sidebar-title:after {
    background: #343a40;
}

.page-sidebar-card img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
    background: #c2f6ea;
}

.page-sidebar-card .socials a {
    color: #343a40;
    margin: 0 .25rem;
}

/* ============================================
   Index Page Styles
   ============================================ */

.index-hero {
    background: linear-gradient(135deg, var(--primary, #c2f6ea) 0%, #e8faf7 50%, #f8f9fa 100%);
    padding: 3rem 0 3.5rem;
    text-align: center;
}

.index-hero .lead {
    font-size: 1.15rem;
    color: #495057;
    max-width: 32rem;
    margin-left: auto;
    margin-right: auto;
}

.index-hero h1 {
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #212529;
}

.index-nav {
    background: #fff;
    box-shadow: 0 1px 0 rgba(0, 0, 0, .06);
}

.index-nav .navbar-nav .nav-link {
    color: #343a40;
    font-weight: 500;
}

.index-nav .navbar-nav .nav-link:hover {
    color: #007bff;
}

.index-section {
    padding: 2.5rem 0;
}

.index-section-divider {
    border: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #dee2e6, transparent);
    margin: 0;
}

.feature-posts.index-feature-posts {
    overflow-x: auto;
    overflow-y: hidden;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
}

.feature-posts.index-feature-posts .feature-post-item {
    margin: 0 4px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    flex: 0 0 auto;
    min-width: 120px;
    max-width: 140px;
}

.feature-posts.index-feature-posts .feature-post-item:first-child {
    border-radius: 8px;
    min-width: 110px;
    max-width: 110px;
}

.index-featured-card {
    border-radius: 12px;
    overflow: hidden;
    border: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .06);
    transition: box-shadow .25s ease, transform .25s ease;
}

.index-featured-card:hover {
    box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
}

.index-featured-card .blog-media {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.index-featured-card .blog-media img {
    transition: transform .4s ease;
}

.index-featured-card:hover .blog-media img {
    transform: scale(1.03);
}

.index-room-card {
    border-radius: 12px;
    overflow: hidden;
    border: 0;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
    transition: box-shadow .25s ease, transform .25s ease;
    height: 100%;
}

.index-room-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, .1);
    transform: translateY(-4px);
}

.index-room-card .blog-media {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.index-room-card .blog-media img {
    transition: transform .4s ease;
}

.index-room-card:hover .blog-media img {
    transform: scale(1.05);
}

.index-room-card .card-title {
    font-weight: 600;
}

.index-room-card .btn {
    border-radius: 8px;
    font-weight: 500;
}

.index-sidebar-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 0;
}

.index-sidebar-card .sidebar-title {
    font-weight: 600;
    font-size: .95rem;
}

.index-sidebar-card .sidebar-title:after {
    background: #343a40;
}

.index-subscribe-wrapper {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #fff;
}

.index-subscribe-wrapper input {
    border: 0;
    padding: .6rem 1rem;
}

.index-subscribe-wrapper .btn {
    border-radius: 0;
    padding: .6rem 1rem;
}

.index-auth-form .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.index-auth-form .btn {
    border-radius: 8px;
    font-weight: 500;
}

.index-auth-link {
    color: #007bff !important;
    font-weight: 600;
    text-decoration: none;
}

.index-auth-link:hover {
    color: #0056b3 !important;
    text-decoration: underline;
}

.index-load-more {
    border-radius: 10px;
    font-weight: 500;
    padding: .65rem 1.25rem;
}

.index-badge {
    border-radius: 6px;
    font-weight: 500;
    padding: .35rem .65rem;
}

/* ============================================
   Editor Form Styles
   ============================================ */

.editor-form {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .06);
}

.editor-form .form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.editor-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, .25);
}

.editor-form label {
    font-weight: 500;
    color: #343a40;
    margin-bottom: 0.5rem;
}

.editor-form .btn-primary {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #fff;
    font-weight: 500;
    border-radius: 8px;
}

.editor-form .btn-primary:hover {
    background-color: #004085;
    border-color: #004085;
    color: #fff;
}

/* ============================================
   Story Page Styles
   ============================================ */

.part-media {
    border-radius: 8px;
    overflow: hidden;
}

.part-media img {
    transition: transform .4s ease;
}

.part-media:hover img {
    transform: scale(1.05);
}

/* ============================================
   Room Page Styles
   ============================================ */

.page-hero {
    position: relative;
    background-size: cover;
    height: 300px;
    background-attachment: fixed;
}

.page-hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .3), rgba(0, 0, 0, .1));
}

.feature-posts .feature-post-item {
    margin: 0 4px;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.feature-posts .feature-post-item:first-child {
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    aspect-ratio: 4/3;
    padding: 0 10px;
}

.sidebar-photo-clickable {
    cursor: pointer;
    transition: transform .2s ease;
}

.sidebar-photo-clickable:hover {
    transform: scale(1.05);
}

/* ============================================
   Character Page Styles
   ============================================ */

.character-card-header {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
}

.character-card {
    cursor: pointer;
}

.character-modal-images {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 12px 0;
    scroll-behavior: smooth;
}

.character-modal-images::-webkit-scrollbar {
    height: 8px;
}

.character-modal-images::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.character-modal-images::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.character-modal-images::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.character-modal-images img {
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform .2s ease, box-shadow .2s ease;
}

.character-modal-images img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
}

.character-image-clickable {
    cursor: pointer;
    transition: transform .2s ease;
}

.character-image-clickable:hover {
    transform: scale(1.05);
}

.character-modal-info {
    margin-bottom: 1.5rem;
}

.character-modal-info h5 {
    margin-bottom: 1rem;
}

.character-modal-info p {
    margin-bottom: 0.5rem;
}

/* ============================================
   Story Part Editor Styles
   ============================================ */

.character-item {
    border-bottom: 1px solid #dee2e6;
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.character-item:last-child {
    border-bottom: 0;
    margin-bottom: 0;
    padding-bottom: 0;
}

.character-item img {
    border-radius: 8px;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.hover-text {
    position: relative;
    display: block;
}

.tooltip-text {
    visibility: hidden;
    position: absolute;
    z-index: 9999;
    width: 280px;
    max-width: 90vw;
    background-color: #fff;
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .15);
    opacity: 0;
    transition: opacity .2s ease, visibility .2s ease;
    pointer-events: none;
    color: #212529;
    font-size: 14px;
    line-height: 1.5;
    left: calc(100% + 10px);
    top: 0;
}

.hover-text:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* ============================================
   Photo Page Styles
   ============================================ */

.filter-wrapper {
    display: flex;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #fff;
    margin-bottom: 1rem;
}

.filter-wrapper select {
    border: 0;
    padding: .6rem 1rem;
    flex-grow: 1;
}

.filter-wrapper .btn {
    border-radius: 0;
    padding: .6rem 1rem;
}

.photo-image-clickable {
    cursor: pointer;
    transition: transform .2s ease;
}

.photo-image-clickable:hover {
    transform: scale(1.02);
}

/* ============================================
   Video Page Styles
   ============================================ */

.video-card .blog-media {
    border-radius: 12px 12px 0 0;
    overflow: hidden;
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 aspect ratio */
    height: 0;
    background: #000;
}

.video-card .blog-media iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
    transition: transform .4s ease;
}

.video-card:hover .blog-media iframe {
    transform: scale(1.02);
}

/* ============================================
   Image Viewer Modal (Shared)
   ============================================ */

.image-viewer-modal .modal-dialog {
    max-width: 95vw;
    max-height: 95vh;
}

.image-viewer-modal .modal-content {
    background: transparent;
    border: 0;
}

.image-viewer-modal .modal-body {
    padding: 0;
    text-align: center;
}

.image-viewer-modal img {
    max-width: 100%;
    max-height: 95vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 8px;
}

.image-viewer-modal .close {
    position: absolute;
    right: 20px;
    top: 20px;
    z-index: 10000;
    color: #fff;
    opacity: 0.9;
    font-size: 2rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .5);
}

.image-viewer-modal .close:hover {
    opacity: 1;
}

/* ============================================
   Pagination Styles
   ============================================ */

.pagination .page-link {
    color: #0056b3;
    border-color: #dee2e6;
}

.pagination .page-link:hover {
    color: #004085;
    background-color: #e9ecef;
    border-color: #dee2e6;
}

.pagination .page-item.active .page-link {
    background-color: #0056b3;
    border-color: #0056b3;
    color: #fff;
}

.pagination .page-item.active .page-link:hover {
    background-color: #004085;
    border-color: #004085;
}

/* ============================================
   Dropdown Styles
   ============================================ */

.dropdown {
    position: relative;
}

.dropdown-menu {
    top: 100% !important;
    margin-top: 0.125rem !important;
    z-index: 1050 !important;
    position: absolute !important;
}

.dropdown-menu-right {
    right: 0 !important;
    left: auto !important;
}

/* Icon-only dropdown button: hide Bootstrap caret and ensure menu above card */
.page-card .dropdown .dropdown-toggle-no-caret::after {
    display: none !important;
}
.page-card .dropdown .dropdown-menu {
    z-index: 1060 !important;
}

/* Card actions dropdown (photo/video [...] menu) – JS-controlled so it works on tap and click */
.card-actions-dropdown {
    position: absolute;
}
.card-actions-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.25rem;
    min-width: 10rem;
    padding: 0.5rem 0;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.25rem;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.175);
    z-index: 1060;
    list-style: none;
    text-align: left;
}
.card-actions-dropdown.show .card-actions-menu {
    display: block;
}
.card-actions-menu .dropdown-item {
    display: block;
    width: 100%;
    padding: 0.25rem 1.5rem;
    clear: both;
    font-weight: 400;
    color: #212529;
    text-align: left;
    white-space: nowrap;
    background: 0 0;
    border: 0;
    cursor: pointer;
    text-decoration: none;
}
.card-actions-menu .dropdown-item:hover {
    color: #16181b;
    background-color: #f8f9fa;
}
.card-actions-menu .dropdown-item.text-danger:hover {
    color: #bd2130;
    background-color: #f8f9fa;
}
.card-actions-menu .form {
    padding: 0;
    margin: 0;
}
.card-actions-menu .form .dropdown-item {
    width: 100%;
    text-align: left;
}

.nav-item.dropdown {
    position: relative;
}
