/* ============================================
   GOLDIECIRCLE ACCESSIBILITY WIDGET
   508 Compliant | Senior-Focused Design

   @version 1.2.0
   @lastUpdated 2026-01-11

   CHANGELOG:
   ---------------------------------------------------------------------------
   v1.2.0 (2026-01-11) - Claude Opus 4.5
     FIX: Panel positioning - added bottom: auto, left: auto to prevent conflicts
     - Ensures panel stays vertically centered even with other CSS

   v1.1.0 (2026-01-11) - Claude Opus 4.5
     FIX: Page shift when accessibility panel opens
     - Removed body.gc-accessibility-active overflow rules
     - CSS now works with JS "Profile Widget approach"
     - No body modifications = no viewport shift

   v1.0.1 (2026-01-10) - Claude Sonnet 4.5
     - Added overflow-x: hidden to body.gc-accessibility-active
     - Added max-width: 100vw (later removed - caused issues)

   v1.0.0 (Initial)
     - Base widget styles, panel, overlay, controls
     - Quick profiles, font size, contrast options
     - Floating trigger button
   ---------------------------------------------------------------------------
   ============================================ */

/* OPENDYSLEXIC FONT */
@font-face {
    font-family: 'OpenDyslexic';
    src: url('../fonts/OpenDyslexic-Regular.woff2') format('woff2'),
         url('../fonts/OpenDyslexic-Regular.woff') format('woff'),
         url('../fonts/OpenDyslexic-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* NOTE: If OpenDyslexic font files are not available locally,
   the dyslexia-friendly font feature will gracefully fall back to Arial.
   To enable full dyslexia support, download OpenDyslexic from:
   https://opendyslexic.org/ and place font files in /assets/fonts/ */

/* TRIGGER BUTTON - Gold Double-Circle Icon */
.gc-accessibility-trigger {
    /* Fixed size - bigger for better visibility */
    width: 56px;
    height: 56px;
    padding: 0;
    margin: 0 10px;

    /* Styling */
    background: transparent;
    border: none;
    border-radius: 50%;
    cursor: pointer;

    /* Layout */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;

    /* Effects */
    transition: all 0.3s ease;
}

.gc-accessibility-trigger svg {
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
    transition: all 0.3s ease;
}

.gc-accessibility-trigger:hover {
    transform: scale(1.15);
}

.gc-accessibility-trigger:hover svg {
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
}

.gc-accessibility-trigger:focus {
    outline: 3px solid #FFD700;
    outline-offset: 3px;
}

.gc-accessibility-trigger:active {
    transform: scale(1.05);
}

/* OVERLAY BACKDROP - Darkens background when panel opens */
.gc-accessibility-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9996;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    backdrop-filter: blur(2px);
}

.gc-accessibility-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* WIDGET PANEL - RIGHT SIDE WITH OVERLAY */
.gc-accessibility-panel {
    position: fixed !important;
    top: 50% !important;
    right: 20px !important; /* RIGHT SIDE */
    bottom: auto !important; /* v1.1.0 - Prevent any bottom positioning */
    left: auto !important; /* Prevent any left positioning on desktop */
    transform: translateY(-50%) translateX(20px) !important; /* SLIDE FROM RIGHT */
    width: 420px;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    border: 3px solid #D89000;
    z-index: 9997;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.gc-accessibility-panel.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(-50%) translateX(0) !important; /* SLIDE IN */
    z-index: 9997 !important; /* Above overlay, same level as other modals */
}

/* PANEL HEADER */
.gc-a11y-header {
    background: linear-gradient(135deg, #D89000, #FFD700);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #B87700;
}

.gc-a11y-header h2 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.gc-a11y-close {
    background: transparent; /* Blue background now in SVG */
    border: none;
    color: white;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.gc-a11y-close:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.1);
}

/* Lock icon styling */
.gc-lock-icon {
    display: block;
}

/* Lock shackle (open by default) */
.gc-lock-shackle {
    transition: all 0.4s ease;
    transform-origin: 16px 14px; /* Pivot point at top of lock body (adjusted for new size) */
}

/* Close the lock on hover */
.gc-a11y-close:hover .gc-lock-shackle {
    transform: translateY(0) scaleY(0.4); /* Closes the shackle down */
}

/* Pulse the red X on hover */
.gc-a11y-close:hover .gc-lock-x {
    animation: pulse-x 0.6s ease-in-out;
}

@keyframes pulse-x {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* PANEL CONTENT */
.gc-a11y-content {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.gc-a11y-section {
    margin-bottom: 24px;
}

.gc-a11y-section-title {
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* LANGUAGE SELECTOR */
.gc-language-selector {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.gc-language-selector label {
    display: block;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    font-size: 14px;
}

.gc-language-selector select {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
}

.gc-language-selector select:hover {
    border-color: #D89000;
}

.gc-language-selector select:focus {
    outline: none;
    border-color: #D89000;
    box-shadow: 0 0 0 3px rgba(216, 144, 0, 0.1);
}

/* PROFILE CARDS */
.gc-profiles-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.gc-profile-card {
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.gc-profile-card:hover {
    background: #FFF9E6;
    border-color: #D89000;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.gc-profile-card.active {
    background: #FFF9E6;
    border-color: #D89000;
    box-shadow: 0 0 0 3px rgba(216, 144, 0, 0.2);
}

.gc-profile-icon {
    font-size: 32px;
    margin-bottom: 8px;
}

.gc-profile-name {
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
    margin-bottom: 4px;
}

.gc-profile-desc {
    font-size: 11px;
    color: #666;
    line-height: 1.3;
}

/* TOGGLE SWITCHES */
.gc-toggle-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.gc-toggle-item:last-child {
    border-bottom: none;
}

.gc-toggle-label {
    font-size: 14px;
    color: #2c3e50;
    font-weight: 500;
}

.gc-toggle-switch {
    position: relative;
    width: 50px;
    height: 26px;
    background: #ccc;
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s;
}

.gc-toggle-switch::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    transition: all 0.3s;
}

.gc-toggle-switch.active {
    background: #D89000;
}

.gc-toggle-switch.active::after {
    left: 27px;
}

/* FONT SIZE CONTROLS */
.gc-font-size-controls {
    display: flex;
    gap: 8px;
    justify-content: space-between;
}

.gc-font-size-btn {
    flex: 1;
    padding: 12px;
    background: #f9f9f9;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s;
    font-size: 16px;
    color: #2c3e50;
}

.gc-font-size-btn:hover {
    background: #FFF9E6;
    border-color: #D89000;
}

.gc-font-size-btn.active {
    background: #D89000;
    color: white;
    border-color: #D89000;
}

/* FOOTER */
.gc-a11y-footer {
    padding: 16px 20px;
    background: #f9f9f9;
    border-top: 2px solid #e0e0e0;
    display: flex;
    gap: 10px;
}

.gc-a11y-footer button {
    flex: 1;
    padding: 12px;
    border: 2px solid #D89000;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.gc-reset-btn {
    background: white;
    color: #D89000;
}

.gc-reset-btn:hover {
    background: #FFF9E6;
}

.gc-save-btn {
    background: #D89000;
    color: white;
}

.gc-save-btn:hover {
    background: #B87700;
}

/* ACCESSIBILITY STATES */
body.gc-high-contrast {
    filter: contrast(1.5);
}

/* DARK MODE - Entire Website */
body.gc-dark-mode {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* Dark mode for all text elements */
body.gc-dark-mode *,
body.gc-dark-mode h1,
body.gc-dark-mode h2,
body.gc-dark-mode h3,
body.gc-dark-mode h4,
body.gc-dark-mode h5,
body.gc-dark-mode h6,
body.gc-dark-mode p,
body.gc-dark-mode span,
body.gc-dark-mode div,
body.gc-dark-mode a {
    color: #e0e0e0 !important;
}

/* Dark mode for containers */
body.gc-dark-mode main,
body.gc-dark-mode article,
body.gc-dark-mode section,
body.gc-dark-mode aside,
body.gc-dark-mode header,
body.gc-dark-mode footer,
body.gc-dark-mode .content,
body.gc-dark-mode .container,
body.gc-dark-mode .wrapper {
    background: #1a1a1a !important;
    color: #e0e0e0 !important;
}

/* Dark mode for cards and boxes */
body.gc-dark-mode .card,
body.gc-dark-mode .box,
body.gc-dark-mode .panel,
body.gc-dark-mode .widget,
body.gc-dark-mode .post,
body.gc-dark-mode .entry {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

/* Dark mode for links */
body.gc-dark-mode a:link,
body.gc-dark-mode a:visited {
    color: #66b3ff !important; /* Light blue for visibility */
}

body.gc-dark-mode a:hover {
    color: #99ccff !important; /* Lighter blue on hover */
}

/* Dark mode for buttons */
body.gc-dark-mode button,
body.gc-dark-mode .button,
body.gc-dark-mode input[type="button"],
body.gc-dark-mode input[type="submit"] {
    background: #333 !important;
    color: #e0e0e0 !important;
    border-color: #555 !important;
}

/* Dark mode for forms */
body.gc-dark-mode input,
body.gc-dark-mode textarea,
body.gc-dark-mode select {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #555 !important;
}

/* Dark mode for images - reduce brightness slightly */
body.gc-dark-mode img {
    opacity: 0.9 !important;
}

/* Dark mode for tables */
body.gc-dark-mode table,
body.gc-dark-mode th,
body.gc-dark-mode td {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
    border-color: #444 !important;
}

/* Dark mode for accessibility panel */
body.gc-dark-mode .gc-accessibility-panel {
    background: #2a2a2a !important;
    color: #e0e0e0 !important;
}

/* Dark mode for navigation */
body.gc-dark-mode nav,
body.gc-dark-mode .navigation,
body.gc-dark-mode .menu {
    background: #1a1a1a !important;
}

body.gc-dark-mode nav a,
body.gc-dark-mode .navigation a,
body.gc-dark-mode .menu a {
    color: #e0e0e0 !important;
}

/* Keep important branded elements visible */
body.gc-dark-mode .gc-header-professional {
    background: #1a1a1a !important;
    border-bottom-color: #0B5394 !important;
}

/* Preserve button colors but darken backgrounds */
body.gc-dark-mode .gc-header-signup {
    background: #1e7a3f !important; /* Darker green */
}

body.gc-dark-mode .gc-header-signin:hover {
    background: #2a2a2a !important;
}

/* Increase root font size for better scaling */
html.gc-font-large {
    font-size: 125% !important;
}

html.gc-font-xlarge {
    font-size: 150% !important;
}

/* Use CSS zoom for comprehensive scaling across all pages (works with fixed px sizes) */
body.gc-font-large {
    zoom: 1.15 !important; /* 15% increase for large text */
}

body.gc-font-xlarge {
    zoom: 1.3 !important; /* 30% increase for extra large text */
}

/* Counteract zoom on fixed elements to prevent layout issues */
body.gc-font-large .gc-accessibility-panel,
body.gc-font-large .gc-accessibility-trigger,
body.gc-font-large .gc-accessibility-overlay,
body.gc-font-large .gc-floating-goldie,
body.gc-font-large .gc-scroll-to-top,
body.gc-font-large .gc-header-professional {
    zoom: 1 !important;
}

body.gc-font-xlarge .gc-accessibility-panel,
body.gc-font-xlarge .gc-accessibility-trigger,
body.gc-font-xlarge .gc-accessibility-overlay,
body.gc-font-xlarge .gc-floating-goldie,
body.gc-font-xlarge .gc-scroll-to-top,
body.gc-font-xlarge .gc-header-professional {
    zoom: 1 !important;
}

body.gc-dyslexia-font * {
    font-family: 'OpenDyslexic', Arial, sans-serif !important;
}

body.gc-large-cursor {
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><circle cx="16" cy="16" r="14" fill="black" stroke="white" stroke-width="2"/></svg>') 16 16, auto;
}

/* REDUCE MOTION - Stop all animations and transitions */
body.gc-reduced-motion,
body.gc-reduced-motion *,
body.gc-reduced-motion *::before,
body.gc-reduced-motion *::after {
    animation: none !important;
    animation-duration: 0s !important;
    animation-delay: 0s !important;
    transition: none !important;
    transition-duration: 0s !important;
    transition-delay: 0s !important;
    scroll-behavior: auto !important;
}

/* Keep hover states but make them instant */
body.gc-reduced-motion *:hover,
body.gc-reduced-motion button:hover,
body.gc-reduced-motion a:hover {
    transition: none !important;
}

/* Visual indicator that reduce motion is active */
body.gc-reduced-motion::before {
    content: "⚡ Motion Reduced";
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #E74C3C;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

body.gc-highlight-links a {
    background: yellow !important;
    padding: 2px 4px !important;
}

body.gc-line-height-increased {
    line-height: 1.8 !important;
}

body.gc-letter-spacing-increased * {
    letter-spacing: 0.12em !important;
}

/* HIGHLIGHT FOCUS - Make focused elements very obvious */
body.gc-focus-enhanced *:focus,
body.gc-focus-enhanced a:focus,
body.gc-focus-enhanced button:focus,
body.gc-focus-enhanced input:focus,
body.gc-focus-enhanced textarea:focus,
body.gc-focus-enhanced select:focus,
body.gc-focus-enhanced [tabindex]:focus {
    outline: 6px solid #D89000 !important;
    outline-offset: 4px !important;
    box-shadow: 0 0 0 12px rgba(216, 144, 0, 0.4) !important;
    background-color: rgba(255, 255, 200, 0.7) !important; /* Stronger yellow highlight */
    position: relative !important;
    z-index: 9999 !important;
}

/* Extra visible focus for links */
body.gc-focus-enhanced a:focus {
    text-decoration: underline !important;
    text-decoration-thickness: 4px !important;
    text-decoration-color: #D89000 !important;
}

/* Focus for buttons - make them bigger */
body.gc-focus-enhanced button:focus {
    transform: scale(1.1) !important;
}

/* Visual indicator that focus highlighting is active */
body.gc-focus-enhanced::before {
    content: "👁️ Focus Enhanced - Press TAB to navigate";
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #D89000;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    z-index: 999999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    animation: pulse-reminder 2s ease-in-out infinite;
}

@keyframes pulse-reminder {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

/* If both reduce motion and focus enhanced are active, stack the badges */
body.gc-reduced-motion.gc-focus-enhanced::before {
    content: "👁️ Focus Enhanced - Press TAB | ⚡ Motion Reduced";
    padding: 10px 25px;
}

/* Don't disable animation on the indicator badges themselves */
body.gc-reduced-motion::before,
body.gc-focus-enhanced::before {
    animation: pulse-reminder 2s ease-in-out infinite !important;
    transition: all 0.3s ease !important;
}

/* MOBILE RESPONSIVE */
@media (max-width: 768px) {
    .gc-accessibility-trigger {
        width: 50px;
        height: 50px;
        margin: 0 8px;
    }

    .gc-accessibility-trigger svg {
        width: 36px;
        height: 36px;
    }

    .gc-accessibility-panel {
        top: 50%;
        right: 5px !important;
        left: 5px !important;
        width: auto;
        max-width: calc(100vw - 10px) !important;
        max-height: 80vh;
        transform: translate(0, -50%) translateY(-20px);
    }

    .gc-accessibility-panel.active {
        transform: translate(0, -50%);
    }

    .gc-profiles-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Z-INDEX LAYERING WHEN PANEL IS OPEN
   ============================================ */

/* Layer chatbot and scroll arrow BELOW overlay and panel (don't remove them!) */
body.gc-accessibility-active .gc-floating-goldie,
body.gc-accessibility-active .gc-float-chat,
body.gc-accessibility-active .gc-scroll-to-top,
body.gc-accessibility-active iframe[src*="chat"],
body.gc-accessibility-active iframe[src*="crisp"],
body.gc-accessibility-active .chatbot-floater,
body.gc-accessibility-active #chatbot-widget,
body.gc-accessibility-active .chat-widget,
body.gc-accessibility-active #crisp-chatbox,
body.gc-accessibility-active .crisp-client {
    z-index: 9990 !important; /* Below overlay (9996) and panel (9997) */
    pointer-events: none !important; /* Disable interaction while panel open */
}

/* ============================================
   GOOGLE TRANSLATE ADJUSTMENTS
   ============================================ */

/* Hide Google Translate widget inside our panel - we use our own dropdown */
#google_translate_element .goog-te-gadget {
    display: none !important;
}

/* Hide Google Translate banner at top of page */
.goog-te-banner-frame {
    display: none !important;
}

/* Adjust panel position when Google Translate toolbar appears */
body.translated-ltr .gc-accessibility-panel,
body.translated-rtl .gc-accessibility-panel,
body[style*="top:"] .gc-accessibility-panel {
    top: 50% !important; /* Keep centered vertically even with Google Translate bar */
}

/* Keep panel on screen on smaller viewports */
@media (max-width: 1024px) {
    .gc-accessibility-panel {
        right: 10px !important;
        width: 280px !important;  /* Much narrower on tablets */
        max-width: calc(100vw - 30px) !important;
    }

    /* Even narrower when Google Translate active on tablet */
    body.translated-ltr .gc-accessibility-panel,
    body.translated-rtl .gc-accessibility-panel {
        width: 260px !important;  /* Very narrow when translated */
        max-width: calc(100vw - 40px) !important;
    }
}

/* ============================================
   PANEL ACTIVE STATE - PREVENT SHIFT
   ============================================ */

/* When accessibility panel is open, body is position:fixed via JavaScript.
   These styles support that approach without interfering. */
body.gc-accessibility-active {
    /* overflow-y: scroll is set by JS to keep scrollbar visible */
    /* position: fixed, top, left, right, width are set by JS */
    /* Do NOT override these properties here */
}
