html { 
    scroll-behavior: smooth; 
}

body {
    background: #000c24;
    color: #fff;
    overflow-x: hidden;
}

/* Image protection - scoped to avoid breaking content pages with many images */
img.protected,
img.no-drag,
.logo img,
.hero img,
#navy-chat-button img {
    pointer-events: none;
    -webkit-user-drag: none;
}

/* Fallback for very important images only (logos, heroes) - do NOT use on organization/content images */
img[alt*="logo" i],
img[alt*="Logo" i] {
    pointer-events: none;
    -webkit-user-drag: none;
}

.section {
    position: relative;
    margin-bottom: 0rem;
}

.section:after {
    content: '';
    position: absolute;
    bottom: -2rem;
    left: 50%;
    transform: translateX(-50%);
    width: 120px;
    height: 2px;
    background: linear-gradient(to right, transparent, #facc15, transparent);
    opacity: 0.6;
}

.section:last-child:after { 
    display: none; 
}

/* ========== ACCESSIBILITY BUTTON ========== */
#accessBtn {
    position: fixed;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 0 12px 12px 0;
    background: #2563eb;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 4px 0 15px rgba(0,0,0,.4);
    transition: all .3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

#accessBtn:hover {
    background: #1e40af;
    transform: translateY(-50%) scale(1.08);
}

#accessBtn i {
    font-size: 24px;
    color: #fff;
}

.tool-grid button,
.tool-bottom button {
    display: flex;
    align-items: center;
    gap: 10px;
}

.tool-grid i,
.tool-bottom i {
    font-size: 20px;
    color: #60a5fa;
}

/* ========== ACCESSIBILITY PANEL ========== */
#accessPanel {
    position: fixed;
    left: 60px;
    top: 50%;
    transform: translateY(-50%);
    width: 340px;
    background: #04142d;
    border: 1px solid rgba(255,255,255,.1);
    border-radius: 20px;
    padding: 20px;
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all .25s ease;
}

#accessPanel.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    animation: panelSlide .25s ease;
}

@keyframes panelSlide {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

#accessPanel h3 {
    margin: 0 0 20px;
    font-size: 22px;
    font-weight: 700;
    color: #fff;
}

.tool-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

.tool-grid button,
.tool-bottom button {
    background: rgba(255,255,255,.08);
    border: none;
    color: #fff;
    text-align: left;
    font-size: 15px;
    padding: 12px 14px;
    border-radius: 10px;
    cursor: pointer;
    transition: all .2s ease;
}

.tool-grid button:hover,
.tool-bottom button:hover {
    background: #2563eb;
    transform: translateY(-1px);
}

.tool-bottom {
    border-top: 1px solid rgba(255,255,255,.1);
    padding-top: 18px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ACCESSIBILITY MODES */
body.gray-mode main,
body.gray-mode footer,
body.gray-mode section,
body.gray-mode header {
    filter: grayscale(1);
}

body.high-contrast { 
    background: #000 !important; 
    color: #fff !important; 
    filter: contrast(1.35); 
}

body.negative-mode { 
    filter: invert(1) hue-rotate(180deg); 
}

body.light-mode { 
    background: #fff !important; 
    color: #111 !important; 
}

body.readable-font { 
    font-family: Verdana, Arial, sans-serif !important; 
}

body.underline-links a { 
    text-decoration: underline !important; 
}

/* SCROLL TO TOP */
#topBtn {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 52px;
    height: 52px;
    border: none;
    border-radius: 14px;
    background: #2563eb;
    color: #fff;
    font-size: 22px;
    cursor: pointer;
    display: none;
    z-index: 99999;
    box-shadow: 0 10px 25px rgba(0,0,0,.35);
}

/* COOKIE POPUP */
.cookie-popup {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    max-width: 600px;
}

.cookie-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 20px;
    border-radius: 18px;
    background: rgba(2,18,45,.72);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(56,189,248,.15);
    box-shadow: 0 10px 35px rgba(0,0,0,.35);
}

.cookie-actions {
    display: flex;
    gap: 10px;
}

.cookie-actions button {
    border: none;
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
}

.cookie-accept {
    background: linear-gradient(135deg,#0ea5e9,#2563eb);
    color: #fff;
}

.cookie-cancel {
    background: rgba(255,255,255,.08);
    color: #d1d5db;
}

/* ========== MOBILE RESPONSIVE ========== */
@media (max-width: 768px) {
    #accessPanel {
        left: 50%;
        top: auto;
        bottom: 85px;
        transform: translateX(-50%);
        width: calc(100vw - 30px);
        max-width: 320px;
        padding: 15px;
        border-radius: 18px;
    }
    
    #accessPanel h3 {
        font-size: 20px;
        margin-bottom: 15px;
    }
    
    .tool-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .tool-grid button {
        padding: 10px 12px;
        font-size: 14px;
    }
    
    .tool-bottom {
        gap: 8px;
        padding-top: 12px;
    }
    
    .tool-bottom button {
        padding: 10px;
        font-size: 13px;
    }
    
    .tool-grid i,
    .tool-bottom i {
        font-size: 18px;
        min-width: 18px;
    }
    
    /* ACCESSIBILITY BUTTON - Bottom on Mobile */
    #accessBtn {
        left: 15px;
        right: auto;
        top: auto;
        bottom: 80px;
        width: 56px;
        height: 56px;
        border-radius: 9999px;
        font-size: 24px;
        box-shadow: 0 4px 15px rgba(0,0,0,.4);
        transition: all .3s ease;
    }
    
    #accessBtn:hover {
        transform: scale(1.1);
    }
    
    #accessBtn i {
        font-size: 26px;
        color: #fff;
    }
    
    .cookie-popup { 
        width: 95%; 
    }
    
    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .cookie-actions {
        width: 100%;
    }
    
    .cookie-actions button {
        flex: 1;
        text-align: center;
    }
}

.mobile-menu-open #accessBtn,
.mobile-menu-open #topBtn {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}