/* portal.css */
body {
    font-family: 'Poppins', sans-serif;
    background-color: #2c524e;
    margin: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
    overflow-y: auto; /* Allow vertical scroll on all devices for content safety */
}

#canvas-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at center, #35605b 0%, #1a3330 100%);
}

.main-wrapper {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.glass-container {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 3rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
    max-width: 1200px;
    width: 100%;
    transform-style: preserve-3d;
    margin: 2rem 0;
}

.app-card {
    background: rgba(255, 255, 255, 0.85);
    border: none;
    border-radius: 20px;
    text-decoration: none;
    color: #333;
    overflow: hidden;
    position: relative;
    height: 100%;
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform-style: preserve-3d;
    transform: perspective(1000px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.app-card:hover {
    transform: translateY(-10px) scale(1.02);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2), 0 0 20px rgba(255, 255, 255, 0.4); /* Glow effect */
    border-color: rgba(255, 255, 255, 0.8);
}

.app-card .card-body {
    transform: translateZ(20px);
}

.icon-circle {
    width: 80px; /* Slightly reduced size to fit 5 cols better */
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 1.2rem;
    transition: all 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    background: white;
    transform: translateZ(30px);
}

.app-card:hover .icon-circle {
    transform: translateZ(50px) scale(1.1) rotate(5deg);
    box-shadow: 0 0 15px currentColor; /* Glow based on icon color */
}

/* Icon Specific Hover Colors */
.app-card:hover .icon-circle.icon-assessment { background-color: #ecfdf5; color: #059669; }
.app-card:hover .icon-circle.icon-attendance { background-color: #f0fdfa; color: #50918B; }
.app-card:hover .icon-circle.icon-materials { background-color: #f0fdfa; color: #50918B; }
.app-card:hover .icon-circle.icon-entrepreneurship { background-color: #fef3c7; color: #d97706; }
.app-card:hover .icon-circle.icon-survey { background-color: #f0fdfa; color: #50918B; }

/* Gradient Text */
.gradient-text {
    background: linear-gradient(135deg, #50918B 0%, #7caeae 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Icon Colors */
.icon-assessment { color: #059669; }
.icon-attendance { color: #50918B; }
.icon-materials { color: #50918B; }
.icon-entrepreneurship { color: #d97706; }
.icon-survey { color: #50918B; }

.hero-title {
    color: #fff;
    text-shadow: 0 4px 15px rgba(0,0,0,0.2);
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 400;
    font-size: 1.5rem;
    min-height: 2rem;
}

/* Cursor custom */
.cursor-dot,
.cursor-dot-outline {
    position: fixed;
    top: 0;
    left: 0;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    z-index: 9999;
    pointer-events: none;
}

.cursor-dot {
    width: 8px;
    height: 8px;
    background-color: white;
}

.cursor-dot-outline {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    transition: width 0.2s, height 0.2s, background-color 0.2s;
}

body:hover .cursor-dot-outline {
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-color: transparent;
}

/* Animations */
@keyframes floating {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

.floating {
    animation: floating 4s ease-in-out infinite;
}

.fade-in-up {
    animation: fadeInUp 1s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
    opacity: 0;
    transform: translateY(40px);
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.logo-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 15px 30px;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    gap: 20px;
    backdrop-filter: blur(5px);
    margin-bottom: 2rem;
    transition: transform 0.3s ease;
}

.logo-container:hover {
    transform: translateY(-5px);
}

.portal-logo {
    width: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.logo-politeknik {
    height: 45px; /* Reduced from 60px to compensate for visual weight */
}

.logo-wbiic {
    height: 95px; /* Increased from 85px */
}

/* ===== RESPONSIVE DESIGN ===== */

/* Hide custom cursor on touch devices */
@media (hover: none) and (pointer: coarse) {
    .cursor-dot,
    .cursor-dot-outline {
        display: none !important;
    }
}

/* Mobile First - Extra Small Devices (< 576px) */
@media (max-width: 575.98px) {
    .glass-container {
        padding: 1.5rem 1rem;
        border-radius: 16px;
        margin: 1rem 0;
    }
    
    .logo-container {
        flex-direction: column;
        gap: 10px;
        padding: 12px 20px;
        border-radius: 30px;
        margin-bottom: 1.5rem;
    }
    
    .logo-politeknik {
        height: 35px;
    }
    
    .logo-wbiic {
        height: 65px;
    }
    
    .hero-title {
        font-size: 1.5rem !important;
        line-height: 1.3;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.95rem;
        min-height: 1.5rem;
    }
    
    .icon-circle {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
    
    .app-card {
        padding: 1rem !important;
        border-radius: 14px;
    }
    
    .app-card .card-title {
        font-size: 0.95rem;
    }
    
    .app-card .card-text {
        font-size: 0.75rem !important;
    }
    
    .text-center.mt-5 {
        margin-top: 2rem !important;
    }
    
    /* Disable tilt on mobile for better performance */
    .app-card[data-tilt] {
        transform: none !important;
    }
    
    .app-card:hover {
        transform: translateY(-5px) scale(1.01);
    }
}

/* Small Devices (576px - 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .glass-container {
        padding: 2rem 1.5rem;
        border-radius: 20px;
    }
    
    .logo-container {
        gap: 15px;
        padding: 12px 25px;
    }
    
    .logo-politeknik {
        height: 38px;
    }
    
    .logo-wbiic {
        height: 75px;
    }
    
    .hero-title {
        font-size: 1.75rem !important;
        line-height: 1.3;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .icon-circle {
        width: 65px;
        height: 65px;
        font-size: 2rem;
    }
    
    .app-card {
        padding: 1.25rem !important;
    }
}

/* Medium Devices - Tablets (768px - 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .glass-container {
        padding: 2.5rem 2rem;
    }
    
    .logo-container {
        gap: 18px;
        padding: 14px 28px;
    }
    
    .logo-politeknik {
        height: 40px;
    }
    
    .logo-wbiic {
        height: 80px;
    }
    
    .hero-title {
        font-size: 2rem !important;
    }
    
    .hero-subtitle {
        font-size: 1.25rem;
    }
    
    .icon-circle {
        width: 70px;
        height: 70px;
        font-size: 2.2rem;
    }
}

/* Large Devices - Small Desktops (992px - 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .glass-container {
        padding: 2.5rem;
    }
    
    .hero-title {
        font-size: 2.25rem !important;
    }
    
    .icon-circle {
        width: 75px;
        height: 75px;
        font-size: 2.3rem;
    }
}

/* Extra Large Devices - Full Desktop (1200px+) */
@media (min-width: 1200px) {
    .glass-container {
        padding: 3rem;
    }
    
    .hero-title {
        font-size: 2.5rem !important;
    }
}

/* Landscape orientation adjustments for mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .main-wrapper {
        padding: 0.5rem;
    }
    
    .glass-container {
        padding: 1rem;
        margin: 0.5rem 0;
    }
    
    .logo-container {
        margin-bottom: 1rem;
        padding: 8px 20px;
    }
    
    .logo-politeknik {
        height: 30px;
    }
    
    .logo-wbiic {
        height: 50px;
    }
    
    .hero-title {
        font-size: 1.25rem !important;
        margin-bottom: 0.25rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
        min-height: auto;
    }
    
    .icon-circle {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .text-center.mb-5 {
        margin-bottom: 1rem !important;
    }
    
    .row.g-4 {
        --bs-gutter-y: 0.75rem;
    }
}

/* High DPI / Retina display adjustments */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .glass-container {
        border-width: 0.5px;
    }
    
    .app-card {
        border-width: 0.5px;
    }
}

/* Electric Card Styles - Scoped */
.electric-card-wrapper {
    --electric-border-color: #d97706; /* WBIIC Gold */
    --electric-light-color: #fcd34d; /* Lighter Gold */
    --gradient-color: rgba(217, 119, 6, 0.4);
    --color-neutral-900: #0a0e27; /* Navy match */
    
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 250px; /* Ensure minimum height */
    container-type: inline-size;
}

.electric-card-container {
    padding: 2px;
    border-radius: 24px;
    position: relative;
    height: 100%;
    width: 100%;
    background: linear-gradient(
        -30deg,
        var(--gradient-color),
        transparent,
        var(--gradient-color)
    ),
    linear-gradient(
        to bottom,
        var(--color-neutral-900),
        var(--color-neutral-900)
    );
    overflow: hidden; /* Contain effects */
}

/* Inner container */
.electric-inner-container {
    position: relative;
    width: 100%;
    height: 100%;
}

/* Border layers */
.electric-border-outer {
    border: 2px solid rgba(217, 119, 6, 0.5);
    border-radius: 24px;
    padding-right: 4px;
    padding-bottom: 4px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

.electric-main-card {
    width: 100%;
    height: 100%;
    border-radius: 24px;
    border: 2px solid var(--electric-border-color);
    filter: url(#turbulent-displace);
    position: absolute;
    top: -2px;
    left: -2px;
    pointer-events: none;
}

/* Glow effects */
.electric-glow-layer-1 {
    border: 2px solid rgba(217, 119, 6, 0.6);
    border-radius: 24px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    filter: blur(1px);
    pointer-events: none;
}

.electric-glow-layer-2 {
    border: 2px solid var(--electric-light-color);
    border-radius: 24px;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    filter: blur(4px);
    pointer-events: none;
}

/* Overlay effects */
.electric-overlay-1 {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 24px;
    opacity: 1;
    mix-blend-mode: overlay;
    filter: blur(16px);
    background: linear-gradient(
        -30deg,
        white,
        transparent 30%,
        transparent 70%,
        white
    );
    pointer-events: none;
}

.electric-overlay-2 {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 24px;
    opacity: 0.5;
    mix-blend-mode: overlay;
    filter: blur(16px);
    background: linear-gradient(
        -30deg,
        white,
        transparent 30%,
        transparent 70%,
        white
    );
    pointer-events: none;
}

/* Background glow */
.electric-background-glow {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    border-radius: 24px;
    filter: blur(32px);
    opacity: 0.3;
    z-index: -1;
    background: linear-gradient(
        -30deg,
        var(--electric-light-color),
        transparent,
        var(--electric-border-color)
    );
    pointer-events: none;
}

/* Content container */
.electric-content-container {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.electric-content-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
}

.electric-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    margin-top: 1rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.electric-scrollbar-glass {
    background: radial-gradient(
        47.2% 50% at 50.39% 88.37%,
        rgba(255, 255, 255, 0.12) 0%,
        rgba(255, 255, 255, 0) 100%
    ),
    rgba(255, 255, 255, 0.04);
    position: relative;
    border-radius: 14px;
    padding: 6px 12px;
    text-transform: uppercase;
    font-weight: bold;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.5rem;
    border: 1px solid rgba(255,255,255,0.1);
}

.electric-divider {
    width: 100%;
    border: none;
    height: 1px;
    background-color: white;
    opacity: 0.2;
    mask-image: linear-gradient(to right, transparent, black, transparent);
    -webkit-mask-image: linear-gradient(to right, transparent, black, transparent);
    margin: 1rem 0;
}
