/* ============================================
   NEXTGEN - Modern CSS Styles
   ============================================ */

/* ----- BASE STYLES ----- */
html, body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

* {
    box-sizing: border-box;
}

h1:focus {
    outline: none;
}

a, .btn-link {
    color: #3D3D3D;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover, .btn-link:hover {
    color: #555555;
}

/* ----- BUTTONS ----- */
.btn-primary {
    color: #fff;
    background: linear-gradient(135deg, #3D3D3D 0%, #2D2D2D 100%);
    border: none;
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-weight: 600;
    transition: opacity 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 12px rgba(61, 61, 61, 0.3);
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 6px 20px rgba(61, 61, 61, 0.4);
}

.btn-primary:active {
    opacity: 0.8;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #3D3D3D;
}

/* ----- LAYOUT ----- */
.content {
    padding-top: 1.1rem;
    min-height: calc(100vh - 100px);
}

/* ----- FORMS ----- */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
    border-color: #26b050;
}

.invalid {
    outline: 1px solid #e74c3c;
    border-color: #e74c3c;
}

.validation-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* ----- ANIMATIONS ----- */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.slide-up {
    animation: slideUp 0.6s ease-out;
}

.scale-in {
    animation: scaleIn 0.4s ease-out;
}

/* ----- CARDS ----- */
.card-hover {
    transition: box-shadow 0.3s ease;
}

.card-hover:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

/* ----- ERROR UI ----- */
#blazor-error-ui {
    color-scheme: light only;
    background: #fff3cd;
    border-top: 3px solid #ffc107;
    bottom: 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.1);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 1rem 1.5rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    position: absolute;
    right: 0.75rem;
    top: 0.5rem;
}

.blazor-error-boundary {
    background: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTYiIGhlaWdodD0iNDkiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIG92ZXJmbG93PSJoaWRkZW4iPjxkZWZzPjxjbGlwUGF0aCBpZD0iY2xpcDAiPjxyZWN0IHg9IjIzNSIgeT0iNTEiIHdpZHRoPSI1NiIgaGVpZ2h0PSI0OSIvPjwvY2xpcFBhdGg+PC9kZWZzPjxnIGNsaXAtcGF0aD0idXJsKCNjbGlwMCkiIHRyYW5zZm9ybT0idHJhbnNsYXRlKC0yMzUgLTUxKSI+PHBhdGggZD0iTTI2My41MDYgNTFDMjY0LjcxNyA1MSAyNjUuODEzIDUxLjQ4MzcgMjY2LjYwNiA1Mi4yNjU4TDI2Ny4wNTIgNTIuNzk4NyAyNjcuNTM5IDUzLjYyODMgMjkwLjE4NSA5Mi4xODMxIDI5MC41NDUgOTIuNzk1IDI5MC42NTYgOTIuOTk2QzI5MC44NzcgOTMuNTEzIDI5MSA5NC4wODE1IDI5MSA5NC42NzgyIDI5MSA5Ny4wNjUxIDI4OS4wMzggOTkgMjg2LjYxNyA5OUwyNDAuMzgzIDk5QzIzNy45NjMgOTkgMjM2IDk3LjA2NTEgMjM2IDk0LjY3ODIgMjM2IDk0LjM3OTkgMjM2LjAzMSA5NC4wODg2IDIzNi4wODkgOTMuODA3MkwyMzYuMzM4IDkzLjAxNjIgMjM2Ljg1OCA5Mi4xMzE0IDI1OS40NzMgNTMuNjI5NCAyNTkuOTYxIDUyLjc5ODUgMjYwLjQwNyA1Mi4yNjU4QzI2MS4yIDUxLjQ4MzcgMjYyLjI5NiA1MSAyNjMuNTA2IDUxWk0yNjMuNTg2IDY2LjAxODNDMjYwLjczNyA2Ni4wMTgzIDI1OS4zMTMgNjcuMTI0NSAyNTkuMzEzIDY5LjMzNyAyNTkuMzEzIDY5LjYxMDIgMjU5LjMzMiA2OS44NjA4IDI1OS4zNzEgNzAuMDg4N0wyNjEuNzk1IDg0LjAxNjEgMjY1LjM4IDg0LjAxNjEgMjY3LjgyMSA2OS43NDc1QzI2Ny44NiA2OS43MzA5IDI2Ny44NzkgNjkuNTg3NyAyNjcuODc5IDY5LjMxNzkgMjY3Ljg3OSA2Ny4xMTgyIDI2Ni40NDggNjYuMDE4MyAyNjMuNTg2IDY2LjAxODNaTTI2My41NzYgODYuMDU0N0MyNjEuMDQ5IDg2LjA1NDcgMjU5Ljc4NiA4Ny4zMDA1IDI1OS43ODYgODkuNzkyMSAyNTkuNzg2IDkyLjI4MzcgMjYxLjA0OSA5My41Mjk1IDI2My41NzYgOTMuNTI5NSAyNjYuMTE2IDkzLjUyOTUgMjY3LjM4NyA5Mi4yODM3IDI2Ny4zODcgODkuNzkyMSAyNjcuMzg3IDg3LjMwMDUgMjY2LjExNiA4Ni4wNTQ3IDI2My41NzYgODYuMDU0N1oiIGZpbGw9IiNGRkU1MDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIvPjwvZz48L3N2Zz4=) no-repeat 1rem/1.8rem, #b32121;
    padding: 1rem 1rem 1rem 3.7rem;
    color: white;
}

.blazor-error-boundary::after {
    content: "An error has occurred."
}

/* ----- LOADING ----- */
.loading-progress {
    position: absolute;
    display: block;
    width: 8rem;
    height: 8rem;
    inset: 20vh 0 auto 0;
    margin: 0 auto 0 auto;
}

.loading-progress circle {
    fill: none;
    stroke: #e0e0e0;
    stroke-width: 0.6rem;
    transform-origin: 50% 50%;
    transform: rotate(-90deg);
}

.loading-progress circle:last-child {
stroke: #3D3D3D;
    stroke-dasharray: calc(3.141 * var(--blazor-load-percentage, 0%) * 0.8), 500%;
    transition: stroke-dasharray 0.05s ease-in-out;
}

.loading-progress-text {
    position: absolute;
    text-align: center;
    font-weight: bold;
    inset: calc(20vh + 3.25rem) 0 auto 0.2rem;
}

.loading-progress-text:after {
    content: var(--blazor-load-percentage-text, "Loading");
}

code {
    color: #3D3D3D;
    background-color: #f4f4f4;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

/* ----- UTILITIES ----- */
.hover-lift {
    transition: box-shadow 0.3s ease;
}

.hover-lift:hover {
    box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
}

.glow-effect {
    box-shadow: 0 0 30px rgba(61, 61, 61, 0.3);
}

/* ----- MudBlazor Overrides for Admin Panel ----- */
.mud-nav-link:hover {
    background-color: rgba(61, 61, 61, 0.08) !important;
}

.mud-nav-link.active {
    background-color: rgba(61, 61, 61, 0.12) !important;
    color: #3D3D3D !important;
}

/* ----- RESPONSIVE ----- */
@media (max-width: 768px) {
    .content {
        padding: 0.5rem;
    }
    
    .btn-primary {
        padding: 0.5rem 1rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
    color: var(--bs-secondary-color);
    text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
    text-align: start;
}

/* Modern Test Cards Styles with Animations */
.test-cards-container {
    padding: 2rem 0;
}

.test-card {
    height: 100%;
    border: none;
    border-radius: 16px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    overflow: hidden;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.test-card:nth-child(1) { animation-delay: 0.1s; }
.test-card:nth-child(2) { animation-delay: 0.2s; }
.test-card:nth-child(3) { animation-delay: 0.3s; }
.test-card:nth-child(4) { animation-delay: 0.4s; }
.test-card:nth-child(5) { animation-delay: 0.5s; }
.test-card:nth-child(6) { animation-delay: 0.6s; }

.test-card:hover {
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.test-card-body {
    padding: 2rem;
    position: relative;
}

.test-card-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.test-card-description {
    color: #5a6c7d;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.test-card-info {
    background: rgba(27, 110, 194, 0.05);
    padding: 1rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.test-info-item {
    display: flex;
    align-items: center;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.test-info-item:last-child {
    margin-bottom: 0;
}

.test-info-label {
    font-weight: 600;
    min-width: 140px;
    color: #1b6ec2;
}

.test-info-value {
    color: #2c3e50;
}

.test-card-btn {
    width: 100%;
    padding: 0.875rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #1b6ec2 0%, #1557a0 100%);
    color: white;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.test-card-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.test-card-btn:hover::before {
    left: 100%;
}

.test-card-btn:hover {
    box-shadow: 0 8px 20px rgba(27, 110, 194, 0.4);
}

.price-badge {
    display: inline-block;
    background: linear-gradient(135deg, #28a745 0%, #20873a 100%);
    color: white;
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 10px rgba(40, 167, 69, 0.3);
}

.page-header {
    text-align: center;
    margin-bottom: 3rem;
    animation: fadeIn 0.8s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: #2c3e50;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #1b6ec2 0%, #5b9bd5 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.loading-spinner {
    text-align: center;
    padding: 4rem;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.no-tests-message {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
    font-size: 1.25rem;
    animation: fadeIn 0.8s ease-out;
}

.test-date-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(108, 117, 125, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

.test-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 193, 7, 0.1);
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-size: 0.95rem;
}

/* General Public Pages Animations */
.fade-in {
    animation: fadeIn 0.8s ease-out;
}

.slide-up {
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.scale-in {
    animation: scaleIn 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* MudBlazor component enhancements */
.mud-paper {
    transition: box-shadow 0.3s ease;
}

.mud-paper:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15) !important;
}

.mud-card {
    transition: box-shadow 0.3s ease;
}

.mud-card:hover {
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2) !important;
}

.mud-button {
    transition: opacity 0.3s ease;
}

.mud-button:hover {
    opacity: 0.9;
}

/* Hero section animations */
.hero-text {
    animation: fadeInLeft 1s ease-out;
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-image {
    animation: fadeInRight 1s ease-out;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Feature cards stagger animation */
.feature-card {
    opacity: 0;
    animation: fadeInUp 0.6s ease-out forwards;
}

.feature-card:nth-child(1) { animation-delay: 0.1s; }
.feature-card:nth-child(2) { animation-delay: 0.2s; }
.feature-card:nth-child(3) { animation-delay: 0.3s; }
.feature-card:nth-child(4) { animation-delay: 0.4s; }
.feature-card:nth-child(5) { animation-delay: 0.5s; }
.feature-card:nth-child(6) { animation-delay: 0.6s; }

/* Smooth scroll behavior */
html {
    scroll-behavior: smooth;
}

/* Loading state improvements */
.loading-overlay {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
    animation: pulse 1.5s ease-in-out infinite;
}

/* Form animations */
.form-field {
    transition: box-shadow 0.3s ease;
}

.form-field:focus-within {
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.3);
}

/* Button ripple effect */
@keyframes ripple {
    0% {
        transform: scale(0);
        opacity: 1;
    }
    100% {
        transform: scale(4);
        opacity: 0;
    }
}

/* Shimmer loading effect */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.shimmer {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(to right, #f0f0f0 4%, #e0e0e0 25%, #f0f0f0 36%);
    background-size: 1000px 100%;
}

/* Bounce animation for call-to-action */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.bounce-on-hover:hover {
    animation: bounce 1s;
}

/* Glow effect */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 5px rgba(27, 110, 194, 0.5);
    }
    50% {
        box-shadow: 0 0 20px rgba(27, 110, 194, 0.8);
    }
}

.glow-effect {
    animation: glow 2s ease-in-out infinite;
}

/* Rotate animation for icons */
@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.rotate-on-hover:hover {
    animation: rotate 0.6s ease-in-out;
}