/* Portal Card Readability Enhancement */

/* High Contrast Portal Titles */
.portal-title {
    font-size: 1.05rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    margin-bottom: 0.3rem !important;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    letter-spacing: 0.3px !important;
    line-height: 1.3 !important;
    font-family: 'Montserrat', sans-serif !important;
    text-transform: none !important;
}

/* Enhanced Portal Subtitles */
.portal-subtitle {
    font-size: 0.85rem !important;
    color: #e0e0e0 !important;
    opacity: 1 !important;
    font-weight: 400 !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
    letter-spacing: 0.2px !important;
    font-family: 'Raleway', sans-serif !important;
    text-transform: none !important;
}

/* Enhanced Card Background for Better Contrast */
.portal-card {
    background: linear-gradient(
        135deg,
        rgba(30, 30, 30, 0.9) 0%,
        rgba(50, 50, 50, 0.85) 50%,
        rgba(20, 20, 20, 0.9) 100%
    ) !important;
    backdrop-filter: blur(25px) !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2) !important;
    position: relative !important;
    overflow: hidden !important;
}

/* Dark Overlay for Better Text Contrast */
.portal-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        135deg,
        rgba(0, 0, 0, 0.3) 0%,
        rgba(0, 0, 0, 0.1) 50%,
        rgba(0, 0, 0, 0.3) 100%
    );
    z-index: 1;
    border-radius: 14px;
    pointer-events: none;
}

/* Ensure Content is Above Overlay */
.portal-icon,
.portal-title,
.portal-subtitle {
    position: relative !important;
    z-index: 2 !important;
}

/* Enhanced Icon Visibility */
.portal-icon {
    font-size: 2.2rem !important;
    color: var(--accent-color) !important;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.6)) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6) !important;
    margin-bottom: 0.5rem !important;
}

/* Hover Effects for Enhanced Readability */
.portal-card:hover .portal-title {
    color: #ffffff !important;
    text-shadow: 0 0 8px var(--accent-color), 0 2px 4px rgba(0, 0, 0, 0.8) !important;
    transform: translateY(-1px) !important;
}

.portal-card:hover .portal-subtitle {
    color: #ffffff !important;
    text-shadow: 0 0 6px rgba(255, 255, 255, 0.4), 0 1px 2px rgba(0, 0, 0, 0.7) !important;
}

.portal-card:hover .portal-icon {
    color: #ffffff !important;
    filter: drop-shadow(0 0 12px var(--accent-color)) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.7)) !important;
    transform: scale(1.1) !important;
}

/* Enhanced Hover Background */
.portal-card:hover {
    background: linear-gradient(
        135deg,
        rgba(40, 40, 40, 0.95) 0%,
        rgba(60, 60, 60, 0.9) 50%,
        rgba(30, 30, 30, 0.95) 100%
    ) !important;
    border-color: var(--accent-color) !important;
    box-shadow: 
        0 20px 40px var(--glow-color),
        0 0 30px var(--accent-color),
        inset 0 1px 0 rgba(255, 255, 255, 0.3) !important;
}

/* Mobile Optimizations for Readability */
@media (max-width: 768px) {
    .portal-title {
        font-size: 0.95rem !important;
        letter-spacing: 0.2px !important;
    }
    
    .portal-subtitle {
        font-size: 0.8rem !important;
        letter-spacing: 0.1px !important;
    }
    
    .portal-icon {
        font-size: 2rem !important;
        margin-bottom: 0.4rem !important;
    }
}

@media (max-width: 576px) {
    .portal-title {
        font-size: 0.9rem !important;
        letter-spacing: 0.1px !important;
        margin-bottom: 0.25rem !important;
    }
    
    .portal-subtitle {
        font-size: 0.75rem !important;
    }
    
    .portal-icon {
        font-size: 1.8rem !important;
        margin-bottom: 0.3rem !important;
    }
}

/* Force Text Visibility on Any Background */
.portal-card * {
    text-rendering: optimizeLegibility !important;
    -webkit-font-smoothing: antialiased !important;
    -moz-osx-font-smoothing: grayscale !important;
}

/* Accessibility Enhancement */
.portal-card:focus-within {
    outline: 3px solid var(--accent-color) !important;
    outline-offset: 2px !important;
}

/* Extra High Contrast Mode (Optional) */
@media (prefers-contrast: high) {
    .portal-title {
        color: #ffffff !important;
        -webkit-text-fill-color: #ffffff !important;
        text-shadow: 0 0 0 !important;
        filter: none !important;
        background: none !important;
    }
    
    .portal-subtitle {
        color: #ffffff !important;
        text-shadow: 0 0 0 !important;
    }
    
    .portal-card {
        background: rgba(0, 0, 0, 0.9) !important;
        border: 3px solid #ffffff !important;
    }
}