/* General Styling */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --border-color: #333333;
    --success-color: #198754;
    --danger-color: #dc3545;
    --matrix-green: #00FF00;
    --matrix-dark-green: #003B00;
    --background-color: #050505; /* Even darker background */
}

body {
    background-image: url('../images/mosaic-background.png');
    background-attachment: fixed;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Add overlay to improve text readability over the background image */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.85); /* White overlay with 85% opacity */
    z-index: -1;
}
/* Card Styles */
.card {
    border-radius: 0.5rem;
    border: 1px solid #333333;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 255, 0, 0.2);
    margin-bottom: 1.5rem;
    background-color: rgba(5, 5, 5, 0.95); /* Darker card background */
}

.card-img-top {
    border-top-left-radius: 0.5rem;
    border-top-right-radius: 0.5rem;
    object-fit: cover;
    height: 180px;
}

/* Button Styles */
.btn {
    border-radius: 0.25rem;
    padding: 0.375rem 0.75rem;
    font-weight: 500;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Adjust text colors for dark background */
.text-dark {
}

.text-muted {
}

.bg-light {
}

.bg-white {
}

.border {
    border-color: #333 !important;
}

/* Form elements */
.form-control,
.form-select {
}

/* Table styling */
.table {
}

.table-striped > tbody > tr:nth-of-type(odd) {
}

/* List groups */
.list-group-item {
}

.list-group-item.active {
}

/* Matrix Canvas specific styles - Optimized for English letters */
#matrixCanvas {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: -1 !important;
    opacity: 0.75 !important; /* Slightly reduced from 0.8 for better readability of content */
    pointer-events: none !important;
    image-rendering: -webkit-optimize-contrast !important; /* Sharper rendering in WebKit */
    image-rendering: crisp-edges !important; /* Sharper rendering in Firefox */
    filter: brightness(1.2) contrast(1.3) !important; /* Adjusted for better legibility */
    will-change: transform !important; /* Hint for browser optimization */
    -webkit-font-smoothing: antialiased !important; /* Enable antialiasing for smoother English letters */
    font-smoothing: antialiased !important; /* Enable antialiasing */
}

/* Remove Matrix toggle button specific styles */
#matrix-toggle-container {
    display: none !important; /* Hide the toggle button container completely */
}

/* Remove Sumerian font loading since we're not using it anymore */
@font-face {
    font-family: "Matrix Monospace";
    src: local("Courier New"), local("Courier"), local("monospace");
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

/* Twitter embed specific styling - Force center alignment */
.twitter-embed {
    text-align: center !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 2rem auto !important;
    width: 100% !important;
}

.twitter-embed .twitter-tweet {
    margin: 0 auto !important;
}

/* Make sure the twitter widget respects the center alignment */
.twitter-tweet-rendered {
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Mobile Optimizations */
@media (max-width: 767.98px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    h1, .h1 {
        font-size: 1.75rem;
    }
    
    h2, .h2 {
        font-size: 1.5rem;
    }
    
    .card-title {
        font-size: 1.25rem;
    }
    
    .blog-post-title {
        font-size: 1.75rem;
    }
    
    .py-4 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
    
    footer {
        text-align: center;
    }
    
    .table-responsive {
        border: 0;
    }
    
    .card-img-top {
        height: 200px;
    }
}

/* Touch-friendly controls */
@media (max-width: 767.98px) {
    .form-control, 
    .form-select, 
    .btn {
        min-height: 44px;
    }
    
    .btn {
        margin-bottom: 0.5rem;
    }
    
    .btn-sm {
        min-height: 32px;
    }
    
    .form-check-input {
        width: 1.25em;
        height: 1.25em;
    }
}

/* Sidebar styles */
.sticky-sidebar {
    position: -webkit-sticky;
    position: sticky;
    top: 2rem;
}

/* Blog post content */
.blog-post-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

/* Footer */
footer {
    margin-top: 3rem;
}

/* Animation for interactions */
.card, .btn {
    transition: all 0.2s ease-in-out;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Accessibility improvements */
.form-control:focus,
.btn:focus {
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
    
    .blog-post-content {
        font-size: 12pt;
    }
    
    a[href]:after {
        content: " (" attr(href) ")";
    }
}

/* Pagination Style Enhancements for Matrix Theme */
.pagination {
    margin-bottom: 0;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2);
}

.page-item:first-child .page-link {
    border-top-left-radius: 0.25rem;
    border-bottom-left-radius: 0.25rem;
}

.page-item:last-child .page-link {
    border-top-right-radius: 0.25rem;
    border-bottom-right-radius: 0.25rem;
}

.page-link {
    transition: all 0.2s ease;
    font-family: "Courier New", monospace;
    padding: 0.375rem 0.75rem;
    text-shadow: 0 0 5px rgba(0, 255, 0, 0.5);
    position: relative;
    z-index: 1;
}

.page-link:hover {
    z-index: 2;
}

.page-link:focus {
    z-index: 3;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 255, 0, 0.25);
}

.page-item.active .page-link {
    font-weight: bold;
}

.page-item.disabled .page-link {
    color: #007700;
    border-color: #004400;
    pointer-events: none;
    cursor: not-allowed;
    opacity: 0.6;
}

/* Pulsing animation for active page */
@keyframes matrix-pulse {
    0% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0.7); }
    70% { box-shadow: 0 0 0 5px rgba(0, 255, 0, 0); }
    100% { box-shadow: 0 0 0 0 rgba(0, 255, 0, 0); }
}

.page-item.active .page-link {
    animation: matrix-pulse 2s infinite;
}

/* Mobile optimization for pagination */
@media (max-width: 767.98px) {
    .pagination {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .page-link {
        padding: 0.4rem 0.6rem;
        margin: 0.15rem;
        border-radius: 0.2rem !important;
    }
    
    .pagination-sm .page-link {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}

/* Shadow effects with green glow */
.shadow-sm {
}

/* Links */
a {
    text-decoration: none;
}

a:hover {
}

/* Modal styling */
.modal-content {
}

.modal-header, .modal-footer {
}

.close {
}

/* Dropdown menus */
.dropdown-menu {
    background-color: #121212;
    
}

.dropdown-item {
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: rgba(0, 255, 0, 0.1);
    color: #FFFFFF;
}

/* Mobile bottom nav styling */
.mobile-bottom-nav {
    background-color: #000000 !important;
    border-top-color: #333 !important;
}

.mobile-bottom-nav a {
}

/* Breadcrumb styling */
.breadcrumb {
    background-color: transparent;
}

.breadcrumb-item a {
}

.breadcrumb-item.active {
}

.breadcrumb-item+.breadcrumb-item::before {
    color: #006600;
}

/* Button tweaks */
.btn-outline-primary {
}

.btn-outline-primary:hover {
    color: #FFFFFF;
}

/* Matrix-styled pagination */
.matrix-pagination .page-item.active .page-link {
    color: #000;
}

.matrix-pagination .page-link {
    background-color: #000;
}

.matrix-pagination .page-link:hover {
    color: #000;
}

.matrix-pagination .page-item.disabled .page-link {
    color: #666;
    background-color: #111;
}

.matrix-pagination .pagination {
    --bs-pagination-hover-bg: #00FF00;
    --bs-pagination-hover-color: #000;
    --bs-pagination-focus-bg: rgba(0, 255, 0, 0.2);
    --bs-pagination-focus-color: #000;
    --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(0, 255, 0, 0.25);
}

/* Pagination container responsive spacing */
.matrix-pagination {
    margin: 1.5rem 0;
}
