/* ========================================
   GLOBAL UX ENHANCEMENTS
   Smooth scroll, animations, utilities
   ======================================== */

/* Smooth Scroll Behavior */
html {
    scroll-behavior: smooth;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--color-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--color-secondary);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #52e3c2;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--color-secondary);
    color: var(--color-primary);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 998;
    box-shadow: 0 4px 20px rgba(100, 255, 218, 0.3);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top:hover {
    background: #52e3c2;
    transform: translateY(-5px);
    box-shadow: 0 6px 30px rgba(100, 255, 218, 0.5);
}

.back-to-top i {
    font-size: 1.2rem;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 25, 47, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.loading-spinner.active {
    opacity: 1;
    visibility: visible;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(100, 255, 218, 0.2);
    border-top-color: var(--color-secondary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Notification System */
.notification {
    position: fixed;
    top: 80px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    padding: 16px 20px;
    background: var(--color-primary-light);
    border-left: 4px solid var(--color-secondary);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    z-index: 9999;
}

.notification.show {
    opacity: 1;
    transform: translateX(0);
}

.notification.success {
    border-left-color: #4ade80;
}

.notification.error {
    border-left-color: #f87171;
}

.notification.warning {
    border-left-color: #fbbf24;
}

.notification.info {
    border-left-color: var(--color-secondary);
}

.notification-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.notification.success .notification-icon {
    color: #4ade80;
}

.notification.error .notification-icon {
    color: #f87171;
}

.notification.warning .notification-icon {
    color: #fbbf24;
}

.notification.info .notification-icon {
    color: var(--color-secondary);
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    color: var(--color-text-main);
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.notification-message {
    color: var(--color-text-muted);
    font-size: 0.875rem;
    line-height: 1.4;
}

.notification-close {
    background: none;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--color-text-main);
}

/* Enhanced Focus States */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid var(--color-secondary);
    outline-offset: 2px;
}

/* Skip to Content Link (Accessibility) */
.skip-to-content {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
    z-index: 10001;
}

.skip-to-content:focus {
    width: auto !important;
    height: auto !important;
    padding: 10px 20px !important;
    margin: 0 !important;
    clip: auto !important;
    top: 20px !important;
    left: 20px !important;
    background: var(--color-secondary);
    color: var(--color-primary);
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    outline: 2px solid #fff;
}

/* Enhanced Button States */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Card Hover Effects */
.card,
.service-card,
.feature-card,
.project-card {
    transition: all 0.3s ease;
}

.card:hover,
.service-card:hover,
.feature-card:hover,
.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(100, 255, 218, 0.2);
}

/* Form Enhancement */
.form-group {
    position: relative;
}

.form-group input:focus+label,
.form-group textarea:focus+label,
.form-group select:focus+label {
    color: var(--color-secondary);
}

.form-error {
    color: #f87171;
    font-size: 0.875rem;
    margin-top: 4px;
    display: none;
}

.form-group.error .form-error {
    display: block;
}

.form-group.error input,
.form-group.error textarea,
.form-group.error select {
    border-color: #f87171 !important;
}

.form-success {
    color: #4ade80;
    font-size: 0.875rem;
    margin-top: 4px;
    display: none;
}

.form-group.success .form-success {
    display: block;
}

.form-group.success input,
.form-group.success textarea,
.form-group.success select {
    border-color: #4ade80 !important;
}

/* Character Counter */
.char-counter {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: right;
    margin-top: 4px;
}

.char-counter.warning {
    color: #fbbf24;
}

.char-counter.error {
    color: #f87171;
}

/* Page Transition */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-primary);
    z-index: 10001;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    pointer-events: none;
}

.page-transition.active {
    opacity: 1;
    visibility: visible;
}

/* Tooltip */
[data-tooltip] {
    position: relative;
    cursor: help;
}

[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-8px);
    padding: 8px 12px;
    background: rgba(10, 25, 47, 0.95);
    color: var(--color-text-main);
    font-size: 0.875rem;
    white-space: nowrap;
    border-radius: 6px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 1000;
}

[data-tooltip]:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-4px);
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .back-to-top {
        bottom: 90px;
        right: 20px;
        width: 45px;
        height: 45px;
    }

    .notification {
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    [data-tooltip]::after {
        display: none;
    }
}

/* Print Styles */
@media print {

    .back-to-top,
    .notification,
    .loading-spinner {
        display: none !important;
    }
}

/* =================================================================
   SULTIFY AUTONOMOUS CLOUD COCKPIT (HERO RIGHT)
   Ultra-Modern Glassmorphic 3.0 Cockpit Interface
   ================================================================= */
.hero-cockpit-window {
    background: rgba(10, 25, 47, 0.88) !important;
    backdrop-filter: blur(28px) saturate(180%) !important;
    -webkit-backdrop-filter: blur(28px) saturate(180%) !important;
    border: 1px solid rgba(100, 255, 218, 0.22) !important;
    border-radius: 28px !important;
    padding: 1.75rem !important;
    box-shadow: 
        0 25px 65px -15px rgba(0, 0, 0, 0.85),
        0 0 45px rgba(100, 255, 218, 0.12),
        inset 0 1px 1px rgba(255, 255, 255, 0.15) !important;
    position: relative !important;
    overflow: hidden !important;
    transition: border-color 0.3s ease, box-shadow 0.3s ease !important;
}

.hero-cockpit-window:hover {
    border-color: rgba(100, 255, 218, 0.45) !important;
    box-shadow: 
        0 30px 75px -12px rgba(0, 0, 0, 0.9),
        0 0 55px rgba(100, 255, 218, 0.22),
        inset 0 1px 1px rgba(255, 255, 255, 0.25) !important;
}

.cockpit-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.15rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1.15rem;
}

.window-controls {
    display: flex;
    gap: 8px;
}

.window-dot {
    width: 11px;
    height: 11px;
    border-radius: 50%;
}

.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #10b981; }

.cockpit-title-pill {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.74rem;
    font-family: 'Space Grotesk', monospace, sans-serif;
    color: #ccd6f6;
    background: rgba(255, 255, 255, 0.05);
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid rgba(100, 255, 218, 0.18);
    letter-spacing: 0.05em;
    font-weight: 700;
}

.status-dot-radar {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: var(--color-secondary, #64ffda);
    box-shadow: 0 0 8px var(--color-secondary, #64ffda);
    animation: radarPulse 2s infinite;
}

@keyframes radarPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(100, 255, 218, 0.7); }
    70% { transform: scale(1.15); box-shadow: 0 0 0 6px rgba(100, 255, 218, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(100, 255, 218, 0); }
}

.cockpit-fps-tag {
    font-size: 0.72rem;
    font-family: 'Space Grotesk', monospace;
    color: var(--color-secondary, #64ffda);
    font-weight: 700;
    letter-spacing: 0.05em;
}

/* Biometric / Cyber Scanner Box */
.cockpit-scanner-box {
    background: rgba(5, 13, 27, 0.88);
    border: 1px solid rgba(100, 255, 218, 0.28);
    border-radius: 20px;
    padding: 1.15rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
}

.biometric-grid {
    display: flex;
    align-items: center;
    gap: 1.15rem;
}

.scanner-avatar-frame {
    width: 72px;
    height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.15) 0%, rgba(0, 180, 216, 0.2) 100%);
    border: 2px dashed rgba(100, 255, 218, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.scanner-avatar-frame i {
    font-size: 2rem;
    color: var(--color-secondary, #64ffda);
}

.scan-laser-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #64ffda, #00b4d8, transparent);
    box-shadow: 0 0 12px #64ffda;
    animation: scanLaser 2.4s ease-in-out infinite alternate;
}

@keyframes scanLaser {
    0% { top: 0%; opacity: 0.9; }
    50% { opacity: 0.4; }
    100% { top: 96%; opacity: 0.9; }
}

.scanner-info {
    flex: 1;
}

.scanner-status-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.72rem;
    font-weight: 800;
    color: #10b981;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 4px;
}

.scanner-student-name {
    font-size: 1.05rem;
    font-weight: 800;
    color: #ffffff;
    margin-bottom: 2px;
    font-family: 'Space Grotesk', sans-serif;
    letter-spacing: -0.01em;
}

.scanner-meta {
    font-size: 0.76rem;
    color: #8892b0;
}

/* Floating Cockpit Micro Badges */
.floating-cockpit-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0.8rem 1.1rem;
    background: rgba(10, 25, 47, 0.9);
    border: 1px solid rgba(255, 255, 255, 0.09);
    border-radius: 16px;
    backdrop-filter: blur(16px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.75rem;
    transition: transform 0.25s ease, border-color 0.25s ease;
}

.floating-cockpit-badge:hover {
    transform: translateX(4px);
    border-color: rgba(100, 255, 218, 0.35);
}

.badge-icon-wrap {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.badge-icon-fintech {
    background: rgba(100, 255, 218, 0.15);
    color: #64ffda;
    box-shadow: 0 0 12px rgba(100, 255, 218, 0.3);
}

.badge-icon-edusuite {
    background: rgba(99, 102, 241, 0.18);
    color: #a5b4fc;
    box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.badge-content {
    flex: 1;
    min-width: 0;
}

.badge-content h4 {
    margin: 0 0 2px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.01em;
}

.badge-content p {
    margin: 0;
    font-size: 0.72rem;
    color: #8892b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.badge-status-tag {
    margin-left: auto;
    font-size: 0.74rem;
    font-family: 'Space Grotesk', monospace;
    font-weight: 700;
    flex-shrink: 0;
}

.tag-cleared {
    color: #10b981;
}

.tag-active {
    color: #64ffda;
}

/* Bottom Telemetry Strip */
.cockpit-bottom-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 0.85rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.76rem;
    color: #8892b0;
}

.cockpit-bottom-strip code {
    color: #64ffda;
    background: rgba(100, 255, 218, 0.08);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.72rem;
}

.cockpit-tls-tag {
    font-family: 'Space Grotesk', monospace;
    color: var(--color-secondary, #64ffda);
    font-weight: 700;
}

/* Mobile Responsiveness for Cockpit Window */
@media screen and (max-width: 768px) {
    .hero-cockpit-window {
        padding: 1.15rem 1rem !important;
        border-radius: 20px !important;
    }
    .cockpit-fps-tag {
        display: none;
    }
    .scanner-avatar-frame {
        width: 60px;
        height: 60px;
    }
    .scanner-avatar-frame i {
        font-size: 1.6rem;
    }
    .scanner-student-name {
        font-size: 0.95rem;
    }
    .floating-cockpit-badge {
        padding: 0.7rem 0.85rem;
    }
    .badge-status-tag {
        font-size: 0.68rem;
    }
}
@media screen and (max-width: 480px) {
    .badge-status-tag {
        display: none;
    }
}

/* =================================================================
   PERMANENT STABILITY & CALM ANIMATION ENGINE (SULTIFY CORE)
   Zero Layout Shifts • Silky Smooth 60fps Micro-Animations
   ================================================================= */

/* 1. Locked Typewriter Bounds - Absolute Zero Shift */
.hero-typewriter-wrapper {
    display: inline-block !important;
    min-height: 1.25em !important;
    vertical-align: bottom !important;
    white-space: nowrap !important;
}

.hero-title-highlight {
    display: inline-block !important;
    min-width: 290px !important;
    white-space: nowrap !important;
    text-align: left !important;
    vertical-align: bottom !important;
}

@media screen and (max-width: 768px) {
    .hero-title-highlight {
        min-width: 220px !important;
    }
}

/* 2. Marquee Guard: Locked 70s Silky Glide */
.tech-track {
    animation: scroll 70s linear infinite !important;
    animation-duration: 70s !important;
    will-change: transform !important;
    transform: translateZ(0) !important;
    backface-visibility: hidden !important;
}

/* 3. Cockpit Micro-Animations Calm Timing */
.scan-laser-line {
    animation: scanLaser 3.6s ease-in-out infinite alternate !important;
    animation-duration: 3.6s !important;
    will-change: top, opacity !important;
}

.status-dot-radar {
    animation: radarPulse 3s infinite !important;
    animation-duration: 3s !important;
}

.connection-node {
    animation: pulse-node 7s ease-in-out infinite !important;
    animation-duration: 7s !important;
    will-change: transform !important;
    transform: translateZ(0) !important;
}

/* 4. Glass Cards: Zero Scale Jump / No Hover Shaking */
.glass-card {
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease !important;
    will-change: transform, box-shadow !important;
    backface-visibility: hidden !important;
}

/* 5. Prevent ANY Global Override from speeding up animations */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}
