/* Bootstrap compatibility CSS for common Tailwind-like utilities used in the theme.
   This file provides minimal mappings to avoid breaking existing markup while
   migrating to Bootstrap 5. Add or refine mappings as needed.
*/

/* Layout helpers */
.max-w-7xl{max-width:80rem;margin-left:auto;margin-right:auto}
.mx-auto{margin-left:auto;margin-right:auto}
.px-6{padding-left:1.5rem;padding-right:1.5rem}
.py-16{padding-top:4rem;padding-bottom:4rem}
.p-8{padding:2rem}
.p-14{padding:3.5rem}
.mb-8{margin-bottom:2rem}
.mt-10{margin-top:2.5rem}
.h-52{height:13rem}
.w-full{width:100%}
.overflow-hidden{overflow:hidden}

/* Rounded helpers */
.rounded-2xl{border-radius:1rem !important}
.rounded-2xl, .rounded-2xl *{box-sizing:border-box}
.rounded-\[2rem\]{border-radius:2rem !important}
.rounded-\[1rem\]{border-radius:1rem !important}
.rounded-\[0\.75rem\]{border-radius:0.75rem !important}
.rounded-2xl{border-radius:1rem !important}

/* Border / shadow / background */
.border{border-width:1px;border-style:solid;border-color:#e6eef6}
.border-slate-100{border-color:#f1f5f9}
.bg-white{background-color:#ffffff}
.bg-slate-50{background-color:#f8fafc}
.shadow-2xl{box-shadow:0 25px 50px -12px rgba(2,6,23,0.3)}
.shadow-sm{box-shadow:0 1px 2px rgba(15,23,42,0.04)}

/* Typography */
.text-sm{font-size:.875rem}
.text-base{font-size:1rem}
.text-3xl{font-size:1.875rem}
.text-4xl{font-size:2.25rem}
.font-bold{font-weight:700}
.font-montserrat{font-family:Montserrat,system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial}
.text-blue-600{color:#2563eb}
.text-blue-950{color:#0f172a}
.text-slate-400{color:#94a3b8}

/* Flex / Grid helpers */
.flex{display:flex}
.inline-flex{display:inline-flex}
.flex-col{flex-direction:column}
.flex-row{flex-direction:row}
.items-center{align-items:center}
.justify-between{justify-content:space-between}
.gap-6{gap:1.5rem}
.gap-3{gap:.75rem}
.grid{display:grid}
.md\:grid-cols-2{grid-template-columns:repeat(2,1fr)}

/* Responsive placeholders (basic breakpoints) */
@media (min-width:768px){
    .md\:p-14{padding:3.5rem}
    .md\:flex-row{flex-direction:row}
    .md\:items-end{align-items:flex-end}
    .md\:text-right{text-align:right}
}

/* Utility fallbacks */
.hidden{display:none !important}
.block{display:block}
.inline-block{display:inline-block}
.transition{transition:all .18s ease-in-out}
.hover\:bg-slate-50:hover{background-color:#f8fafc}
.hover\:text-blue-700:hover{color:#1d4ed8}

/* Small helpers used by JS (className assignments) */
.rounded-xl{border-radius:.75rem}
.px-3{padding-left:.75rem;padding-right:.75rem}
.py-2{padding-top:.5rem;padding-bottom:.5rem}
.text-sm{font-size:.875rem}
.font-medium{font-weight:500}
.text-slate-500{color:#6b7280}

/* Any additional mappings can be appended here as the migration continues */

/* Ensure JS "is-open" state can override `.hidden` and show elements when needed */
.reibel-mobile-drawer.is-open,
.reibel-mobile-overlay.is-open,
[data-reibel-submenu].is-open {
    display: block !important;
}

/* When drawer is open, prevent body scroll */
.reibel-menu-open {
    overflow: hidden;
}

/* Single Article Enhancements */
.reibel-content {
    font-size: 1.0625rem;
    line-height: 1.8;
    color: #333;
}
.reibel-content p {
    margin-bottom: 1.5rem;
}
.reibel-content h2,
.reibel-content h3,
.reibel-content h4,
.reibel-content h5,
.reibel-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
    color: #0f172a;
}
.reibel-content img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    border-radius: 0.5rem;
}

/* Article Header / Meta */
article h1 {
    line-height: 1.2;
    margin-bottom: 1.5rem;
}
article header .btn-group {
    flex-wrap: wrap;
}
article header .btn-group .btn {
    font-size: 0.875rem;
}

/* Sidebar Card Styling */
.card {
    border-radius: 0.75rem;
    border: 1px solid #e2e8f0;
    transition: all 0.2s ease;
    margin-bottom: 0;
}
.card:hover {
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
    border-color: #cbd5e1;
}
.card.bg-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0c5ce6 100%) !important;
    border: none;
}
.card.bg-light {
    background-color: #f8fafc !important;
    border-color: #e2e8f0;
}
.card-body {
    padding: 1.25rem;
}
.card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #0f172a;
}
.card-text {
    margin-bottom: 0;
    line-height: 1.6;
}

/* List Groups in Sidebar */
.list-group-item {
    border: none;
    padding: 0.75rem;
    background: transparent;
    transition: background 0.15s ease;
}
.list-group-item:hover {
    background: #f1f5f9;
}
.list-group-item.active {
    background: #e7f1ff;
    border-left: 3px solid #0d6efd;
    padding-left: calc(0.75rem - 3px);
}

/* Gallery Grid */
section > .d-flex[style*="flex-wrap"] {
    gap: 0.5rem !important;
}
section > .d-flex[style*="flex-wrap"] > a {
    flex: 0 0 auto;
    border-radius: 0.375rem;
    overflow: hidden;
    transition: transform 0.15s ease;
}
section > .d-flex[style*="flex-wrap"] > a:hover {
    transform: scale(1.02);
}

/* Tag Badges */
.badge {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-weight: 500;
}
.badge:hover {
    background-color: #e7f1ff !important;
    color: #0d6efd !important;
    text-decoration: none;
}

/* Form in Sidebar */
.card .form-control-sm {
    border-radius: 0.375rem;
    border: 1px solid #cbd5e1;
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
}
.card .form-control-sm:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Video Embeds (ratio is from Bootstrap) */
.ratio.ratio-16x9 iframe {
    border-radius: 0.375rem;
}

/* Navigation links (prev/next) */
a[rel="prev"],
a[rel="next"] {
    display: inline-block;
    padding: 0.5rem 1rem;
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all 0.15s ease;
}
a[rel="prev"]:hover,
a[rel="next"]:hover {
    background: #f1f5f9;
}

/* Reading Progress Bar */
#reading-progress {
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.3);
}

/* Responsive: tablet and down */
@media (max-width: 991px) {
    .card {
        margin-bottom: 1rem;
    }
    article.col-lg-8 {
        margin-bottom: 2rem;
    }
}

/* Small screens */
@media (max-width: 576px) {
    .reibel-content {
        font-size: 1rem;
    }
    article h1 {
        font-size: 1.75rem;
    }
    .card-body {
        padding: 1rem;
    }
}

/* Enhanced Section Headers with Icons */
.card-body > small::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 0.5rem;
    vertical-align: -2px;
    background-size: contain;
    background-repeat: no-repeat;
}

/* Specific icon styles for each section */
[data-reibel-toc-card] .card-body > small::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230d6efd' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z'/%3E%3C/svg%3E");
}

/* Form Enhancements */
.card .form-control,
.card .form-control-sm {
    border-radius: 0.5rem;
    border: 1.5px solid #cbd5e1;
    font-size: 0.9375rem;
    padding: 0.625rem 0.875rem;
    transition: all 0.2s ease;
}
.card .form-control:focus,
.card .form-control-sm:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}
.card .form-control::placeholder {
    color: #94a3b8;
    font-style: italic;
}

/* Button Styles in Cards */
.card .btn-primary {
    background: linear-gradient(135deg, #0d6efd 0%, #0c5ce6 100%);
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.2);
}
.card .btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.3);
    background: linear-gradient(135deg, #0c5ce6 0%, #0b4dd9 100%);
}

/* Article Info Stats */
article header .text-muted {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}
article header .text-muted span {
    display: inline-flex;
    align-items: center;
}
article header .text-muted span::before {
    content: "📅";
    margin-right: 0.25rem;
    font-size: 0.9rem;
}
article header .text-muted span:nth-child(3)::before {
    content: "⏱️";
}
article header .text-muted span:nth-child(5)::before {
    content: "📂";
}

/* Section Title Icons */
section > h5::before {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 0.5rem;
    vertical-align: -3px;
    background-size: contain;
    background-repeat: no-repeat;
}

section:has(> div[data-reibel-toc]) > h5::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='%230d6efd' viewBox='0 0 24 24'%3E%3Cpath d='M3 4h18v2H3V4zm0 7h18v2H3v-2zm0 7h18v2H3v-2z'/%3E%3C/svg%3E");
}

/* Author Box Enhancement */
.mb-4 > div:has(> .flex-shrink-0) img {
    width: 80px !important;
    height: 80px !important;
    border-radius: 50%;
    border: 3px solid #0d6efd;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.15);
}

/* Gallery Hover Effects */
section > .d-flex[style*="flex-wrap"] > a {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}
section > .d-flex[style*="flex-wrap"] > a:hover {
    transform: scale(1.08) rotateZ(1deg);
    box-shadow: 0 8px 20px rgba(13, 110, 253, 0.2);
}
section > .d-flex[style*="flex-wrap"] > a::after {
    content: "🔍";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    opacity: 0;
    transition: opacity 0.2s ease;
}
section > .d-flex[style*="flex-wrap"] > a:hover::after {
    opacity: 1;
}

/* Tag Cloud Styles */
.card a[rel="tag"] {
    display: inline-block;
    background: linear-gradient(135deg, #e7f1ff 0%, #f1f7ff 100%);
    color: #0d6efd !important;
    padding: 0.5rem 0.875rem;
    border-radius: 20px;
    margin: 0.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid #bfd7ff;
    transition: all 0.2s ease;
    text-decoration: none;
}
.card a[rel="tag"]:hover {
    background: linear-gradient(135deg, #0d6efd 0%, #0c5ce6 100%);
    color: white !important;
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

/* Video Card Enhancement */
.card.bg-light {
    border: 2px solid #e2e8f0;
    background: linear-gradient(135deg, #f8fafc 0%, #e7f1ff 100%) !important;
}
.card.bg-light .ratio {
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}
.card.bg-light .ratio::before {
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0) 100%);
}

/* Comments Preview */
.card:has(small:contains("Yorumlar")) .card-body > div {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 0.5rem;
    max-height: 300px;
    overflow-y: auto;
}
.card:has(small:contains("Yorumlar")) .mb-2 {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.9375rem;
}
.card:has(small:contains("Yorumlar")) .mb-2:last-child {
    border-bottom: none;
}

/* Categories List */
.card ul li {
    padding: 0.5rem 0;
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.15s ease;
}
.card ul li:hover {
    padding-left: 0.5rem;
    color: #0d6efd;
    font-weight: 500;
}
.card ul li a {
    color: inherit;
    text-decoration: none;
}
.card ul li a:hover {
    color: #0d6efd;
}

/* Support/Contact Card */
.card.bg-primary {
    position: relative;
    overflow: hidden;
}
.card.bg-primary::before {
    content: "";
    position: absolute;
    top: -50%;
    right: -50%;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
}
.card.bg-primary .card-body {
    position: relative;
    z-index: 1;
}

/* Quick Links */
.card ul.list-unstyled li {
    padding: 0.625rem 0;
    transition: all 0.15s ease;
}
.card ul.list-unstyled li::before {
    content: "▸ ";
    color: #0d6efd;
    font-weight: bold;
    margin-right: 0.5rem;
}
.card ul.list-unstyled li:hover {
    padding-left: 0.5rem;
}

/* Navigation Buttons */
div:has(> a[rel="prev"]),
div:has(> a[rel="next"]) {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}
a[rel="prev"],
a[rel="next"] {
    flex: 1;
    padding: 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    background: #f1f5f9;
    color: #0f172a;
    border: 2px solid #e2e8f0;
}
a[rel="prev"]:hover,
a[rel="next"]:hover {
    background: #0d6efd;
    color: white;
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.25);
}

/* Scrollbar Styling */
.card:has(small:contains("Yorumlar")) .card-body > div::-webkit-scrollbar {
    width: 6px;
}
.card:has(small:contains("Yorumlar")) .card-body > div::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}
.card:has(small:contains("Yorumlar")) .card-body > div::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}
.card:has(small:contains("Yorumlar")) .card-body > div::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Social Share Buttons */
.btn-group.role-group .btn {
    border-radius: 0.375rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.btn-group .btn-outline-secondary {
    border: 1.5px solid #cbd5e1;
    color: #0f172a;
}
.btn-group .btn-outline-secondary:hover {
    background: linear-gradient(135deg, #0d6efd 0%, #0c5ce6 100%);
    border-color: #0d6efd;
    color: white;
}

/* Badge Group */
div:has(> a[class*="badge"]) {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Sidebar Position Adjustment */
aside.col-lg-4 > div > div {
    gap: 1.25rem;
}

/* Article Content Links */
.reibel-content a {
    color: #0d6efd;
    font-weight: 500;
    text-decoration: underline;
    text-decoration-color: rgba(13, 110, 253, 0.3);
    text-underline-offset: 2px;
    transition: all 0.2s ease;
}
.reibel-content a:hover {
    color: #0c5ce6;
    text-decoration-color: rgba(13, 110, 253, 0.6);
}

/* Code Blocks in Article */
.reibel-content code {
    background: #f1f5f9;
    color: #d64545;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-family: "Courier New", monospace;
    font-size: 0.9em;
}
.reibel-content pre {
    background: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    line-height: 1.6;
}
.reibel-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

/* Blockquote Styling */
.reibel-content blockquote {
    border-left: 4px solid #0d6efd;
    padding: 1rem;
    margin: 1.5rem 0;
    background: #f8fafc;
    border-radius: 0.375rem;
    font-style: italic;
    color: #475569;
}

/* List Styling */
.reibel-content ul,
.reibel-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}
.reibel-content li {
    margin: 0.5rem 0;
    line-height: 1.8;
}

/* Table Styling */
.reibel-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border-radius: 0.5rem;
    overflow: hidden;
}
.reibel-content table th {
    background: linear-gradient(135deg, #0d6efd 0%, #0c5ce6 100%);
    color: white;
    padding: 1rem;
    font-weight: 600;
}
.reibel-content table td {
    border-bottom: 1px solid #e2e8f0;
    padding: 0.875rem 1rem;
}
.reibel-content table tr:hover {
    background: #f8fafc;
}

/* Emphasis Styling */
.reibel-content strong {
    font-weight: 700;
    color: #0f172a;
}
.reibel-content em {
    font-style: italic;
    color: #475569;
}

/* Separator */
.reibel-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, #cbd5e1, transparent);
    margin: 2rem 0;
}

/* Animation for Reading Progress */
@keyframes pulse-progress {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}
#reading-progress:not([style*="width: 100%"]) {
    animation: pulse-progress 2s ease-in-out infinite;
}

/* Enhanced Tablet View */
@media (max-width: 1024px) {
    .card {
        margin-bottom: 1.25rem;
    }
    .card-body {
        padding: 1rem;
    }
    article h1 {
        font-size: 2rem;
    }
}

/* Mobile Adjustments */
@media (max-width: 576px) {
    article header {
        flex-direction: column !important;
    }
    article header .d-flex:last-child {
        width: 100%;
        margin-top: 1rem;
    }
    .btn-group {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }
    .btn-group .btn {
        width: 100% !important;
    }
    section > .d-flex[style*="flex-wrap"] > a {
        width: 80px !important;
        height: 60px !important;
    }
    .card-body {
        padding: 0.875rem;
    }
}
