/*
    app.css - Main application stylesheet

    This file contains global styles for the MacPhail Electric website.
    Component-specific styles have been moved to their respective {component}.razor.css files.

    Structure:
    1. Global styles and base elements
    2. Bootstrap overrides and customizations
    3. Blazor-specific styles and error handling
    4. Utility classes and responsive adjustments

    Customization Guide:
    - Colors: Update CSS custom properties in :root
    - Typography: Modify font-family and font-size values
    - Spacing: Adjust padding and margin values
    - Animations: Modify transition and animation properties

    Component Styles:
    - HeroSection.razor.css - Hero section and business card styles
    - ServicesSection.razor.css - Service cards and section styling
    - GallerySection.razor.css - Gallery item hover effects
    - Footer.razor.css - Footer section and contact form styles
    - MainLayout.razor.css - Floating header and navigation
    - ContactForm.razor.css - Contact form page styles
*/

/* ===== GLOBAL STYLES ===== */
html,
body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    scroll-behavior: smooth;
}

h1:focus {
    outline: none;
}

a,
.btn-link {
    color: #0071c1;
}

.btn-primary {
    color: #fff;
    background-color: #1b6ec2;
    border-color: #1861ac;
}

.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 #258cfb;
}

/* ===== UTILITY CLASSES ===== */
.text-gradient {
    background: linear-gradient(45deg, #007bff, #28a745);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
}

.bg-gradient-success {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
}

/* Z-index utilities */
.z-3 {
    z-index: 3;
}

/* Section utilities */
.section {
    padding: 80px 0;
}

/* Background utilities */
.hero-background {
    /* Default background - overridden by component-specific styles */
}

.particles-canvas {
    /* Default canvas positioning - overridden by component-specific styles */
}

.energy-ball-canvas {
    /* Default canvas positioning - overridden by component-specific styles */
}

/* ===== VALIDATION STYLES ===== */
.valid.modified:not([type=checkbox]) {
    outline: 1px solid #26b050;
}

.invalid {
    outline: 1px solid red;
}

.validation-message {
    color: red;
}

#blazor-error-ui {
    color-scheme: light only;
    background: lightyellow;
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, 0.2);
    box-sizing: border-box;
    display: none;
    left: 0;
    padding: 0.6rem 1.25rem 0.7rem 1.25rem;
    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-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem 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: #1b6ec2;
    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: #c02d76;
}

/* ===== CUSTOM TOAST STYLING ===== */
.bb-toast {
    border: none !important;
    border-radius: 12px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12) !important;
    backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95) !important;
    border-left: 4px solid !important;
    margin-bottom: 0.75rem !important;
    min-width: 320px !important;
    max-width: 400px !important;
    animation: toastSlideIn 0.3s ease-out;
}

.bb-toast-header {
    background: transparent !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05) !important;
    padding: 1rem 1rem 0.75rem 1rem !important;
    border-radius: 12px 12px 0 0 !important;
}

.bb-toast-title {
    font-weight: 600 !important;
    font-size: 0.875rem !important;
    color: #1a202c !important;
    margin: 0 !important;
}

.bb-toast-close {
    background: transparent !important;
    border: none !important;
    color: #718096 !important;
    font-size: 1.125rem !important;
    padding: 0 !important;
    width: 24px !important;
    height: 24px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
}

.bb-toast-close:hover {
    background: rgba(0, 0, 0, 0.05) !important;
    color: #4a5568 !important;
}

.bb-toast-body {
    padding: 0.75rem 1rem 1rem 1rem !important;
    color: #4a5568 !important;
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.bb-toast-help-text {
    font-size: 0.75rem !important;
    color: #718096 !important;
    margin-top: 0.25rem !important;
    font-style: italic !important;
}

/* Toast Type Colors */
.bb-toast.bb-toast-success {
    border-left-color: #10b981 !important;
}

.bb-toast.bb-toast-success .bb-toast-title {
    color: #065f46 !important;
}

.bb-toast.bb-toast-info {
    border-left-color: #3b82f6 !important;
}

.bb-toast.bb-toast-info .bb-toast-title {
    color: #1e40af !important;
}

.bb-toast.bb-toast-warning {
    border-left-color: #f59e0b !important;
}

.bb-toast.bb-toast-warning .bb-toast-title {
    color: #92400e !important;
}

.bb-toast.bb-toast-danger {
    border-left-color: #ef4444 !important;
}

.bb-toast.bb-toast-danger .bb-toast-title {
    color: #991b1b !important;
}

@keyframes toastSlideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Mobile Toast */
@media (max-width: 768px) {
    .bb-toast {
        min-width: 280px !important;
        max-width: calc(100vw - 2rem) !important;
        margin: 0 1rem 0.75rem 1rem !important;
    }

    .bb-toast-header {
        padding: 0.75rem 0.75rem 0.5rem 0.75rem !important;
    }

    .bb-toast-body {
        padding: 0.5rem 0.75rem 0.75rem 0.75rem !important;
    }
}

.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;
}

/* ===== SPLASH SCREEN ===== */
.splash-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #0a1929;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.splash-screen .particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Blueprint grid overlay */
.splash-screen::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        linear-gradient(rgba(59, 130, 246, 0.15) 1px, transparent 1px),
        linear-gradient(90deg, rgba(59, 130, 246, 0.15) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: gridMove 20s linear infinite;
    opacity: 0.4;
}

@keyframes gridMove {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

/* Logo container */
.splash-logo {
    position: relative;
    z-index: 2;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.splash-logo img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    animation: logoPulse 2s ease-in-out infinite;
    border: 2px solid rgba(59, 130, 246, 0.3);
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 0 30px rgba(59, 130, 246, 0.5);
    }

    50% {
        transform: scale(1.1);
        box-shadow: 0 0 50px rgba(59, 130, 246, 0.8);
    }
}

/* Company name */
.splash-company-name {
    font-size: 2.5rem;
    font-weight: 700;
    color: #ffffff;
    text-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    animation: textGlow 3s ease-in-out infinite;
    letter-spacing: 2px;
}

@keyframes textGlow {

    0%,
    100% {
        text-shadow: 0 0 20px rgba(59, 130, 246, 0.8);
    }

    50% {
        text-shadow: 0 0 30px rgba(59, 130, 246, 1);
    }
}

/* Tagline */
.splash-tagline {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    letter-spacing: 1px;
    animation: fadeInUp 1s ease-out 0.5s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading progress */
.splash-loading {
    width: 200px;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    overflow: hidden;
    position: relative;
}

.splash-loading-bar {
    height: 100%;
    background: #3b82f6;
    animation: loadingProgress 2s ease-in-out infinite;
    border-radius: 2px;
}

@keyframes loadingProgress {
    0% {
        width: 0%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}



/* Hide splash screen when app is loaded */
.splash-screen.hidden {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease-out, visibility 0.5s ease-out;
}

/* Original loading progress - keeping for fallback */
.loading-progress {
    position: relative;
    display: block;
    width: 8rem;
    height: 8rem;
    margin: 20vh auto 1rem 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: #1b6ec2;
    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");
}

.bb-toast {
    border: 4px solid red !important;
}
