/* CSS to handle the shared header & footer elements */
/* Ensure content doesn't hit the screen edges on tiny mobile devices */
.container {
    padding-right: 15px;
    padding-left: 15px;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #ffffff;
    font-family: 'Arial', 'Helvetica Neue', Helvetica, sans-serif;
	color: #777;
}

main {
    flex: 1 0 auto;
}

/* Connect Dropdown Styling */
.dropdown-item i {
    margin-right: 8px;
    color: #555;
}

.dropdown-menu {
    border-radius: 8px;
    border: 1px solid rgba(0,0,0,0.1);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    padding: 10px 0;
}

h3 {
	font-size: 30px;
    color: #777;
}

.page-navbar, footer.bg-light {
	background-color: #68b4ff !important;
}

.page-navbar .navbar-brand {
	color: #ffffff;
    font-size: 30px;
}
.page-navbar .navbar-toggle .icon-bar {
    background-color: #fff;
}
.page-navbar .navbar-toggle:focus, .page-navbar .navbar-toggle:hover {
    background-color: #68b5ff;
}

.navbar-settings {
    margin: 0;
}
.navbar .nav>li>a {
  font-size: 16px;
 }
 .page-navbar .navbar-nav>li>a {
    color: #ffffff;
}
.navbar {
    border-radius: 0px;
}
.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #337ab7;
}
a {
	color: #777777;
	text-decoration: none;
}
a:hover {
	text-decoration: underline;
}
footer {
	background-color: #68b4ff !important;
}
.footer-content {
	color: #ffffff !important;
	text-align: center;
}

/* --- Page: About Me --- */

.page-about .panel {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.page-about .about-grid {
    display: grid;
    grid-template-columns: 1fr; /* Stacked on mobile */
    gap: 30px;
    align-items: start;
}

/* Tablet and Desktop: Side-by-side */
@media (min-width: 768px) {
    .page-about .about-grid {
        grid-template-columns: 35% 1fr; /* Image takes 35%, text takes the rest */
    }
}

.page-about .profile-img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #eee;
}

.page-about .profile-caption {
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin-top: 8px;
    text-align: center;
}

.page-about .about-content {
    line-height: 1.7;
    font-size: 1.05rem;
    color: #333;
}

.page-about .section-divider {
    border: 0;
    height: 1px;
    background-image: linear-gradient(to right, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0));
    margin: 40px 0;
}

/* --- Page: Portfolio --- */

/* Thumbnail Grid */
.page-portfolio .project-nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
}

.page-portfolio .qap-item {
    cursor: pointer;
    text-align: center;
    transition: transform 0.2s ease;
}

.page-portfolio .qap-item:hover {
    transform: translateY(-5px);
}

.page-portfolio .qap-img-wrapper {
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 12px;
    border: 3px solid transparent;
    transition: border-color 0.2s;
    background: #eee;
}

.page-portfolio .qap-item:hover .qap-img-wrapper {
    border-color: #0d6efd;
}

.page-portfolio .qap-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.page-portfolio .qap-label {
    font-size: 0.8rem;
    margin-top: 8px;
    font-weight: 600;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Detail Card */
.page-portfolio .portfolio-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow: hidden;
    border: 1px solid rgba(0,0,0,0.05);
}

.page-portfolio .detail-img {
    width: 100%;
    height: 100%;
    min-height: 300px;
    object-fit: cover;
}

.page-portfolio .project-title {
    font-weight: 800;
    color: #222;
}

/* Helper Class for JS toggling */
.d-none { display: none !important; }

/* --- Page: Blog --- */

.page-blog .blog-headline {
    color: #2c3e50;
    font-weight: 700;
    transition: color 0.2s ease;
    margin-bottom: 0.25rem;
}

.page-blog .blog-headline:hover {
    color: #0d6efd;
}

.page-blog .blog-meta {
    font-family: 'Inter', sans-serif; /* Or your preferred sans-serif */
    letter-spacing: 0.02em;
}

.page-blog .blog-image-wrapper {
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: transform 0.3s ease;
}

.page-blog .blog-post-card:hover .blog-image-wrapper {
    transform: scale(1.02);
}

.page-blog .blog-img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    display: block;
}

.page-blog .blog-excerpt {
    line-height: 1.8;
    color: #4a4a4a;
    font-size: 1.05rem;
}

.page-blog .blog-post-card {
    padding-bottom: 3rem;
    border-bottom: 1px solid #f0f0f0;
}

.page-blog .blog-post-card:last-child {
    border-bottom: none;
}

/* Make sure images stack nicely on mobile */
@media (max-width: 767px) {
    .page-blog .blog-img {
        height: 200px;
        margin-bottom: 1rem;
    }
}

/* --- Page: Blog Post (Single) --- */

.page-blog-post .post-hero-image {
    text-align: center; /* Centers the image if it's smaller than the container */
    margin-bottom: 3rem;
}

.page-blog-post .post-hero-image img {
    width: 100%;
    max-width: 250px; /* As requested */
    height: auto;
    object-fit: cover;
    border-radius: 12px;
    /* Optional: adds a nice subtle frame to smaller images */
    border: 1px solid rgba(0,0,0,0.05); 
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* --- Page: Contact --- */

.page-contact .contact-form {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.05);
    border: 1px solid #f0f0f0;
}

.page-contact .form-control {
    border: 1px solid #e0e0e0;
    border-radius: 10px;
}

.page-contact .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.1);
}

/* Customizing the floating label color on focus */
.page-contact .form-floating > .form-control:focus ~ label {
    color: #0d6efd;
    padding: 1rem 0.75rem !important; /* Your desired padding */
    height: calc(3.5rem + 2px) !important; /* Standard Bootstrap floating height */
    line-height: 1.25;
}

/* Ensure the form doesn't look weird on mobile */
@media (max-width: 576px) {
    .page-contact .contact-form {
        padding: 1.5rem;
        box-shadow: none;
        border: none;
    }
}

.page-puzzles {
    overflow-x: hidden;
    width: 100%;
}

.page-puzzles .row {
    margin-right: 0 !important;
    margin-left: 0 !important;
    --bs-gutter-x: 1rem; 
}

.filter-toolbar {
    max-width: 100%;
    border-radius: 0 !important; /* Edge-to-edge on mobile */
    margin-bottom: 2rem !important;
}


.puzzle-card {
    transition: transform 0.2s ease;
    height: 100%;
}

.puzzle-img-wrapper {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f1f3f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.puzzle-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.is-owned {
    border: 2px solid rgba(13, 110, 253, 0.3) !important;
}

.owned-tag {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #0d6efd;
    color: white;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.65rem;
    font-weight: bold;
}

.puzzle-card:not(.is-owned) img {
    filter: grayscale(60%);
    opacity: 0.8;
}

.puzzle-card:not(.is-owned):hover img {
    filter: grayscale(0%);
    opacity: 1;
}

.carousel-item img {
    height: 400px;
    object-fit: contain;
    background: #f8f9fa;
}

.no-image-placeholder {
    color: #adb5bd;
    font-size: 0.8rem;
}

.puzzle-archive-header {
    color: #ffffff;
}

.row.puzzle-search-row {
    margin-top: 25px;
}

#adminSearchInput {
 flex: .5 1 auto !important;   
}

.admin-image-strip {
    display: flex;
    gap: 5px;
    justify-content: center;
}

.admin-thumb-wrapper {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid #dee2e6;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.admin-table-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-thumb-wrapper.empty {
    color: #ced4da;
    font-size: 0.7rem;
    background: #fdfdfe;
}

@media (max-width: 800px) {
    .admin-image-strip {
        justify-content: flex-end; 
    }
    
    .w-100-mobile {
        width: 100% !important;
        padding: 10px !important;
    }

    #adminSearchInput {
        flex: 1 1 auto !important;
    }

    .page-puzzles {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    #resultsWrapper, 
    .table-responsive, 
    .table, 
    #adminSearchResultsBody {
        display: block !important;
        width: 100% !important;
        min-width: 100% !important;
        border: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    .panel-body, .panel {
        padding: 0 !important;
        border: none !important;
        box-shadow: none !important;
    }

    .filter-toolbar .col-auto, 
    .filter-toolbar .col-md {
        width: 100% !important;
        flex: 0 0 100% !important;
        margin-bottom: 1rem;
    }

    #adminSearchResultsBody thead, 
    table thead {
        display: none !important; 
    }

    #adminSearchResultsBody tr {
        display: block !important;
        width: 100% !important;
        margin-bottom: 1.5rem;
        border: 1px solid #dee2e6;
        border-radius: 12px;
        padding: 1rem;
        background: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05);
        box-sizing: border-box;
    }

    #adminSearchResultsBody td {
        display: flex !important;
        width: 100% !important;
        justify-content: flex-end;
        align-items: center;
        min-height: 45px;
        position: relative;
        padding: 8px 0 !important;
        border-bottom: 1px solid #f8f9fa;
        box-sizing: border-box;
    }

    /* Labels */
    #adminSearchResultsBody td::before {
        content: attr(data-label);
        position: absolute;
        left: 0;
        width: 40%;
        font-weight: bold;
        text-align: left;
        color: #6c757d;
        font-size: 0.85rem;
    }

    #adminSearchResultsBody td:last-child {
        display: block !important;
        padding-left: 0 !important;
        text-align: center;
        border-top: 1px solid #eee;
        border-bottom: none;
        margin-top: 10px;
        padding-top: 15px !important;
    }

    #adminSearchResultsBody td:last-child::before {
        display: none;
    }
}

/* --- Page: Admin Portal --- */

.page-admin-portal .admin-card {
    border-radius: 20px;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.page-admin-portal .admin-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.08) !important;
    background-color: #fff;
}

.page-admin-portal .admin-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    margin: 0 auto;
    transition: transform 0.3s ease;
}

.page-admin-portal .admin-card:hover .admin-icon {
    transform: scale(1.1) rotate(5deg);
}

.page-admin-portal h4 {
    color: #333;
    font-size: 1.25rem;
}

/* Background subtles for 2026 aesthetics */
.bg-primary-subtle { background-color: #e7f1ff; }
.bg-success-subtle { background-color: #e6fcf5; }
.bg-info-subtle { background-color: #e3faff; }
.bg-warning-subtle { background-color: #fff9db; }
.bg-danger-subtle { background-color: #fff5f5; }

/* --- Page: Admin About Me Update --- */

.page-admin-about .card {
    border: 1px solid rgba(0,0,0,0.05);
}

.page-admin-about .note-editor.note-frame {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
}

.page-admin-about .note-toolbar {
    background-color: #f8f9fa;
    border-bottom: 1px solid #dee2e6;
}

/* Sticky Action Bar at the bottom of the screen */
.page-admin-about .admin-sticky-actions {
    position: sticky;
    bottom: 0;
    margin: 0 -1.5rem; /* Offsets container padding if needed */
    z-index: 1000;
}

.page-admin-about .img-thumbnail {
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    border: 2px solid #fff;
}

/* --- Page: Admin Image Management --- */

.page-admin-about .current-img-preview {
    display: inline-block;
    padding: 10px;
    background: #fdfdfd;
    border-radius: 12px;
    border: 1px dashed #dee2e6;
}

.page-admin-about .italic {
    font-style: italic;
}

/* Give the 'Replace' button a little more pop on hover */
.page-admin-about .btn-outline-primary:hover {
    background-color: #0d6efd;
    color: white;
}

.page-admin-about .tech-preview {
    border-color: rgba(25, 135, 84, 0.2); /* Success green tint */
}

/* Add a hover effect to the specific tech button */
.page-admin-about .btn-outline-success:hover {
    background-color: #198754;
    color: white;
}

/* --- Page: Blog Management --- */

.page-blog-admin .table thead th {
    border-bottom: none;
    font-weight: 600;
}

.page-blog-admin .table tbody tr {
    transition: background-color 0.2s ease;
}

.page-blog-admin .table tbody tr:hover {
    background-color: #fbfcfe;
}

/* Styling the Action Button Group */
.page-blog-admin .btn-group .btn {
    padding: 0.5rem 0.75rem;
    background-color: #fff;
    transition: all 0.2s ease;
}

.page-blog-admin .btn-group .btn:hover {
    background-color: #f8f9fa;
}

.page-blog-admin .btn-group .btn i {
    font-size: 1rem;
}

/* Ensure the title doesn't break the layout if it's huge */
.page-blog-admin td .fw-bold {
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Page: Blog Edit / Create --- */

.page-blog-edit {
    /* This ensures the page is long enough so the content 
       clears the fixed bar at the bottom */
    padding-bottom: 120px !important; 
}

/* Let's refine the fixed bar to be more "aware" of the layout */
.page-blog-edit .admin-sticky-actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255, 255, 255, 0.95); /* Slight transparency looks modern */
    backdrop-filter: blur(10px); /* Frosty glass effect */
    border-top: 1px solid #dee2e6;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.08);
    z-index: 1060; /* Higher than the site footer */
    padding: 1rem 2rem;
}

/* Prevent the sticky bar from looking weird on ultra-wide screens */
@media (min-width: 1400px) {
    .page-blog-edit .admin-sticky-actions {
        padding: 1rem 15%; 
    }
}
/* --- Admin Layout & Panels --- */
.main {
    background-color: #f4f7f6;
    min-height: 100vh;
    padding-top: 20px;
}

.panel {
    border: none;
    border-radius: 8px;
    margin-bottom: 25px;
}

.panel-heading.bg-dark {
    background-color: #69b3fd !important;
    color: white !important;
    padding: 15px 20px;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* --- Search UI --- */
.input-lg {
    height: 55px;
    font-size: 18px;
    border-radius: 8px;
    border: 2px solid #ddd;
    box-shadow: none !important;
}

.input-lg:focus {
    border-color: #3498db;
}

/* --- Asset Audit Icons --- */
.text-success { color: #27ae60 !important; }
.text-danger { color: #e74c3c !important; }
.opacity-25 { opacity: 0.25; }

/* Tooltip style on hover */
[title]:hover:after {
    content: attr(title);
    padding: 4px 8px;
    background: #333;
    color: #fff;
    font-size: 11px;
    position: absolute;
    border-radius: 4px;
}

/* --- Edit Page Styling --- */
.well {
    background-color: #fff;
    border: 1px solid #e1e8ed;
    box-shadow: none;
    border-radius: 8px;
}

.border-left {
    border-left: 1px solid #eee;
}

/* Thumbnail Previews */
.thumbnail {
    border-radius: 6px;
    padding: 10px;
    background: #fdfdfd;
    margin-bottom: 15px;
}

.thumbnail img {
    height: 140px;
    width: 100%;
    object-fit: contain; /* Prevents stretching */
    background: #f0f0f0;
    margin-bottom: 10px;
}

/* --- Table Polish --- */
.table-hover tbody tr:hover {
    background-color: #f0faff !important;
}

.table > tbody > tr > td {
    vertical-align: middle;
    padding: 12px 8px;
}

/* Utility for spacing */
.mt-4 { margin-top: 20px; }
.mb-3 { margin-bottom: 15px; }
.fw-bold { font-weight: 700; }

/* --- Login Reset & Layout --- */
.page-login {
    min-height: 100vh; /* Better for mobile viewports */
    background-color: #f8f9fa;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px; /* Perfect for both mobile and desktop */
}

.login-card {
    background: #ffffff;
    padding: 2rem;
    border-radius: 1.5rem;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.05);
}

/* --- Icon Styling --- */
.icon-circle {
    width: 80px;
    height: 80px;
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
}

/* --- Floating Label Fixes --- */
.page-login .form-floating {
    position: relative;
}

.page-login .form-control {
    height: 60px !important; /* Fixed height stops the 'jump' */
    border-radius: 12px;
    padding: 1rem 0.75rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.page-login .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 4px rgba(13, 110, 253, 0.1);
}

/* Ensure placeholder is hidden until focused so it doesn't fight the label */
.page-login .form-control::placeholder {
    color: transparent;
}

/* --- Button Styling --- */
.btn-login {
    background: #0d6efd;
    color: white;
    border: none;
    padding: 1rem;
    border-radius: 50px;
    font-weight: 700;
    transition: transform 0.1s active, background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-login:hover {
    background: #0b5ed7;
}

.btn-login:active {
    transform: scale(0.98);
}

.back-link {
    color: #6c757d;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}

.back-link:hover {
    color: #0d6efd;
}

/* --- Mobile Specific Overrides --- */
@media (max-width: 576px) {
    .login-card {
        padding: 1.5rem;
    }
    
    .page-login {
        align-items: flex-start; /* Better for smaller screens when keyboard pops up */
        padding-top: 10vh;
    }
}