/* Brand fonts & styles for Foresight Engineering */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Montserrat:wght@500;700;800&family=Playfair+Display:ital,wght@0,600;0,700;1,500;1,600;1,700&family=Dancing+Script:wght@500;600;700&display=swap');

/* Modern CSS Variables for trendy design */
:root {
    --fe-red: #960505;
    --fe-dark: #5a5858;
    --fe-gradient-start: #960505;
    --fe-gradient-end: #c41e3a;
    --fe-glass-bg: rgba(255, 255, 255, 0.1);
    --fe-glass-border: rgba(255, 255, 255, 0.2);
    --fe-shadow-soft: 0 8px 32px rgba(0, 0, 0, 0.1);
    --fe-shadow-hover: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Screen reader only content for SEO */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Remove duplicate :root - already defined above */

html, body {
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    color: #222;
}

.fe-heading {
    font-family: Montserrat, Inter, ui-sans-serif, system-ui;
    letter-spacing: 0.01em;
    color: var(--fe-dark);
}

.fe-accent-border {
    border-color: var(--fe-red) !important;
}

.fe-accent-text {
    color: var(--fe-red) !important;
}

.fe-accent-bg {
    background-color: rgba(150, 5, 5, 0.06) !important;
}

/* Slightly scripty, professional heading style */
.fe-scripted {
    font-family: 'Dancing Script', 'Playfair Display', Montserrat, Inter, ui-sans-serif, system-ui;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 0.005em;
}

/* Ensure content sits above explicit overlay */
.content-above-overlay > * {
    position: relative;
    z-index: 1;
}

/* Alternative explicit overlay in DOM */
.fe-brand-overlay {
    position: absolute;
    inset: 0;
    background: url('/static/images/fs-logo.svg') no-repeat center 140px;
    background-size: 50% auto;
    opacity: 0.2;
    pointer-events: none;
    z-index: 0;
}

/* Brand buttons */
.btn-brand {
    background-color: var(--fe-red);
    color: #ffffff;
    padding: 0.75rem 2rem;
    border-radius: 0.5rem;
    font-weight: 600;
    display: inline-block;
}
.btn-brand:hover { background-color: #7a0404; }

.btn-brand-outline {
    color: var(--fe-red);
    border: 2px solid var(--fe-red);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    font-weight: 600;
    background-color: #ffffff;
    display: inline-block;
}
.btn-brand-outline:hover { background-color: rgba(150, 5, 5, 0.06); }

/* Accent borders */
.fe-left-accent { border-left: 4px solid var(--fe-red); }
.fe-card-accent { border: 2px solid var(--fe-red); border-radius: 0.75rem; }

/* Smooth transitions */
* {
    transition: all 0.2s ease-in-out;
}

/* Custom button styles */
.btn-primary {
    @apply bg-blue-600 text-white px-6 py-2 rounded-lg hover:bg-blue-700 transition-colors;
}

.btn-secondary {
    @apply bg-gray-600 text-white px-6 py-2 rounded-lg hover:bg-gray-700 transition-colors;
}

/* Card hover effects */
.service-card {
    @apply bg-white p-6 rounded-lg shadow-md hover:shadow-lg transition-shadow;
}

/* Form styles */
.form-input {
    @apply w-full px-3 py-2 border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent;
}

.form-label {
    @apply block text-sm font-medium text-gray-700 mb-2;
}

/* Loading animation */
.loading {
    @apply animate-spin rounded-full h-8 w-8 border-b-2 border-blue-600;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* PDF Viewer Styles */
.pdf-viewer-container {
    position: relative;
    background: transparent;
    border-radius: 0.5rem;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: fit-content;
    min-height: 350px;
}

.pdf-viewer-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
}

.pdf-viewer-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.pdf-viewer-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem;
    border: 2px solid var(--fe-red);
    border-radius: 0.375rem;
    background: white;
    color: var(--fe-red);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    min-width: 2.5rem;
    height: 2.5rem;
}

.pdf-viewer-btn:hover {
    background: var(--fe-red);
    color: white;
}

.pdf-viewer-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pdf-viewer-btn:disabled:hover {
    background: white;
    color: var(--fe-red);
}

.pdf-page-info {
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
}

.pdf-canvas-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: fit-content;
    min-height: 300px;
    padding: 0.5rem;
    background: white;
    overflow-y: auto;
}

.pdf-canvas {
    max-width: 100%;
    height: auto;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0.375rem;
}

/* PDF canvas hover effect to match card hover */
.fe-card-hover:hover .pdf-canvas-container {
    background: linear-gradient(135deg, rgba(150, 5, 5, 0.02) 0%, rgba(196, 30, 58, 0.02) 100%), white;
}

/* PDF Overlay Navigation */
.pdf-overlay-nav {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
}

.pdf-overlay-btn {
    pointer-events: auto;
    background: rgba(0, 0, 0, 0.25);
    color: white;
    border: none;
    border-radius: 50%;
    width: 3rem;
    height: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    opacity: 0.4;
}

.pdf-overlay-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    opacity: 0.7;
    transform: scale(1.1);
}

.pdf-overlay-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.pdf-overlay-btn-left {
    margin-left: 0.5rem;
}

.pdf-overlay-btn-right {
    margin-right: 0.5rem;
}

/* Responsive text */
@media (max-width: 640px) {
    .text-4xl {
        font-size: 2rem;
    }
    
    .text-xl {
        font-size: 1.125rem;
    }
    
    .pdf-viewer-controls {
        flex-direction: column;
        gap: 1rem;
    }
    
    .pdf-viewer-nav {
        order: 2;
    }
    
    .pdf-page-info {
        order: 1;
    }
}

/* Brand logo hover effects */
.brand-logo {
    filter: grayscale(100%) brightness(0.8);
    transition: filter 0.3s ease, transform 0.3s ease;
}

.brand-logo:hover {
    filter: grayscale(0%) brightness(1);
    transform: scale(1.50);
}

/* LinkedIn icon hover effects */
.linkedin-icon {
    transition: transform 0.3s ease;
}

.linkedin-icon:hover {
    transform: scale(1.35);
}

/* Modern trendy design elements */
.fe-gradient-bg {
    background: linear-gradient(135deg, var(--fe-gradient-start), var(--fe-gradient-end));
}

.fe-glass-card {
    background: var(--fe-glass-bg);
    backdrop-filter: blur(10px);
    border: 1px solid var(--fe-glass-border);
    box-shadow: var(--fe-shadow-soft);
}

.fe-card-hover {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.fe-card-hover:hover {
    box-shadow: var(--fe-shadow-hover);
}

.fe-card-hover:hover::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(150, 5, 5, 0.02) 0%, rgba(196, 30, 58, 0.02) 100%);
    border-radius: inherit;
    pointer-events: none;
    z-index: 1;
}

.fe-card-hover > * {
    position: relative;
    z-index: 2;
}

/* Special handling for navigation buttons with rounded borders - keep upward lift for header links */
.fe-card-hover.rounded-full {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.fe-card-hover.rounded-full:hover {
    transform: translateY(-8px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background-color: rgba(150, 5, 5, 0.08);
}

.fe-card-hover.rounded-full:hover::before {
    display: none;
}



/* Modern button styles */
.fe-btn-modern {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

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

.fe-btn-modern:hover::before {
    left: 100%;
}


/* Gradient text */
.fe-gradient-text {
    background: linear-gradient(135deg, var(--fe-gradient-start), var(--fe-gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Small dashed line for header divider */
.fe-small-dashed-line {
    border-top: 1px dashed #d1d5db;
    background-image: repeating-linear-gradient(
        to right,
        #d1d5db 0px,
        #d1d5db 2px,
        transparent 2px,
        transparent 4px
    );
    background-size: 4px 1px;
    background-repeat: repeat-x;
    background-position: 0 0;
}

/* Global modal centering when hCaptcha is open */
body.hcaptcha-open {
    overflow: hidden !important;
    position: relative !important;
    transform: none !important;
}

/* Disable all transforms on page elements when captcha is open */
body.hcaptcha-open * {
    transform: none !important;
}

/* Global rule: Any fixed or absolute positioned element should center when captcha is open */
body.hcaptcha-open [style*="position: fixed"],
body.hcaptcha-open [style*="position:absolute"],
body.hcaptcha-open [style*="position: fixed"],
body.hcaptcha-open [style*="position: absolute"] {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 999999 !important;
    margin: 0 !important;
}

/* Target any element that might be a modal or overlay */
body.hcaptcha-open div[style*="position"],
body.hcaptcha-open iframe[style*="position"],
body.hcaptcha-open [class*="modal"],
body.hcaptcha-open [class*="overlay"],
body.hcaptcha-open [class*="popup"],
body.hcaptcha-open [class*="dialog"] {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 999999 !important;
    margin: 0 !important;
}

/* Specific targeting for hCaptcha elements */
body.hcaptcha-open [class*="hcaptcha"],
body.hcaptcha-open [id*="hcaptcha"],
body.hcaptcha-open iframe[src*="hcaptcha"] {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 999999 !important;
    margin: 0 !important;
}

/* Ensure viewport is properly set for modal centering */
body.hcaptcha-open {
    width: 100vw !important;
    height: 100vh !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Force any element with inline styles that might be a modal */
body.hcaptcha-open [style*="top"],
body.hcaptcha-open [style*="left"],
body.hcaptcha-open [style*="right"],
body.hcaptcha-open [style*="bottom"] {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    z-index: 999999 !important;
    margin: 0 !important;
}

/* hCaptcha will work with default styling */
