/* ============================================================
   GUARDXFLY PORTFOLIO
   Premium Tech Agency & SaaS Aesthetics
   ============================================================ */

:root {
    /* Core Brand Colors */
    --accent: #ff0000;
    --accent-hover: #ff3333;
    --accent-glow: rgba(255, 0, 0, 0.6);
    
    /* Backgrounds */
    --bg-main: #050505;
    --bg-card: rgba(20, 20, 20, 0.6);
    --bg-card-hover: rgba(30, 30, 30, 0.8);
    
    /* Typography Colors */
    --text-primary: #FFFFFF;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    /* UI Borders */
    --border-light: rgba(255, 255, 255, 0.08);
    --border-accent: rgba(255, 31, 61, 0.3);
    
    /* Layout */
    --container-max: 1300px;
    --spacing: clamp(4rem, 8vw, 8rem);
    
    /* Typography Fluid Sizing */
    --font-xs: clamp(0.75rem, 1vw, 0.85rem);
    --font-sm: clamp(0.85rem, 1.2vw, 1rem);
    --font-base: clamp(1rem, 1.5vw, 1.1rem);
    --font-lg: clamp(1.2rem, 2vw, 1.5rem);
    --font-xl: clamp(1.5rem, 3vw, 2rem);
    --font-2xl: clamp(2rem, 4vw, 3rem);
    --font-3xl: clamp(2.5rem, 6vw, 4.5rem);
    
    /* Timings */
    --transition: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* =========================================
   1. GLOBAL RESET
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Rajdhani', 'Tajawal', sans-serif;
    font-size: var(--font-base);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    overflow-wrap: break-word;
}

img, svg {
    max-width: 100%;
    height: auto;
    display: block;
}

[dir="rtl"] { text-align: right; }
[dir="ltr"] { text-align: left; }
.text-center { text-align: center; }

/* Canvas Background */
#brain-canvas {
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    opacity: 0.3;
}

.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 20px;
}

.section {
    padding: var(--spacing) 0;
    position: relative;
}

/* Typography Hierarchy */
h1, h2, h3, h4 {
    line-height: 1.2;
    font-weight: 700;
}
.section-title {
    font-size: var(--font-2xl);
    margin-bottom: 1rem;
    font-family: 'Tajawal', sans-serif;
}
.section-subtitle {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    max-width: 600px;
    margin: 0 auto 3rem auto;
}
.text-accent {
    color: var(--accent);
}

/* =========================================
   2. NAVBAR
   ========================================= */
.top-nav {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    background: rgba(5, 5, 5, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-light);
    z-index: 1000;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}
.nav-brand img {
    height: 40px;
}
.nav-brand span {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: var(--font-lg);
    letter-spacing: 2px;
}

.nav-links {
    display: none;
    gap: 30px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Tajawal', sans-serif;
    font-size: var(--font-sm);
    transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
    color: var(--accent);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

@media (min-width: 1024px) {
    .nav-links { display: flex; }
}

/* Floating Bottom Nav (Mobile/Mockup Style) */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
    border-top: 1px solid rgba(255, 31, 61, 0.2);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 10px 0 15px 0;
    z-index: 1000;
}

@media (min-width: 1024px) {
    /* Kept visible for desktop if user wants it exactly like the mockup which shows it at the bottom of the full page */
    .mobile-bottom-nav {
        border-radius: 20px 20px 0 0;
        max-width: 800px;
        left: 50%;
        transform: translateX(-50%);
        border: 1px solid rgba(255, 31, 61, 0.2);
        border-bottom: none;
    }
}

.bottom-nav-item {
    color: var(--text-secondary);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    font-family: 'Tajawal', sans-serif;
    transition: var(--transition);
    flex: 1;
}

.bottom-nav-item i {
    font-size: 1.2rem;
}

.bottom-nav-item:hover, .bottom-nav-item.active {
    color: var(--accent);
}

.bottom-nav-center {
    position: relative;
    top: -25px;
    width: 60px;
    height: 60px;
    background: var(--bg-main);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--accent);
    box-shadow: 0 0 25px rgba(255, 31, 61, 0.6), inset 0 0 15px rgba(255, 31, 61, 0.3);
    color: #fff;
    font-size: 1.8rem;
    text-decoration: none;
    transition: var(--transition);
}

.bottom-nav-center:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 35px rgba(255, 31, 61, 0.8), inset 0 0 20px rgba(255, 31, 61, 0.5);
}

/* =========================================
   3. BUTTONS & UI ELEMENTS
   ========================================= */
.btn-primary, .btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 8px;
    font-family: 'Tajawal', sans-serif;
    font-size: var(--font-sm);
    font-weight: 700;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
}

.btn-primary {
    background: var(--accent);
    color: #fff;
    border: 1px solid var(--accent);
    box-shadow: 0 0 15px rgba(255, 31, 61, 0.5);
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(255, 31, 61, 0.8);
}

.btn-secondary {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: rgba(255, 31, 61, 0.1);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 0 15px rgba(255, 31, 61, 0.3);
}

.glass-card {
    background: rgba(15, 15, 15, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    backdrop-filter: blur(10px);
    transition: var(--transition);
}
.glass-card:hover {
    background: rgba(25, 25, 25, 0.9);
    border-color: rgba(255, 31, 61, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.8), 0 0 15px rgba(255, 31, 61, 0.1);
}

/* =========================================
   4. HERO SECTION
   ========================================= */
.hero-wrapper {
    min-height: 100vh;
    padding-top: 100px;
    display: flex;
    align-items: center;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    align-items: center;
}

@media (min-width: 1024px) {
    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    position: relative;
    z-index: 2;
    order: 2; /* Content goes second on mobile */
    text-align: center; /* Center text on mobile */
}

@media (min-width: 1024px) {
    .hero-content {
        order: 1; /* Content goes first on desktop */
        text-align: right;
    }
}

.hero-greeting {
    color: var(--accent);
    font-family: 'Orbitron', sans-serif;
    font-size: var(--font-sm);
    letter-spacing: 2px;
}

.hero-title {
    font-family: 'Orbitron', sans-serif;
    font-size: var(--font-3xl);
    line-height: 1.1;
}

.hero-subtitle {
    font-family: 'Tajawal', sans-serif;
    font-size: var(--font-xl);
    color: var(--accent);
    font-weight: 700;
}

.hero-desc {
    color: var(--text-secondary);
    font-size: var(--font-base);
    max-width: 600px;
    margin: 0 auto;
}

@media (min-width: 1024px) {
    .hero-desc {
        margin: 0;
    }
}

.hero-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    margin-top: 1rem;
}

@media (min-width: 1024px) {
    .hero-actions {
        justify-content: flex-start;
    }
}

.social-links {
    display: flex;
    gap: 15px;
    margin-top: 1rem;
    justify-content: center;
}

@media (min-width: 1024px) {
    .social-links {
        justify-content: flex-start;
    }
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
}
.social-icon:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

/* Hero Portrait Rings */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    order: 1; /* Portrait goes first on mobile */
    margin-bottom: 1rem;
}

@media (min-width: 1024px) {
    .hero-visual {
        order: 2; /* Portrait goes second on desktop */
        margin-bottom: 0;
    }
}

.rings-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 120%; /* Slightly larger to envelop the image nicely */
    max-width: 500px;
    aspect-ratio: 1/1;
    pointer-events: none;
    z-index: 0;
}

@media (min-width: 1024px) {
    .rings-container {
        width: 100%;
        max-width: none;
    }
}

.ring {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    border: 1px solid var(--accent);
    opacity: 0.3;
}

.ring-1 { width: 60%; height: 60%; border-style: dashed; animation: spin 20s linear infinite; }
.ring-2 { width: 80%; height: 80%; opacity: 0.1; animation: spin-reverse 30s linear infinite; }
.ring-3 { width: 100%; height: 100%; border-width: 2px; filter: drop-shadow(0 0 15px var(--accent)); }

@keyframes spin { 100% { transform: translate(-50%, -50%) rotate(360deg); } }
@keyframes spin-reverse { 100% { transform: translate(-50%, -50%) rotate(-360deg); } }

@keyframes pulse-glow {
    0%, 100% { 
        filter: drop-shadow(0 20px 30px rgba(0,0,0,0.8)) drop-shadow(0 0 20px rgba(255, 0, 0, 0.5)) drop-shadow(0 0 50px rgba(255, 0, 0, 0.3)); 
    }
    50% { 
        filter: drop-shadow(0 20px 30px rgba(0,0,0,0.8)) drop-shadow(0 0 40px rgba(255, 0, 0, 0.9)) drop-shadow(0 0 100px rgba(255, 0, 0, 0.7)); 
    }
}

.hero-portrait {
    position: relative;
    z-index: 2;
    width: 70%;
    max-width: 350px;
    animation: pulse-glow 3s ease-in-out infinite;
}

@media (min-width: 1024px) {
    .hero-portrait {
        width: 80%;
        max-width: 500px;
    }
}

.floating-badge {
    position: absolute;
    bottom: 20px;
    right: 0;
    z-index: 3;
    background: rgba(10,10,10,0.8);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-light);
    padding: 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 15px;
    animation: float 4s ease-in-out infinite;
}

.floating-badge i {
    font-size: 2rem;
    color: var(--accent);
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* =========================================
   5. STATISTICS BAR
   ========================================= */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid var(--border-light);
    background: linear-gradient(180deg, rgba(20,20,20,0.5) 0%, transparent 100%);
    margin-top: 3rem;
}
@media (min-width: 1024px) {
    .stats-grid { grid-template-columns: repeat(4, 1fr); }
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
}
.stat-icon {
    font-size: 2rem;
    color: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}
.stat-value {
    font-size: var(--font-xl);
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
}
.stat-label {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

/* =========================================
   6. SERVICES GRID
   ========================================= */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.service-box {
    padding: 25px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.service-icon-wrap {
    width: 50px;
    height: 50px;
    flex-shrink: 0;
    border-radius: 12px;
    background: rgba(255, 31, 61, 0.05);
    border: 1px solid rgba(255, 31, 61, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--accent);
    transition: var(--transition);
}

.service-box:hover .service-icon-wrap {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 0 15px var(--accent-glow);
}

.service-box h3 {
    font-size: var(--font-sm);
    margin-bottom: 5px;
}
.service-box p {
    font-size: var(--font-xs);
    color: var(--text-secondary);
}

/* =========================================
   7. PROJECTS PORTFOLIO
   ========================================= */
.projects-filter {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-secondary);
    padding: 8px 24px;
    border-radius: 100px;
    font-family: 'Tajawal', sans-serif;
    font-size: var(--font-sm);
    cursor: pointer;
    transition: var(--transition);
}
.filter-btn.active, .filter-btn:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.project-card {
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    border: 1px solid var(--border-light);
    background: #0A0A0A;
}

.project-img-wrapper {
    aspect-ratio: 16/9;
    overflow: hidden;
    position: relative;
}
.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}
.project-card:hover .project-img-wrapper img {
    transform: scale(1.05);
}

.project-info {
    padding: 20px;
}
.project-info h3 {
    font-size: var(--font-base);
    margin-bottom: 5px;
}
.project-info p {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    margin-bottom: 15px;
}

.project-tech {
    display: flex;
    gap: 8px;
}
.tech-pill {
    font-size: 0.7rem;
    padding: 4px 10px;
    background: rgba(255,255,255,0.05);
    border-radius: 4px;
    color: var(--accent);
}

/* =========================================
   8. INFO PANEL (About, Experience, Tech)
   ========================================= */
.info-panel {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid var(--border-light);
    border-radius: 24px;
    padding: 40px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
}
@media (min-width: 1024px) {
    .info-panel {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

.panel-column h3 {
    font-size: var(--font-lg);
    margin-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    padding-bottom: 10px;
}

.about-text {
    color: var(--text-secondary);
    font-size: var(--font-sm);
    line-height: 1.8;
}

.location-badge {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px;
    border: 1px solid var(--border-light);
    border-radius: 12px;
}

/* Timeline */
.timeline-item {
    position: relative;
    padding-right: 20px;
    margin-bottom: 20px;
}
.timeline-item::before {
    content: '';
    position: absolute;
    right: 0;
    top: 5px;
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
}
[dir="ltr"] .timeline-item { padding-right: 0; padding-left: 20px; }
[dir="ltr"] .timeline-item::before { right: auto; left: 0; }

.timeline-date { font-size: 0.7rem; color: var(--accent); }
.timeline-title { font-size: var(--font-sm); font-weight: 700; }
.timeline-org { font-size: 0.8rem; color: var(--text-secondary); }

/* Tech Grid */
.tech-icons-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}
.tech-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.tech-icon-item i {
    font-size: 2rem;
    color: var(--text-primary);
    transition: var(--transition);
}
.tech-icon-item:hover i {
    color: var(--accent);
    transform: translateY(-3px);
}

/* =========================================
   9. CTA & FOOTER
   ========================================= */
.cta-box {
    text-align: center;
    padding: 60px 20px;
    background: radial-gradient(circle at center, rgba(255, 31, 61, 0.1) 0%, transparent 70%);
    border-top: 1px solid var(--border-light);
    border-bottom: 1px solid var(--border-light);
}

.cta-box h2 {
    font-size: var(--font-2xl);
    margin-bottom: 15px;
}

.footer {
    padding: 40px 0;
    text-align: center;
    color: var(--text-secondary);
    font-size: var(--font-sm);
}

/* Scroll Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}
.reveal.active {
    opacity: 1;
    transform: translateY(0);
}