﻿/* ============================================================
   SitePublic.css — VSCode-themed public pages
   ============================================================ */

/* Custom Scrollbar (VSCode style) */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #1e1e1e;
}
::-webkit-scrollbar-thumb {
    background: #424242;
    border: 2px solid #1e1e1e;
}
::-webkit-scrollbar-thumb:hover {
    background: #4f4f4f;
}
.hide-scrollbar::-webkit-scrollbar {
    display: none;
}
.hide-scrollbar {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

/* Main content area — responsive padding immune to Bootstrap */
.main-content-area {
    padding: 1rem;
}
@media (min-width: 768px) {
    .main-content-area { padding: 2rem; }
}
@media (min-width: 1024px) {
    .main-content-area { padding: 2.5rem; }
}
@media (min-width: 1280px) {
    .main-content-area { padding: 3rem; }
}

/* Tab bar — show thin scrollbar on hover */
.tab-scrollbar {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.tab-scrollbar:hover {
    scrollbar-color: #424242 transparent;
}
.tab-scrollbar::-webkit-scrollbar {
    height: 3px;
}
.tab-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}
.tab-scrollbar::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}
.tab-scrollbar:hover::-webkit-scrollbar-thumb {
    background: #424242;
}

/* Code block header (macOS dots) */
.code-block-header {
    background-color: #2d2d2d;
    border-bottom: 1px solid #3c3c3c;
}

/* ============================================================
   Prose — content styles for blog/article/app detail pages
   ============================================================ */
.prose-dark h2, .prose-dark h3, .prose-dark h4, .prose-dark h5, .prose-dark h6 {
    color: #e0e0e0;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}
.prose-dark h2 { font-size: 1.5rem; }
.prose-dark h3 { font-size: 1.25rem; }
.prose-dark h4 { font-size: 1.1rem; }

.prose-dark p {
    margin-bottom: 1em;
    line-height: 1.75;
    color: #d4d4d4;
}

.prose-dark ul {
    margin-bottom: 1em;
    padding-left: 1.5em;
    color: #d4d4d4;
    list-style-type: disc;
}
.prose-dark ol {
    margin-bottom: 1em;
    padding-left: 1.5em;
    color: #d4d4d4;
    list-style-type: decimal;
}

.prose-dark li {
    margin-bottom: 0.25em;
    line-height: 1.75;
    display: list-item;
}

.prose-dark a {
    color: #4daafc;
    text-decoration: underline;
    text-decoration-color: rgba(77, 170, 252, 0.3);
}
.prose-dark a:hover {
    color: #73bdff;
    text-decoration-color: rgba(77, 170, 252, 0.6);
}

.prose-dark img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1rem 0;
    border: 1px solid #3c3c3c;
}

/* Bootstrap utility classes used in CMS content (Tailwind preflight strips them) */
.d-block { display: block !important; }
.d-inline-block { display: inline-block !important; }
.text-center { text-align: center !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }
.img-fluid { max-width: 100%; height: auto; }
.rounded { border-radius: 0.375rem; }

/* CMS figure */
.figure { margin: 0 0 1rem; }
.figure.text-center { margin: 0 auto 1rem; }
.figure-img { display: inline-block; }
.figure-img img { border-radius: 0.5rem; }
.figure-caption { font-size: 0.875rem; color: #858585; margin-top: 0.5rem; }

/* Iframes and embeds (Google Maps etc.) */
.prose-dark iframe {
    max-width: 100%;
    border-radius: 0.5rem;
    border: 1px solid #3c3c3c;
}

.prose-dark blockquote {
    border-left: 3px solid #BF1E2E;
    padding-left: 1rem;
    margin: 1em 0;
    color: #858585;
    font-style: italic;
}

.prose-dark table {
    width: 100%;
    border-collapse: collapse;
    margin: 1em 0;
}
.prose-dark table th, .prose-dark table td {
    border: 1px solid #3c3c3c;
    padding: 0.5rem 0.75rem;
    text-align: left;
}
.prose-dark table th {
    background-color: #2d2d2d;
    color: #e0e0e0;
    font-weight: 600;
}
.prose-dark table td {
    background-color: #252526;
}

/* Inline code (not inside <pre>) */
.prose-dark > code,
.prose-dark p > code,
.prose-dark li > code,
.prose-dark td > code,
.prose-dark h2 > code,
.prose-dark h3 > code,
.prose-dark h4 > code,
.prose-dark a > code {
    background-color: #3c3c3c;
    padding: 0.15em 0.4em;
    border-radius: 0.25rem;
    font-size: 0.875em;
    font-family: Consolas, 'Courier New', monospace;
    color: #d4d4d4;
}

/* ============================================================
   PrismJS Dark Theme Override
   Replaces the default light prism.css colors
   ============================================================ */
code[class*="language-"],
pre[class*="language-"] {
    color: #d4d4d4;
    background: none;
    text-shadow: none;
    font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    font-size: 1em;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    word-wrap: normal;
    line-height: 1.5;
    -moz-tab-size: 4;
    -o-tab-size: 4;
    tab-size: 4;
    -webkit-hyphens: none;
    -moz-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
}

pre[class*="language-"]::-moz-selection, pre[class*="language-"] ::-moz-selection,
code[class*="language-"]::-moz-selection, code[class*="language-"] ::-moz-selection {
    text-shadow: none;
    background: #264f78;
}
pre[class*="language-"]::selection, pre[class*="language-"] ::selection,
code[class*="language-"]::selection, code[class*="language-"] ::selection {
    text-shadow: none;
    background: #264f78;
}

pre[class*="language-"] {
    padding: 1em;
    margin: .5em 0;
    overflow: auto;
    border: 1px solid #3c3c3c;
    border-radius: 0.375rem;
}

:not(pre) > code[class*="language-"],
pre[class*="language-"] {
    background: #1e1e1e;
}

:not(pre) > code[class*="language-"] {
    padding: .1em .4em;
    border-radius: .3em;
    white-space: normal;
    background: #3c3c3c;
}

.token.comment,
.token.prolog,
.token.doctype,
.token.cdata {
    color: #6a9955;
}

.token.punctuation {
    color: #d4d4d4;
}

.token.namespace {
    opacity: .7;
}

.token.property,
.token.tag,
.token.boolean,
.token.number,
.token.constant,
.token.symbol,
.token.deleted {
    color: #b5cea8;
}

.token.selector,
.token.attr-name,
.token.string,
.token.char,
.token.builtin,
.token.inserted {
    color: #ce9178;
}

.token.operator,
.token.entity,
.token.url,
.language-css .token.string,
.style .token.string {
    color: #d4d4d4;
    background: transparent;
}

.token.atrule,
.token.attr-value,
.token.keyword {
    color: #569cd6;
}

.token.function,
.token.class-name {
    color: #dcdcaa;
}

.token.regex,
.token.important,
.token.variable {
    color: #d16969;
}

.token.important,
.token.bold {
    font-weight: bold;
}
.token.italic {
    font-style: italic;
}

/* Prism toolbar — show only on hover, icon-style copy button */
div.code-toolbar > .toolbar {
    opacity: 0;
    transition: opacity 0.2s;
}
div.code-toolbar:hover > .toolbar {
    opacity: 1;
}
div.code-toolbar > .toolbar > .toolbar-item > button,
div.code-toolbar > .toolbar > .toolbar-item > span {
    background: #3c3c3c;
    color: #d4d4d4;
    border-radius: 0.25rem;
    padding: 0.3rem 0.5rem;
    font-size: 0;       /* hide text */
    line-height: 1;
    border: none;
    cursor: pointer;
}
div.code-toolbar > .toolbar > .toolbar-item > button::before {
    content: "\f0c5";   /* FontAwesome copy icon unicode */
    font-family: "Font Awesome 6 Free";
    font-weight: 400;
    font-size: 0.8rem;
}
div.code-toolbar > .toolbar > .toolbar-item > button:hover {
    background: #505050;
}

/* ============================================================
   C# code blocks (old-style .csharpcode) — dark theme
   ============================================================ */
.csharpcode, pre.csharpcode {
    font-size: small;
    color: #d4d4d4;
    font-family: Consolas, 'Courier New', monospace;
    background-color: #1e1e1e;
    border: 1px solid #3c3c3c;
    border-radius: 0.375rem;
    padding: 1rem;
    overflow-x: auto;
}
.csharpcode .rem { color: #6a9955; }
.csharpcode .kwrd { color: #569cd6; }
.csharpcode .str { color: #ce9178; }
.csharpcode .op { color: #d4d4d4; }
.csharpcode .preproc { color: #c586c0; }
.csharpcode .html { color: #808080; }
.csharpcode .attr { color: #9cdcfe; }
.csharpcode .alt { background-color: #252526; }
.csharpcode .lnum { color: #858585; }

/* ============================================================
   Changelog timeline
   ============================================================ */
.changelog-timeline {
    position: relative;
    padding-left: 1.5rem;
}
.changelog-timeline::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    background-color: #3c3c3c;
}
.changelog-item {
    position: relative;
    padding-bottom: 1.5rem;
}
.changelog-item::before {
    content: '';
    position: absolute;
    left: -1.25rem;
    top: 0.5rem;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #3c3c3c;
    border: 2px solid #252526;
}
.changelog-item:first-child::before {
    background-color: #BF1E2E;
}

/* ============================================================
   Tab bar
   ============================================================ */
.tab-active {
    background-color: #1e1e1e;
    border-top: 2px solid #BF1E2E;
    color: #ffffff;
}
.tab-inactive {
    border-top: 2px solid transparent;
    color: #858585;
}
.tab-inactive:hover {
    background-color: rgba(60, 60, 60, 0.3);
}

/* Sidebar active item */
/* Sidebar links — immune to Bootstrap spacing overrides */
#sidebar nav ul a,
#sidebar nav .flex.flex-col a {
    border-left: 2px solid transparent;
    padding: 0.5rem 0.75rem !important;
}
#sidebar nav p {
    padding: 0 0.5rem !important;
}
#sidebar #mobile-menu-btn {
    padding: 0.5rem !important;
}
#sidebar nav a.sidebar-active {
    background-color: rgba(60, 60, 60, 0.5);
    color: #ffffff;
    font-weight: 500;
    border-left-color: #BF1E2E;
}

/* ============================================================
   GLOBAL input/textarea/select dark theme
   Applied to ALL inputs on the public site
   ============================================================ */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
input[type="search"],
input[type="tel"],
textarea,
select,
.form-control {
    background-color: #2d2d2d !important;
    border: 1px solid #4a4a4a !important;
    color: #ffffff !important;
    padding: 0.6rem 0.85rem;
    border-radius: 6px;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    box-sizing: border-box;
}
/* Full width for form-dark inputs (contact, comments) */
.form-dark input[type="text"],
.form-dark input[type="email"],
.form-dark input[type="password"],
.form-dark textarea,
.form-dark select {
    width: 100%;
}
/* Bootstrap form-control inside flex rows should NOT be forced to 100% width */
.form-row .form-control,
.form-row input[type="text"],
.row .form-control,
.row input[type="text"],
.form-inline .form-control,
.form-inline input[type="text"] {
    width: auto;
    flex: 1 1 0%;
}
/* Standalone form-control gets full width */
.form-group > .form-control {
    width: 100%;
}
/* Vertical spacing between Bootstrap form-groups */
.calc-dark .form-group {
    margin-bottom: 0.75rem;
}
/* Spacing between form-rows */
.calc-dark .form-row {
    margin-bottom: 0.25rem;
}
/* Bootstrap .row and .form-row need flex — Tailwind preflight strips it */
.row,
.form-row {
    display: flex !important;
    flex-wrap: wrap;
    margin-left: -5px;
    margin-right: -5px;
}
.row > .col,
.form-row > .col,
.form-row > .form-control.col {
    flex: 1 1 0%;
    max-width: 100%;
    padding-left: 5px;
    padding-right: 5px;
    box-sizing: border-box;
}
/* form-inline also needs flex */
.form-inline,
.form-check.form-inline {
    display: flex !important;
    align-items: center;
    gap: 0.5rem;
}
.form-inline .form-control {
    width: auto;
    flex: 0 0 auto;
}
textarea,
textarea.form-control {
    padding: 0.6rem 0.85rem !important;
    resize: vertical;
    min-height: 110px;
}
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="url"]:hover,
input[type="search"]:hover,
input[type="tel"]:hover,
textarea:hover,
select:hover,
.form-control:hover {
    border-color: #666 !important;
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
input[type="search"]:focus,
input[type="tel"]:focus,
textarea:focus,
select:focus,
.form-control:focus {
    outline: none;
    border-color: #BF1E2E !important;
    box-shadow: 0 0 0 2px rgba(191, 30, 46, 0.25) !important;
    background-color: #333 !important;
    color: #ffffff !important;
}
input::placeholder,
textarea::placeholder,
.form-control::placeholder {
    color: #777 !important;
}

/* Labels */
label {
    color: #d4d4d4;
}
.form-dark label {
    display: block;
    margin-bottom: 0.375rem;
    color: #d4d4d4;
    font-size: 0.85rem;
    font-weight: 500;
}

/* Validation */
.field-validation-error {
    color: #f14c4c;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
.input-validation-error {
    border-color: #f14c4c !important;
}
.validation-summary-errors {
    color: #f14c4c;
    font-size: 0.875rem;
}

/* Buttons (Bootstrap override for calc) */
.btn-primary {
    background-color: #BF1E2E !important;
    border-color: #BF1E2E !important;
    color: #ffffff !important;
    border-radius: 6px;
    padding: 0.5rem 1rem;
    transition: background-color 0.15s;
    cursor: pointer;
}
.btn-primary:hover,
.btn-primary:focus {
    background-color: #a01a27 !important;
    border-color: #a01a27 !important;
}

/* ============================================================
   Application image in list
   ============================================================ */
.app-image-container {
    position: relative;
    height: 16rem;
    overflow: hidden;
    background-color: #2d2d2d;
}
.app-image-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}
/* Fallback icon when no image */
.app-image-container.app-no-image {
    height: 10rem;
}

/* AnchorJs overloads */
.anchorjs-link {
    color: #BF1E2E !important;
}
.anchorjs-link:hover {
    text-decoration: none;
}

/* ============================================================
   Numerical calculator — card/alert overrides
   ============================================================ */
.calc-dark .card {
    background-color: #252526;
    border-color: #3c3c3c;
}
.calc-dark .card-body {
    color: #d4d4d4;
}
.calc-dark .text-muted {
    color: #858585 !important;
}
.calc-dark .alert-danger {
    background-color: rgba(241, 76, 76, 0.15);
    border-color: #f14c4c;
    color: #f14c4c;
}
.calc-dark .alert-success {
    background-color: rgba(106, 153, 85, 0.15);
    border-color: #6a9955;
    color: #6a9955;
}
