/* 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 {
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    background-color: var(--background-color) !important; /* Using darker background */
    color: var(--matrix-green) !important; /* Matrix green text */
}

/* Fix for matrix canvas */
#matrix-canvas {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: -1 !important;
}

.matrix-background {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: -1 !important;
}

/* Card Styles */
.card {
    border-radius: 0.5rem;
    border: 1px solid var(--matrix-green) !important;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2) !important;
    margin-bottom: 1.5rem;
    background-color: rgba(5, 5, 5, 0.9) !important; /* 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;
}

/* Make sure all text is visible against dark backgrounds */
.text-dark, .card-text, .card-title, .navbar-light .navbar-nav .nav-link, 
.navbar-light .navbar-brand, p, h1, h2, h3, h4, h5, h6 {
    color: var(--matrix-green) !important;
}

.text-muted {
    color: #00aa00 !important;
}

.bg-light {
    background-color: rgba(0, 0, 0, 0.8) !important;
}

.bg-white {
    background-color: rgba(0, 0, 0, 0.9) !important;
}

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

/* Form elements - enhanced styling for Matrix theme */
.form-control,
.form-select {
    color: var(--matrix-green) !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
    border-color: var(--matrix-green) !important;
}

.form-control:focus,
.form-select:focus {
    color: var(--matrix-green) !important;
    background-color: rgba(0, 0, 0, 0.8) !important;
    border-color: var(--matrix-green) !important;
    box-shadow: 0 0 0 0.25rem rgba(0, 255, 0, 0.25) !important;
}

.form-control::placeholder {
    color: rgba(0, 255, 0, 0.5) !important;
}

/* Fix for webkit autofill which forces white background */
input:-webkit-autofill,
input:-webkit-autofill:hover, 
input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--matrix-green) !important;
    -webkit-box-shadow: 0 0 0px 1000px rgba(0, 0, 0, 0.7) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* 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 {
    color: var(--matrix-green) !important;
    text-decoration: none;
}

a:hover {
    color: white !important;
    text-shadow: 0 0 5px var(--matrix-green) !important;
}

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

.modal-header, .modal-footer {
}

.close {
}

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

.dropdown-item {
    color: var(--matrix-green) !important;
}

.dropdown-item:hover, .dropdown-item:focus {
    background-color: #0a0a0a !important; /* Darker background on hover */
    color: #FFFFFF !important;
    text-shadow: 0 0 8px var(--matrix-green) !important; /* Add glow effect on hover */
}

/* Also fix the navbar dropdown menu */
.navbar-nav .dropdown-menu {
    background-color: rgba(10, 10, 10, 0.95) !important;
    border: 1px solid var(--matrix-green) !important;
    box-shadow: 0 0 10px rgba(0, 255, 0, 0.2) !important;
}

.navbar-light .navbar-nav .nav-link:hover,
.navbar-light .navbar-nav .nav-link:focus {
    background-color: #0a0a0a !important;
    text-shadow: 0 0 8px var(--matrix-green) !important;
}

/* 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;
}

/* Override any conflicting styles that might prevent matrix from showing */
.matrix-background canvas {
    opacity: 1 !important;
    display: block !important;
    visibility: visible !important;
}

/* Override Bootstrap navbar */
.navbar-light {
    background-color: rgba(0, 0, 0, 0.9) !important;
}
