/* Custom Styles for mansourgaza.com */

/* Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: #0a0a0f;
    color: #ffffff;
    font-family: 'Tajawal', sans-serif;
    overflow-x: hidden;
    direction: rtl;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #0a0a0f;
}

::-webkit-scrollbar-thumb {
    background: #1a1a2e;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #ff0a0a;
}

/* Scanline Overlay */
.scanline-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 100;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0) 0px,
        rgba(0, 0, 0, 0) 1px,
        rgba(0, 0, 0, 0.03) 1px,
        rgba(0, 0, 0, 0.03) 2px
    );
}

.scanline-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(
        to bottom,
        rgba(255, 10, 10, 0.1),
        transparent
    );
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(-100%);
    }
    100% {
        transform: translateY(100vh);
    }
}

/* Noise Overlay */
.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99;
    opacity: 0.03;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* Typing Cursor */
.typing-cursor {
    animation: blink 1s step-end infinite;
    color: #00ffff;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Glitch Effect */
.glitch-text {
    position: relative;
}

.glitch-text:hover {
    animation: glitch 0.3s ease-in-out infinite;
}

@keyframes glitch {
    0% {
        transform: translate(0);
        text-shadow: -2px 0 #ff0a0a, 2px 0 #00ffff;
    }
    20% {
        transform: translate(-2px, 2px);
        text-shadow: 2px 0 #ff0a0a, -2px 0 #00ffff;
    }
    40% {
        transform: translate(-2px, -2px);
        text-shadow: 2px 2px #ff0a0a, -2px -2px #00ffff;
    }
    60% {
        transform: translate(2px, 2px);
        text-shadow: -2px -2px #ff0a0a, 2px 2px #00ffff;
    }
    80% {
        transform: translate(2px, -2px);
        text-shadow: -2px 2px #ff0a0a, 2px -2px #00ffff;
    }
    100% {
        transform: translate(0);
        text-shadow: -2px 0 #ff0a0a, 2px 0 #00ffff;
    }
}

/* Pulse Glow */
.pulse-glow {
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(255, 10, 10, 0.3);
    }
    50% {
        box-shadow: 0 0 40px rgba(255, 10, 10, 0.6);
    }
}

/* Text Glow */
.text-glow {
    text-shadow: 0 0 10px rgba(255, 10, 10, 0.5);
}

/* Blur Text Effect */
.blur-text {
    filter: blur(4px);
}

.blur-sm {
    filter: blur(3px);
}

.blur-md {
    filter: blur(6px);
}

/* Card Hover Effects */
.profile-card {
    transition: all 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 40px rgba(255, 10, 10, 0.2);
}

.profile-card:hover .blur-sm {
    filter: blur(4px);
}

/* Network SVG Styles */
#network-svg text {
    font-family: 'Tajawal', sans-serif;
}

.network-node {
    cursor: pointer;
    transition: all 0.3s ease;
}

.network-node:hover circle {
    filter: drop-shadow(0 0 10px rgba(255, 10, 10, 0.8));
}

.connection-line {
    stroke-dashoffset: 1000;
    animation: dash 20s linear infinite;
}

@keyframes dash {
    to {
        stroke-dashoffset: 0;
    }
}

/* Timeline Styles */
.timeline-container {
    position: relative;
}

.timeline-item {
    transition: all 0.5s ease;
}

.timeline-item:hover .bg-dark-secondary {
    border-color: #ff0a0a;
}

/* Evidence Card Styles */
.evidence-card {
    transition: all 0.3s ease;
}

.evidence-card:hover {
    transform: translateX(-10px);
    border-color: #ff0a0a;
}

/* Terminal Styles */
.terminal {
    position: relative;
    overflow: hidden;
}

.terminal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 0, 0, 0.1) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
}

/* Terminal Box in Coming Soon */
.terminal-box {
    position: relative;
    overflow: hidden;
}

.terminal-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        transparent 50%,
        rgba(0, 255, 255, 0.02) 50%
    );
    background-size: 100% 4px;
    pointer-events: none;
}

/* Particles Container */
#particles-container {
    background: radial-gradient(ellipse at center, #12121a 0%, #0a0a0f 100%);
}

/* Particle Effect (CSS only fallback) */
.particle {
    position: absolute;
    width: 2px;
    height: 2px;
    background: rgba(255, 10, 10, 0.5);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateY(-100vh) translateX(20px);
        opacity: 0;
    }
}

/* Loading Progress Bar */
#progress-bar {
    transition: width 0.1s ease-out;
    box-shadow: 0 0 10px rgba(255, 10, 10, 0.5);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

    .timeline-item {
        flex-direction: column;
        text-align: center;
    }

    .timeline-item > div:first-child,
    .timeline-item > div:last-child {
        text-align: center;
    }

    .timeline-item .bg-dark-secondary {
        margin: 1rem 0 !important;
    }

    #network-svg {
        height: 300px;
    }

    .network-node text {
        font-size: 8px;
    }

    .profile-card {
        padding: 1rem;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .revelation-content p {
        font-size: 1.2rem;
    }

    .warning-line {
        font-size: 1.5rem !important;
    }
}

/* Selection Styling */
::selection {
    background: rgba(255, 10, 10, 0.3);
    color: #ffffff;
}

/* Focus Styles */
a:focus, button:focus {
    outline: 2px solid #ff0a0a;
    outline-offset: 2px;
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .scanline-overlay,
    .noise-overlay,
    #loader,
    #particles-container {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .blur-sm, .blur-md, .blur-text {
        filter: none;
    }
}

/* Loader Glitch Effect */
#loader.glitch-out {
    animation: loader-glitch 0.5s ease-out forwards;
}

@keyframes loader-glitch {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    10% {
        transform: translateX(-10px);
        filter: hue-rotate(90deg);
    }
    20% {
        transform: translateX(10px);
        filter: hue-rotate(-90deg);
    }
    30% {
        transform: translateX(-5px);
    }
    40% {
        transform: translateX(5px);
    }
    100% {
        opacity: 0;
        transform: translateX(0);
        visibility: hidden;
    }
}

/* Hero Line Animation Helper */
.hero-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
}

.hero-line.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Section Reveal Animation */
section {
    opacity: 1;
}

.reveal-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stamp Rotation */
.evidence-stamp {
    animation: stamp-shake 0.5s ease-out;
}

@keyframes stamp-shake {
    0%, 100% {
        transform: rotate(-3deg);
    }
    25% {
        transform: rotate(-5deg);
    }
    75% {
        transform: rotate(-1deg);
    }
}

/* Network Pulse */
#central-node circle {
    animation: node-pulse 2s ease-in-out infinite;
}

@keyframes node-pulse {
    0%, 100% {
        stroke-width: 3;
        filter: drop-shadow(0 0 5px rgba(255, 10, 10, 0.5));
    }
    50% {
        stroke-width: 4;
        filter: drop-shadow(0 0 15px rgba(255, 10, 10, 0.8));
    }
}

/* Warning Section Gradient Animation */
#warning {
    position: relative;
}

#warning::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, rgba(255, 10, 10, 0.1) 0%, transparent 70%);
    animation: warning-pulse 3s ease-in-out infinite;
}

@keyframes warning-pulse {
    0%, 100% {
        opacity: 0.5;
    }
    50% {
        opacity: 1;
    }
}

/* Typed.js Cursor */
.typed-cursor {
    color: #00ffff;
    animation: blink 1s step-end infinite;
}
