/* ============================================
   MAK TEAM HQ - Advanced Effects
   Particle system, 3D effects, and more
   ============================================ */

/* ============================================
   LOADING SCREEN
   ============================================ */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

.loading-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    animation: pulse-glow 2s ease-in-out infinite;
    margin-bottom: 2rem;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 30px var(--accent-blue-glow);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 60px var(--accent-blue-glow), 0 0 100px var(--accent-orange-glow);
        transform: scale(1.05);
    }
}

.loading-text {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
}

.loading-bar {
    width: 200px;
    height: 4px;
    background: var(--bg-secondary);
    border-radius: 2px;
    overflow: hidden;
}

.loading-progress {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-orange));
    animation: loading-progress 2s ease-in-out infinite;
}

@keyframes loading-progress {
    0% {
        width: 0;
        transform: translateX(0);
    }

    50% {
        width: 100%;
        transform: translateX(0);
    }

    100% {
        width: 100%;
        transform: translateX(100%);
    }
}

/* ============================================
   PARTICLE BACKGROUND
   ============================================ */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--accent-blue);
    border-radius: 50%;
    opacity: 0.6;
    animation: float-particle linear infinite;
    box-shadow: 0 0 10px var(--accent-blue-glow);
}

.particle:nth-child(even) {
    background: var(--accent-orange);
    box-shadow: 0 0 10px var(--accent-orange-glow);
}

@keyframes float-particle {
    0% {
        transform: translateY(100vh) rotate(0deg);
        opacity: 0;
    }

    10% {
        opacity: 0.6;
    }

    90% {
        opacity: 0.6;
    }

    100% {
        transform: translateY(-100vh) rotate(720deg);
        opacity: 0;
    }
}

/* Matrix rain effect */
.matrix-rain {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--accent-blue);
    overflow: hidden;
}

.matrix-column {
    position: absolute;
    top: -100%;
    animation: matrix-fall linear infinite;
    writing-mode: vertical-rl;
    text-orientation: upright;
}

@keyframes matrix-fall {
    0% {
        top: -100%;
    }

    100% {
        top: 100%;
    }
}

/* ============================================
   3D CARD EFFECTS
   ============================================ */
.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.3s ease;
}

.card-3d:hover {
    transform: perspective(1000px) rotateX(5deg) rotateY(-5deg) translateZ(20px);
}

.card-3d::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg,
            rgba(0, 168, 255, 0.1) 0%,
            transparent 50%,
            rgba(255, 140, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
    pointer-events: none;
}

.card-3d:hover::before {
    opacity: 1;
}

/* Holographic effect */
.card-holo {
    position: relative;
    overflow: hidden;
}

.card-holo::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg,
            transparent 0%,
            rgba(0, 168, 255, 0.1) 25%,
            rgba(255, 140, 0, 0.1) 50%,
            transparent 75%);
    transform: rotate(45deg);
    animation: holo-shine 3s ease-in-out infinite;
    pointer-events: none;
}

@keyframes holo-shine {

    0%,
    100% {
        transform: rotate(45deg) translate(-100%, -100%);
    }

    50% {
        transform: rotate(45deg) translate(100%, 100%);
    }
}

/* ============================================
   GLITCH EFFECT
   ============================================ */
.glitch {
    position: relative;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.8;
}

.glitch::before {
    color: var(--accent-blue);
    animation: glitch-1 0.3s infinite;
    clip-path: polygon(0 0, 100% 0, 100% 45%, 0 45%);
    transform: translate(-2px, -2px);
}

.glitch::after {
    color: var(--accent-orange);
    animation: glitch-2 0.3s infinite;
    clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
    transform: translate(2px, 2px);
}

@keyframes glitch-1 {

    0%,
    100% {
        transform: translate(-2px, -2px);
    }

    50% {
        transform: translate(2px, 2px);
    }
}

@keyframes glitch-2 {

    0%,
    100% {
        transform: translate(2px, 2px);
    }

    50% {
        transform: translate(-2px, -2px);
    }
}

/* ============================================
   NEON TEXT
   ============================================ */
.neon-text {
    color: var(--accent-blue);
    text-shadow:
        0 0 5px var(--accent-blue),
        0 0 10px var(--accent-blue),
        0 0 20px var(--accent-blue),
        0 0 40px var(--accent-blue);
    animation: neon-flicker 2s infinite;
}

@keyframes neon-flicker {

    0%,
    19%,
    21%,
    23%,
    25%,
    54%,
    56%,
    100% {
        text-shadow:
            0 0 5px var(--accent-blue),
            0 0 10px var(--accent-blue),
            0 0 20px var(--accent-blue),
            0 0 40px var(--accent-blue);
    }

    20%,
    24%,
    55% {
        text-shadow: none;
    }
}

.neon-orange {
    color: var(--accent-orange);
    text-shadow:
        0 0 5px var(--accent-orange),
        0 0 10px var(--accent-orange),
        0 0 20px var(--accent-orange),
        0 0 40px var(--accent-orange);
}

/* ============================================
   CYBER BORDER
   ============================================ */
.cyber-border {
    position: relative;
    border: none !important;
}

.cyber-border::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--accent-blue), var(--accent-orange), var(--accent-blue));
    background-size: 200% 200%;
    border-radius: inherit;
    z-index: -1;
    animation: border-rotate 3s linear infinite;
}

.cyber-border::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-card);
    border-radius: inherit;
    z-index: -1;
}

@keyframes border-rotate {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* ============================================
   NOTIFICATION BELL
   ============================================ */
.notification-bell {
    position: relative;
    cursor: pointer;
}

.notification-bell .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 18px;
    height: 18px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* Notification dropdown */
.notification-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 320px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.notification-bell:hover .notification-dropdown,
.notification-dropdown.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.notification-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
}

.notification-list {
    max-height: 300px;
    overflow-y: auto;
}

.notification-item {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    gap: 0.75rem;
    transition: background 0.2s ease;
}

.notification-item:hover {
    background: var(--bg-secondary);
}

.notification-item.unread {
    background: rgba(0, 168, 255, 0.05);
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.notification-content {
    flex: 1;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.notification-time {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ============================================
   ACHIEVEMENT BADGES
   ============================================ */
.badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.achievement-badge {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    border: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
}

.achievement-badge:hover {
    transform: scale(1.2);
    box-shadow: 0 0 20px var(--accent-blue-glow);
}

.achievement-badge.earned {
    border-color: var(--accent-orange);
    box-shadow: 0 0 15px var(--accent-orange-glow);
}

.achievement-badge.locked {
    opacity: 0.4;
    filter: grayscale(1);
}

.achievement-badge .tooltip {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.achievement-badge:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   CALENDAR VIEW
   ============================================ */
.calendar {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
}

.calendar-title {
    font-weight: 700;
    font-size: 1.1rem;
}

.calendar-nav {
    display: flex;
    gap: 0.5rem;
}

.calendar-nav button {
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-card);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-nav button:hover {
    background: var(--accent-blue);
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
}

.calendar-day-name {
    padding: 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.calendar-day {
    aspect-ratio: 1;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.calendar-day:hover {
    background: var(--bg-secondary);
}

.calendar-day.today {
    background: rgba(0, 168, 255, 0.1);
    border-color: var(--accent-blue);
}

.calendar-day.has-event::after {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--accent-orange);
    border-radius: 50%;
    margin-top: 4px;
}

.calendar-day.other-month {
    opacity: 0.3;
}

/* ============================================
   PROGRESS TIMELINE
   ============================================ */
.timeline {
    position: relative;
    padding: 1rem 0;
}

.timeline::before {
    content: '';
    position: absolute;
    right: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border-color);
}

.timeline-item {
    position: relative;
    padding-right: 50px;
    padding-bottom: 2rem;
}

.timeline-item:last-child {
    padding-bottom: 0;
}

.timeline-dot {
    position: absolute;
    right: 12px;
    top: 0;
    width: 18px;
    height: 18px;
    background: var(--bg-card);
    border: 3px solid var(--accent-blue);
    border-radius: 50%;
    z-index: 1;
}

.timeline-item.completed .timeline-dot {
    background: var(--success);
    border-color: var(--success);
}

.timeline-item.active .timeline-dot {
    background: var(--accent-orange);
    border-color: var(--accent-orange);
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 var(--accent-orange-glow);
    }

    50% {
        box-shadow: 0 0 0 10px transparent;
    }
}

.timeline-content {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 1rem;
}

.timeline-date {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.timeline-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* ============================================
   TYPING INDICATOR
   ============================================ */
.typing-text {
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-left: 3px solid var(--accent-blue);
    animation: typing 3s steps(30) forwards, blink-caret 0.75s step-end infinite;
}

@keyframes typing {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

@keyframes blink-caret {

    from,
    to {
        border-color: transparent;
    }

    50% {
        border-color: var(--accent-blue);
    }
}

/* ============================================
   SOUND TOGGLE
   ============================================ */
.sound-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sound-toggle:hover {
    background: var(--accent-blue);
    transform: scale(1.1);
}

.sound-toggle.muted {
    opacity: 0.5;
}

/* ============================================
   QUICK ACTIONS MENU
   ============================================ */
.quick-actions {
    position: fixed;
    bottom: 80px;
    left: 20px;
    z-index: 1000;
}

.quick-actions-toggle {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: 0 5px 20px var(--accent-blue-glow);
    transition: all 0.3s ease;
}

.quick-actions-toggle:hover {
    transform: scale(1.1);
}

.quick-actions-toggle.active {
    transform: rotate(45deg);
}

.quick-actions-menu {
    position: absolute;
    bottom: 70px;
    left: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.quick-actions.active .quick-actions-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.quick-action-btn {
    width: 50px;
    height: 50px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quick-action-btn:hover {
    background: var(--accent-blue);
    transform: scale(1.1);
}

/* ============================================
   CONFETTI ANIMATION
   ============================================ */
.confetti-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 9998;
    overflow: hidden;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    animation: confetti-fall 3s ease-out forwards;
}

@keyframes confetti-fall {
    0% {
        transform: translateY(-100%) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

/* ============================================
   STREAK COUNTER
   ============================================ */
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.2), rgba(255, 68, 68, 0.2));
    border: 1px solid var(--accent-orange);
    border-radius: var(--radius-md);
    font-weight: 600;
}

.streak-badge .fire {
    font-size: 1.2rem;
    animation: fire-bounce 0.5s ease infinite;
}

@keyframes fire-bounce {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-3px);
    }
}

/* ============================================
   LEVEL PROGRESS
   ============================================ */
.level-badge {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
}

.level-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-orange));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
}

.level-info {
    flex: 1;
}

.level-name {
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.level-progress {
    height: 8px;
    background: var(--bg-secondary);
    border-radius: 4px;
    overflow: hidden;
}

.level-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue), var(--accent-orange));
    border-radius: 4px;
    transition: width 1s ease;
}

.level-xp {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}