/* ================================================================
   ENHANCEMENTS CSS — Rashid Portfolio v4.0
   Features: Tech Stack, Typewriter, Testimonials, Toasts, 
             Project Modal, PWA Button, Live Stats
   ================================================================ */

/* ---------- 1. TECH STACK / SKILLS MARQUEE ---------- */
.tech-stack-section {
    padding: 40px 0;
    overflow: hidden;
    position: relative;
}

.tech-stack-section::before,
.tech-stack-section::after {
    content: '';
    position: absolute;
    top: 0;
    width: 120px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.tech-stack-section::before {
    left: 0;
    background: linear-gradient(to right, var(--bg-primary, #09090b), transparent);
}

.tech-stack-section::after {
    right: 0;
    background: linear-gradient(to left, var(--bg-primary, #09090b), transparent);
}

.marquee-track {
    display: flex;
    gap: 40px;
    animation: marqueeScroll 30s linear infinite;
    width: max-content;
}

.marquee-track:hover {
    animation-play-state: paused;
}

.tech-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 28px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 60px;
    white-space: nowrap;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: rgba(56, 189, 248, 0.3);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 30px rgba(56, 189, 248, 0.15);
}

.tech-item i {
    font-size: 1.5rem;
    color: var(--accent, #38bdf8);
}

.tech-item span {
    font-size: 0.95rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
}

@keyframes marqueeScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ---------- 2. TYPEWRITER EFFECT IN HERO ---------- */
.typewriter-wrapper {
    display: inline-flex;
    align-items: center;
    min-height: 1.3em;
}

.typewriter-text {
    color: var(--accent, #38bdf8);
    font-weight: 700;
    border-right: 3px solid var(--accent, #38bdf8);
    animation: cursorBlink 0.8s step-end infinite;
    padding-right: 4px;
}

@keyframes cursorBlink {
    50% { border-color: transparent; }
}

/* ---------- 3. TESTIMONIALS SECTION ---------- */
.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.testimonial-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 32px;
    position: relative;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.testimonial-card::before {
    content: '\201C';
    position: absolute;
    top: 16px;
    right: 24px;
    font-size: 5rem;
    font-family: Georgia, serif;
    color: rgba(56, 189, 248, 0.08);
    line-height: 1;
}

.testimonial-card:hover {
    border-color: rgba(56, 189, 248, 0.25);
    transform: translateY(-6px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.testimonial-card .stars {
    color: #fbbf24;
    font-size: 0.9rem;
    margin-bottom: 16px;
    letter-spacing: 2px;
}

.testimonial-card .quote {
    font-size: 1rem;
    line-height: 1.7;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 20px;
    font-style: italic;
}

.testimonial-author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.testimonial-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 700;
    color: #fff;
}

.testimonial-author-info h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.testimonial-author-info p {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 2px 0 0;
}

/* ---------- 4. PROJECT MODAL PREVIEW ---------- */
.project-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.35s ease;
}

.project-modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.project-modal {
    background: rgba(20, 20, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    max-width: 550px;
    width: 90%;
    transform: translateY(30px) scale(0.95);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
}

.project-modal-overlay.active .project-modal {
    transform: translateY(0) scale(1);
}

.project-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.project-modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.5);
}

.project-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
    margin-bottom: 20px;
}

.project-modal h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: #fff;
}

.project-modal .modal-desc {
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.7;
    margin-bottom: 20px;
}

.project-modal .modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.project-modal .modal-tags span {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent, #38bdf8);
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.project-modal .modal-actions {
    display: flex;
    gap: 12px;
}

.project-modal .modal-actions .btn {
    flex: 1;
    text-align: center;
}

/* ---------- 5. TOAST NOTIFICATIONS ---------- */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 24px;
    background: rgba(20, 20, 25, 0.92);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    color: #fff;
    font-size: 0.9rem;
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: auto;
    max-width: 380px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast.hide {
    transform: translateX(120%);
    opacity: 0;
}

.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
}

.toast.info .toast-icon {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
}

.toast.warning .toast-icon {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    border-radius: 0 0 14px 14px;
    background: var(--accent, #38bdf8);
    animation: toastProgress 3.5s linear forwards;
}

@keyframes toastProgress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ---------- 6. PWA INSTALL BUTTON (NAV) ---------- */
.pwa-install-btn {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: linear-gradient(135deg, var(--accent, #38bdf8), #6366f1);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    white-space: nowrap;
}

.pwa-install-btn.visible {
    display: flex;
}

.pwa-install-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(56, 189, 248, 0.35);
}

.pwa-install-btn i {
    font-size: 0.95rem;
}

/* ---------- 7. LIVE STATS COUNTER (HERO) ---------- */
.live-stat {
    position: relative;
}

.live-stat .live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    margin-right: 6px;
    animation: livePulse 2s ease-in-out infinite;
    vertical-align: middle;
}

@keyframes livePulse {
    0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
    50% { opacity: 0.7; box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
}

.stat-num.counting {
    transition: all 0.3s ease;
}

/* ---------- 8. ENHANCED PROJECT CARDS HOVER ---------- */
.project-card {
    cursor: pointer;
}

.project-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    opacity: 0;
    transition: opacity 0.4s ease;
    background: radial-gradient(600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(56, 189, 248, 0.06), transparent 40%);
    pointer-events: none;
}

.project-card:hover::after {
    opacity: 1;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    .project-modal {
        padding: 28px;
        max-width: 95%;
    }

    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }

    .toast {
        max-width: 100%;
    }

    .pwa-install-btn span {
        display: none;
    }

    .pwa-install-btn {
        padding: 8px 12px;
    }

    .tech-item {
        padding: 10px 20px;
    }

    .tech-item span {
        font-size: 0.85rem;
    }
}
