.template-desc h2 {
    margin-top: 2.5rem !important;
}

/* Blazor validation: force validation messages to display.
   Bootstrap expects .is-invalid on inputs, but Blazor uses .invalid/.valid classes. */
.validation-message {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: var(--bs-danger, #F8285A);
}

/* Red border on invalid Blazor inputs */
.form-control.invalid,
.form-control.modified.invalid,
.form-select.invalid,
.form-select.modified.invalid {
    border-color: var(--bs-danger, #F8285A) !important;
}

/* Green border on valid Blazor inputs (after user interaction) */
.form-control.modified.valid,
.form-select.modified.valid {
    border-color: var(--bs-success, #17C653) !important;
}

.card-hover-shadow {
    transition: all 0.2s ease;
    cursor: pointer;
}

.card-hover-shadow:hover {
    box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
    border-color: var(--bs-primary) !important;
    transform: translateY(-2px);
}

/* ========================================
   TEMPLATE SYSTEM STYLES
   ======================================== */

/* Template markdown content styling */
.template-desc {
    line-height: 1.8;
    color: #3f4254;
}

.template-desc h1,
.template-desc h2,
.template-desc h3,
.template-desc h4 {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    font-weight: 600;
    color: #181c32;
}

.template-desc h1 {
    font-size: 2rem;
    border-bottom: 2px solid #e4e6ef;
    padding-bottom: 0.5rem;
}

.template-desc h2 {
    font-size: 1.75rem;
}

.template-desc h3 {
    font-size: 1.5rem;
}

.template-desc h4 {
    font-size: 1.25rem;
}

.template-desc p {
    margin-bottom: 1rem;
}

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

.template-desc li {
    margin-bottom: 0.5rem;
}

.template-desc code {
    background-color: #f1f3f5;
    color: #e91e63;
    padding: 0.2rem 0.5rem;
    border-radius: 0.375rem;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9em;
    font-weight: 600;
}

.template-desc pre {
    background-color: #1e1e1e;
    color: #d4d4d4;
    padding: 1.25rem;
    border-radius: 0.625rem;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid #2d2d2d;
}

.template-desc pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-weight: normal;
    border-radius: 0;
}

.template-desc blockquote {
    border-left: 4px solid #009ef7;
    padding-left: 1rem;
    margin-left: 0;
    margin-bottom: 1.5rem;
    color: #5e6278;
    font-style: italic;
    background-color: #f9fafb;
    padding: 1rem;
    border-radius: 0.375rem;
}

.template-desc a {
    color: #009ef7;
    text-decoration: none;
    font-weight: 500;
}

.template-desc a:hover {
    text-decoration: underline;
}

.template-desc table {
    width: 100%;
    margin-bottom: 1.5rem;
    border-collapse: collapse;
}

.template-desc table th,
.template-desc table td {
    padding: 0.75rem;
    border: 1px solid #e4e6ef;
}

.template-desc table th {
    background-color: #f9fafb;
    font-weight: 600;
    text-align: left;
}

.template-desc hr {
    border: 0;
    border-top: 2px solid #e4e6ef;
    margin: 2rem 0;
}

.template-desc img {
    max-width: 100%;
    height: auto;
    border-radius: 0.625rem;
    margin: 1rem 0;
}

/* Template card animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.template-card {
    animation: slideInUp 0.4s ease-out;
}

/* Stagger animation for grid items */
.template-card:nth-child(1) {
    animation-delay: 0s;
}

.template-card:nth-child(2) {
    animation-delay: 0.05s;
}

.template-card:nth-child(3) {
    animation-delay: 0.1s;
}

.template-card:nth-child(4) {
    animation-delay: 0.15s;
}

.template-card:nth-child(5) {
    animation-delay: 0.2s;
}

.template-card:nth-child(6) {
    animation-delay: 0.25s;
}

/* Badge enhancements */
.badge-lg {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Smooth transitions for filters */
.form-select,
.form-control,
.form-check-input {
    transition: all 0.2s ease;
}

.form-select:focus,
.form-control:focus {
    box-shadow: 0 0 0 0.25rem rgba(0, 158, 247, 0.15);
}

/* Symbol hover effect */
.symbol:hover {
    transform: scale(1.05);
    transition: transform 0.2s ease;
}

/* Notice box enhancements */
.notice {
    animation: slideInUp 0.3s ease-out;
}

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

    .template-desc h2 {
        font-size: 1.25rem;
    }

    .template-desc pre {
        font-size: 0.8rem;
        padding: 1rem;
    }
}
