/* BexleyMesh Custom CSS */

/* Smooth scrolling is handled by HTML class: scroll-smooth */

/* Custom Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Dark Mode Scrollbar */
.dark ::-webkit-scrollbar-track {
    background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
    background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

/* Custom Typography */
body {
    font-family: 'Inter', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: color 200ms, background-color 200ms;
}

code, pre {
    font-family: 'Fira Code', monospace;
}

/* Hero gradient background */
.hero-gradient {
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
}

.dark .hero-gradient {
    background: linear-gradient(135deg, #15803d 0%, #0f172a 100%);
}

/* Card shadows */
.card-shadow {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: box-shadow 200ms;
}

.card-shadow:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* Blog post styling */
.prose {
    max-width: none;
}

.prose h1 {
    font-size: 2.25rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.prose h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #f1f5f9;
    margin-top: 1rem;
    margin-bottom: 0.5rem;
}

.prose p {
    color: #e2e8f0;
    margin-bottom: 1rem;
    line-height: 1.625;
}

.prose a {
    color: #86efac;
    text-decoration: none;
}

.prose a:hover {
    text-decoration: underline;
}

.prose strong {
    color: #ffffff;
}

.prose code {
    background-color: #1e293b;
    color: #e2e8f0;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.875rem;
}

.prose pre {
    background-color: #111827;
    color: #f3f4f6;
    padding: 1rem;
    border-radius: 0.5rem;
    overflow-x: auto;
    margin-bottom: 1rem;
}

.prose ul, .prose ol {
    margin-left: 1rem;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

.prose ul ul, .prose ul ol, .prose ol ul, .prose ol ol {
    margin-bottom: 0;
    margin-top: 0.25rem;
}

.prose ul {
    list-style-type: disc;
}

.prose ol {
    list-style-type: decimal;
}

.prose li {
    margin-bottom: 0.5rem;
    color: #e2e8f0;
}

/* Status indicators */
.status-online {
    background-color: #22c55e;
}

.dark .status-online {
    background-color: #16a34a;
}

.status-offline {
    background-color: #ef4444;
}

.dark .status-offline {
    background-color: #dc2626;
}

.status-unknown {
    background-color: #6b7280;
}

.dark .status-unknown {
    background-color: #4b5563;
}

/* Pulse animation for live indicators */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse-custom {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Loading animation */
.skeleton {
    background-color: #e5e7eb;
    border-radius: 0.25rem;
    animation: skeleton-loading 1s linear infinite alternate;
}

.dark .skeleton {
    background-color: #374151;
}

@keyframes skeleton-loading {
    0% {
        background-color: #e5e7eb;
    }
    100% {
        background-color: #f3f4f6;
    }
}

@keyframes skeleton-loading-dark {
    0% {
        background-color: #374151;
    }
    100% {
        background-color: #1f2937;
    }
}

/* Responsive utilities */
@media (max-width: 768px) {
    .prose h1 {
        font-size: 1.5rem;
    }

    .prose h2 {
        font-size: 1.25rem;
    }

    .prose h3 {
        font-size: 1.125rem;
    }
}

/* Link styling for better accessibility */
a:focus-visible {
    outline: 2px solid #22c55e;
    outline-offset: 2px;
}

.dark a:focus-visible {
    outline-color: #86efac;
}

/* Prose images */
.prose-img-single {
    max-width: 25%;
    margin: 1rem 0;
}

.prose-img-single .prose-img,
.prose-img-single .prose-img-processed {
    width: 100%;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 200ms;
}

.prose-img-single .prose-img:hover,
.prose-img-single .prose-img-processed:hover {
    opacity: 0.85;
}

.prose-img-caption {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-top: 0.35rem;
    text-align: center;
    line-height: 1.4;
}

.prose-img-caption:empty {
    display: none;
}

.prose-img-album {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.prose-img-album-figure,
.prose .prose-img-album-figure {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0;
    padding: 0;
}

.prose-img-album-figure .prose-img-caption {
    margin-top: 0.25rem;
    margin-bottom: 0;
}

.prose-img-album-item {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: opacity 200ms;
}

.prose-img-album-item:hover {
    opacity: 0.85;
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 200ms, visibility 200ms;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-content {
    position: relative;
    max-width: 80vw;
    max-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 80vh;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 0.5rem;
    object-fit: contain;
}

.lightbox-caption {
    color: #e2e8f0;
    font-size: 0.9rem;
    text-align: center;
    margin-top: 0.75rem;
    max-width: 100%;
    line-height: 1.4;
}

/* Toolbar: holds fullscreen + close buttons */
.lightbox-toolbar {
    position: absolute;
    top: -2.5rem;
    right: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    z-index: 10;
}

.lightbox-close,
.lightbox-fullscreen {
    color: #fff;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    line-height: 1;
    opacity: 0.8;
    transition: opacity 150ms;
}

.lightbox-fullscreen {
    font-size: 1.2rem;
}

.lightbox-close:hover,
.lightbox-fullscreen:hover {
    opacity: 1;
}

/* Zoom cursors */
.lightbox-content img {
    cursor: zoom-in;
}

.lightbox-content img.zoomed {
    cursor: zoom-out;
}

/* Zoomed state */
.lightbox-img-wrapper.zoomed {
    overflow: auto;
    max-height: 80vh;
    max-width: 80vw;
}

.lightbox-content img.zoomed {
    max-width: none;
    max-height: none;
    width: auto;
    height: auto;
    border-radius: 0.5rem;
}

.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2rem;
    background: rgba(0, 0, 0, 0.4);
    border: none;
    cursor: pointer;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    opacity: 0.8;
    transition: opacity 150ms, background 150ms;
    line-height: 1;
}

.lightbox-nav:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.7);
}

.lightbox-prev {
    left: -4rem;
}

.lightbox-next {
    right: -4rem;
}

@media (max-width: 768px) {
    .prose-img-single {
        max-width: 50%;
    }

    .prose-img-album {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }

    .lightbox-prev {
        left: 0.5rem;
    }

    .lightbox-next {
        right: 0.5rem;
    }
}

/* Print styles */
@media print {
    .no-print {
        display: none;
    }
}

/* Tooltip styles */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    z-index: 50;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    width: max-content;
    max-width: 260px;
    padding: 8px 12px;
    border-radius: 8px;
    background-color: #1e293b;
    border: 1px solid #334155;
    color: #e2e8f0;
    font-size: 0.8rem;
    font-weight: 400;
    line-height: 1.4;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    transition: opacity 200ms ease, visibility 200ms ease;
    pointer-events: none;
}

.tooltip .tooltip-text::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 6px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

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