/* ========== COMPASS MAP INTEGRATION STYLES ==========
 * Add these styles to the END of your existing styles.css
 * 
 * Contents:
 * 1. Compass Gate Section (Hero Entry)
 * 2. Floating Compass Button
 * 3. Map Card Highlight
 * 4. Responsive Adjustments
 * ================================================== */

/* ========== 1. COMPASS GATE SECTION ========== */
.compass-gate-section {
    padding: 0;
    margin: 0;
    background: linear-gradient(180deg, 
        var(--bg-footer) 0%, 
        #0b1220 50%,
        var(--bg-footer) 100%
    );
    overflow: hidden;
    position: relative;
}

.compass-gate-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 50% 50%, rgba(52, 152, 219, 0.08) 0%, transparent 60%),
        radial-gradient(ellipse at 20% 80%, rgba(100, 180, 255, 0.05) 0%, transparent 40%),
        radial-gradient(ellipse at 80% 20%, rgba(100, 180, 255, 0.05) 0%, transparent 40%);
    pointer-events: none;
}

.compass-gate-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/hexagon-pattern.svg');
    background-repeat: repeat;
    background-size: 70px 121px;
    pointer-events: none;
    z-index: 0;
    opacity: 0.35;
}

.compass-gate-container {
    max-width: 1060px;
    margin: 0 auto;
    padding: var(--spacing-xl) var(--spacing-lg);
    position: relative;
    z-index: 1;
}

.compass-gate-link {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-xl);
    padding: var(--spacing-xl);
    background: rgba(15, 25, 45, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.compass-gate-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, 
        transparent, 
        rgba(100, 180, 255, 0.1), 
        transparent
    );
    transition: left 0.6s ease;
}

.compass-gate-link:hover {
    transform: translateY(-4px);
    border-color: rgba(100, 180, 255, 0.4);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(100, 180, 255, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.15);
    text-decoration: none;
    color: #fff;
}

.compass-gate-link:hover::before {
    left: 100%;
}

/* Gate Visual (Left Side) */
.gate-visual {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.gate-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, 
        rgba(0, 180, 220, 0.2) 0%, 
        rgba(100, 180, 255, 0.1) 40%,
        transparent 70%
    );
    animation: gateGlowPulse 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes gateGlowPulse {
    0%, 100% { 
        transform: translate(-50%, -50%) scale(1);
        opacity: 0.6;
    }
    50% { 
        transform: translate(-50%, -50%) scale(1.15);
        opacity: 1;
    }
}

.gate-image-wrapper {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 150px;
    height: 150px;
    animation: gateFloat 4s ease-in-out infinite;
}

@keyframes gateFloat {
    0%, 100% { transform: translate(-50%, -50%) translateY(0) rotate(0deg); }
    50% { transform: translate(-50%, -50%) translateY(-8px) rotate(3deg); }
}

.gate-portal-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 0 20px rgba(0, 180, 220, 0.4));
    transition: filter 0.4s ease;
}

.compass-gate-link:hover .gate-portal-image {
    filter: drop-shadow(0 0 30px rgba(100, 180, 255, 0.6));
}

/* Floating Particles */
.gate-particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.gate-particles span {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(100, 180, 255, 0.8);
    border-radius: 50%;
    animation: particleFloat 3s ease-in-out infinite;
}

.gate-particles span:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.gate-particles span:nth-child(2) { top: 80%; left: 20%; animation-delay: 0.3s; }
.gate-particles span:nth-child(3) { top: 40%; left: 85%; animation-delay: 0.6s; }
.gate-particles span:nth-child(4) { top: 70%; left: 75%; animation-delay: 0.9s; }
.gate-particles span:nth-child(5) { top: 10%; left: 60%; animation-delay: 1.2s; }
.gate-particles span:nth-child(6) { top: 60%; left: 5%; animation-delay: 1.5s; }
.gate-particles span:nth-child(7) { top: 30%; left: 30%; animation-delay: 1.8s; }
.gate-particles span:nth-child(8) { top: 85%; left: 50%; animation-delay: 2.1s; }
.gate-particles span:nth-child(9) { top: 15%; left: 80%; animation-delay: 2.4s; }
.gate-particles span:nth-child(10) { top: 50%; left: 95%; animation-delay: 2.7s; }

@keyframes particleFloat {
    0%, 100% { 
        transform: translateY(0) scale(1);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-15px) scale(1.5);
        opacity: 0.8;
    }
}

/* Gate Content (Right Side) */
.gate-content {
    flex: 1;
    text-align: left;
}

.gate-title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 var(--spacing-sm) 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    letter-spacing: 0.5px;
}

.gate-title::after {
    display: none; /* Override default h2 underline */
}

.gate-title i {
    font-size: 1.4rem;
    color: #64b4ff;
    animation: compassSpin 8s linear infinite;
}

@keyframes compassSpin {
    0% { transform: rotate(0deg); }
    25% { transform: rotate(15deg); }
    50% { transform: rotate(0deg); }
    75% { transform: rotate(-15deg); }
    100% { transform: rotate(0deg); }
}

.gate-description {
    font-size: 1rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: var(--spacing-md);
}

.gate-description strong {
    color: #64b4ff;
}

.gate-cta {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: 12px 24px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    border-radius: var(--border-radius-pill);
    font-weight: 600;
    font-size: 0.95rem;
    color: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
}

.gate-cta i {
    transition: transform 0.3s ease;
}

.compass-gate-link:hover .gate-cta {
    background: linear-gradient(135deg, #4aa3e8 0%, #3498db 100%);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
    transform: translateX(4px);
}

.compass-gate-link:hover .gate-cta i {
    transform: translateX(4px);
}


/* ========== 2. FLOATING COMPASS BUTTON ========== */
.floating-compass-btn {
    position: fixed;
    bottom: 160px; /* Above back-to-top / quick-jump button */
    right: 24px;
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, #2c3e50 0%, #1a252f 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    text-decoration: none;
    box-shadow: 
        0 4px 20px rgba(0, 0, 0, 0.3),
        0 0 0 3px rgba(52, 152, 219, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    overflow: visible;
}

.floating-compass-btn:hover {
    transform: scale(1.1) rotate(15deg);
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    box-shadow: 
        0 8px 30px rgba(52, 152, 219, 0.4),
        0 0 0 4px rgba(52, 152, 219, 0.3);
    text-decoration: none;
    color: #fff;
}

.floating-compass-btn i {
    transition: transform 0.3s ease;
}

.floating-compass-btn:hover i {
    animation: floatingCompassSpin 0.6s ease;
}

@keyframes floatingCompassSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Pulse effect */
.floating-btn-pulse {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(52, 152, 219, 0.5);
    animation: floatingPulse 2s ease-out infinite;
    pointer-events: none;
}

@keyframes floatingPulse {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Tooltip on hover */
.floating-compass-btn::after {
    content: 'Knowledge Map';
    position: absolute;
    right: 70px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--bg-footer-bottom);
    color: #fff;
    padding: 8px 14px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.floating-compass-btn::before {
    content: '';
    position: absolute;
    right: 66px;
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-left-color: var(--bg-footer-bottom);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.floating-compass-btn:hover::after,
.floating-compass-btn:hover::before {
    opacity: 1;
    visibility: visible;
}


/* ========== 3. MAP CARD HIGHLIGHT ========== */
.card-map-highlight {
    background: linear-gradient(145deg, 
        #1a2a3a 0%, 
        #2c3e50 50%,
        #1e3a52 100%
    );
    border: 1px solid rgba(100, 180, 255, 0.3);
    position: relative;
    overflow: hidden;
}

/* Ambient glow effect */
.card-map-highlight::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 30% 20%, rgba(100, 180, 255, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 70% 80%, rgba(52, 152, 219, 0.1) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

/* Top gradient accent */
.card-map-highlight::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, 
        #3498db 0%, 
        #64b4ff 25%,
        #2ecc71 50%,
        #64b4ff 75%,
        #3498db 100%
    );
    z-index: 1;
}

/* Hover state */
.card-map-highlight:hover {
    transform: translateY(-8px);
    border-color: rgba(100, 180, 255, 0.5);
    box-shadow: 
        0 20px 50px rgba(0, 0, 0, 0.4),
        0 0 40px rgba(100, 180, 255, 0.15);
}

/* Icon styling */
.card-map-highlight .card-icon {
    color: #64b4ff;
    font-size: 3rem;
    position: relative;
    z-index: 1;
    text-shadow: 0 0 20px rgba(100, 180, 255, 0.5);
}

.card-map-highlight .card-icon::after {
    background: radial-gradient(circle, rgba(100, 180, 255, 0.2) 0%, transparent 70%);
}

.card-map-highlight:hover .card-icon {
    color: #fff;
    text-shadow: 0 0 30px rgba(100, 180, 255, 0.7);
}

/* Title styling - WHITE for readability */
.card-map-highlight h3 {
    color: #fff;
    position: relative;
    z-index: 1;
    font-size: 1.2rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

.card-map-highlight h3 a {
    color: #fff;
}

.card-map-highlight:hover h3 a {
    color: #64b4ff;
    text-shadow: 0 0 10px rgba(100, 180, 255, 0.5);
}

/* Description - lighter for dark background */
.card-map-highlight p {
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 1;
    font-size: 0.95rem;
}

/* Badge styling */
.card-badge-map {
    display: inline-block;
    margin-top: var(--spacing-sm);
    padding: 6px 16px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #fff;
    font-family: var(--font-accent);
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: var(--border-radius-pill);
    letter-spacing: 0.5px;
    position: relative;
    z-index: 1;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.4);
    transition: all 0.3s ease;
}

.card-map-highlight:hover .card-badge-map {
    background: linear-gradient(135deg, #4aa3e8 0%, #3498db 100%);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.5);
    transform: scale(1.05);
}

/* ========== RESEARCH GATE VARIABLES ========== */
:root {
    --research-color: #f0a500;
    --research-light: #ffc947;
    --research-glow: rgba(240, 165, 0, 0.4);
}


/* ========== TWO-COLUMN GATE LAYOUT ========== */
.compass-gate-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: var(--spacing-lg);
    align-items: stretch;
}


/* ========== RESEARCH GATE CARD ========== */
.research-gate-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg) var(--spacing-md);
    width: 160px;
    background: rgba(15, 25, 45, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(240, 165, 0, 0.1);
    border-radius: 16px;
    text-decoration: none;
    color: #e0e0e0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow:
        0 6px 24px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
    text-align: center;
}

/* Subtle top accent line */
.research-gate-link::before {
    content: '';
    position: absolute;
    top: 0;
    left: 20%;
    right: 20%;
    height: 2px;
    background: linear-gradient(90deg,
        transparent,
        var(--research-color),
        transparent
    );
    opacity: 0.4;
    transition: opacity 0.4s ease;
}

.research-gate-link:hover {
    transform: translateY(-4px);
    border-color: rgba(240, 165, 0, 0.3);
    box-shadow:
        0 14px 40px rgba(0, 0, 0, 0.3),
        0 0 24px rgba(240, 165, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: #fff;
}

.research-gate-link:hover::before {
    opacity: 1;
}

/* Icon */
.research-gate-icon {
    font-size: 1.8rem;
    color: var(--research-color);
    opacity: 0.7;
    transition: all 0.4s ease;
    text-shadow: 0 0 12px rgba(240, 165, 0, 0.2);
}

.research-gate-link:hover .research-gate-icon {
    opacity: 1;
    color: var(--research-light);
    text-shadow: 0 0 20px rgba(240, 165, 0, 0.4);
}

/* Title */
.research-gate-title {
    font-family: var(--font-heading);
    font-size: 0.95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.75);
    letter-spacing: 0.3px;
    transition: color 0.3s ease;
}

.research-gate-link:hover .research-gate-title {
    color: #fff;
}

/* Subtitle */
.research-gate-subtitle {
    font-family: var(--font-accent);
    font-size: 0.75rem;
    color: rgba(240, 165, 0, 0.5);
    letter-spacing: 0.5px;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.research-gate-link:hover .research-gate-subtitle {
    color: var(--research-light);
}


/* ══════════════════════════════════════════════════════════
   RESPONSIVE OVERRIDES 
   ══════════════════════════════════════════════════════════ */

/* Tablet (add inside existing @media max-width: 992px) */
@media (max-width: 992px) {
    .research-gate-link {
        width: 140px;
        padding: var(--spacing-md) var(--spacing-sm);
    }

    .research-gate-icon {
        font-size: 1.5rem;
    }

    .research-gate-title {
        font-size: 0.88rem;
    }
}

/* Mobile (add inside existing @media max-width: 768px) */
@media (max-width: 768px) {
    .compass-gate-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .research-gate-link {
        width: 100%;
        flex-direction: row;
        justify-content: flex-start;
        padding: var(--spacing-md) var(--spacing-lg);
        border-radius: 12px;
    }

    .research-gate-link::before {
        left: 0;
        right: 0;
        top: 0;
        height: 2px;
    }

    .research-gate-icon {
        font-size: 1.4rem;
    }

    .research-gate-title {
        font-size: 0.9rem;
    }

    .research-gate-subtitle {
        display: none;
    }
}

/* Small mobile (add inside existing @media max-width: 480px) */
@media (max-width: 480px) {
    .research-gate-link {
        padding: var(--spacing-sm) var(--spacing-md);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .research-gate-link,
    .research-gate-link:hover,
    .research-gate-icon {
        transition: none;
    }

    .research-gate-link:hover {
        transform: none;
    }
}

/* ========== LOCKED STATE (Coming Soon) ========== */
.research-gate-locked {
    cursor: default;
    opacity: 0.5;
    pointer-events: none;
}


/* ========== 4. RESPONSIVE ADJUSTMENTS ========== */

/* Tablet */
@media (max-width: 992px) {
    .compass-gate-container {
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .compass-gate-link {
        gap: var(--spacing-lg);
        padding: var(--spacing-lg);
    }
    
    .gate-visual {
        width: 150px;
        height: 150px;
    }
    
    .gate-glow {
        width: 180px;
        height: 180px;
    }
    
    .gate-image-wrapper {
        width: 120px;
        height: 120px;
    }
    
    .gate-title {
        font-size: 1.4rem;
    }
    
    .floating-compass-btn {
        bottom: 150px;
        right: 20px;
        width: 52px;
        height: 52px;
        font-size: 1.4rem;
    }

    .card {
        padding: var(--spacing-md);
    }
    
    .card-icon {
        font-size: 2.5rem;
    }
    
    .card-map-highlight .card-icon {
        font-size: 2.8rem;
    }
}

/* Mobile */
@media (max-width: 768px) {
    .compass-gate-section {
        padding: 0;
    }
    
    .compass-gate-container {
        padding: var(--spacing-md) var(--spacing-sm);
    }
    
    .compass-gate-link {
        flex-direction: column;
        text-align: center;
        gap: var(--spacing-md);
        padding: var(--spacing-lg) var(--spacing-md);
    }
    
    .gate-visual {
        width: 140px;
        height: 140px;
    }
    
    .gate-glow {
        width: 170px;
        height: 170px;
    }
    
    .gate-image-wrapper {
        width: 110px;
        height: 110px;
    }
    
    .gate-content {
        text-align: center;
    }
    
    .gate-title {
        font-size: 1.25rem;
        justify-content: center;
    }
    
    .gate-description {
        font-size: 0.95rem;
    }
    
    .gate-cta {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    /* Floating button adjustments */
    .floating-compass-btn {
        bottom: 140px;
        right: 16px;
        width: 48px;
        height: 48px;
        font-size: 1.3rem;
    }
    
    /* Hide tooltip on mobile */
    .floating-compass-btn::after,
    .floating-compass-btn::before {
        display: none;
    }
    
    /* Reduce particle visibility on mobile */
    .gate-particles span {
        width: 3px;
        height: 3px;
    }

    .topic-cards {
        grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
        gap: var(--spacing-md);
    }
    
    .card {
        padding: 1.25rem;
    }
    
    .card h3 {
        font-size: 1rem;
    }
    
    .card p {
        font-size: 0.9rem;
    }
    
    .card-icon {
        font-size: 2.2rem;
    }
    
    .card-map-highlight h3 {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .topic-cards {
        grid-template-columns: 1fr;
    }
    
    .card-badge-map {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .compass-gate-container {
        padding: var(--spacing-sm);
    }
    
    .compass-gate-link {
        padding: var(--spacing-md);
        border-radius: 16px;
    }
    
    .gate-visual {
        width: 120px;
        height: 120px;
    }
    
    .gate-glow {
        width: 150px;
        height: 150px;
    }
    
    .gate-image-wrapper {
        width: 95px;
        height: 95px;
    }
    
    .gate-title {
        font-size: 1.1rem;
        flex-direction: column;
        gap: var(--spacing-xs);
    }
    
    .gate-title i {
        font-size: 1.8rem;
    }
    
    .gate-description {
        font-size: 0.9rem;
    }
    
    .gate-cta {
        padding: 10px 18px;
        font-size: 0.85rem;
    }
    
    .floating-compass-btn {
        bottom: 130px;
        right: 12px;
        width: 44px;
        height: 44px;
        font-size: 1.2rem;
    }
    
    /* Hide some particles on very small screens */
    .gate-particles span:nth-child(n+7) {
        display: none;
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .gate-glow,
    .gate-image-wrapper,
    .gate-particles span,
    .gate-title i,
    .floating-btn-pulse {
        animation: none;
    }
    
    .compass-gate-link,
    .compass-gate-link:hover,
    .floating-compass-btn,
    .floating-compass-btn:hover {
        transition: none;
    }

    .card,
    .card-map-highlight,
    .card-icon,
    .card-badge-map {
        transition: none;
    }
    
    .card:hover,
    .card-map-highlight:hover {
        transform: none;
    }
}

/* Dark mode support (if you add it later) */
@media (prefers-color-scheme: dark) {
    .card-map-highlight {
        background: linear-gradient(135deg, #1a2530 0%, #0f1a25 100%);
        border-color: rgba(52, 152, 219, 0.4);
    }
    
    .card-map-highlight .card-icon {
        color: #64b4ff;
    }
}