/* Reset */
* { margin:0; padding:0; box-sizing:border-box; font-family: 'Roboto', sans-serif; }
html { font-size: 17px; }

html { scroll-behavior: smooth; }

/* Theme Variables */
:root {
    /* Base inspired by al-aqua.dev vibe with aqua/teal accents while keeping dark UI */
    --bg: #0A0A0A;
    --bg-soft-1: #0E0E10;
    --bg-soft-2: #141417;
    --text: #E5E5E5;
    --muted: #CCCCCC;
    --border: #333333;
    --accent: #00E5FF; /* aqua */
    --accent-2: #00B8D4; /* deeper aqua */
    --danger: #FF003C; /* legacy accent kept for subtle highlights if needed */
    --shadow-accent: rgba(0, 229, 255, 0.3);
}

/* Loading Animation */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 3px solid rgba(0, 229, 255, 0.1);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Global colors */
body { 
    background: var(--bg); 
    color: var(--text); 
    line-height:1.6;
    overflow-x: hidden;
}

/* Global page gutters to prevent edge-collisions */
section, footer, header {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

@media (max-width: 480px) {
    section, footer, header { padding-left: 16px; padding-right: 16px; }
}

/* Background Animation */
.bg-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, var(--bg), var(--bg-soft-1), var(--bg-soft-2));
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    z-index: -1;
    opacity: 0.82; /* السماح بظهور الصورة أسفلها */
}

/* Background Image Layer */
.bg-image {
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: url('images/Background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.50; /* مطفي لكن أوضح قليلاً */
    filter: blur(2px) saturate(115%);
    mix-blend-mode: normal; /* حتى لا يؤثر على تباين النص */
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Terminal Style */
.terminal-line {
    margin-bottom: 20px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
}

.terminal-heading {
    font-family: 'JetBrains Mono', monospace;
    font-weight: 600;
    letter-spacing: 0.2px;
}

.prompt {
    color: var(--accent);
    margin-right: 10px;
}

.command {
    color: var(--accent-2);
}

.terminal-icon {
    margin-right: 8px;
    font-size: 18px;
}

/* Links */
a { color: var(--accent); text-decoration:none; transition: all 0.3s ease; }
a:hover { text-decoration:underline; transform: translateY(-2px); }

/* Floating Top Nav */
.floating-nav {
    position: fixed;
    top: 16px; left: 50%; transform: translateX(-50%);
    display: flex; align-items: center; justify-content: center; gap: 12px;
    padding: 10px 14px;
    border-radius: 12px;
    background: rgba(10, 14, 16, 0.95);
    box-shadow: 0 10px 24px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.04);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.1);
    transition: all 0.3s ease;
    overflow: hidden;
}

.floating-nav:hover {
    box-shadow: 0 12px 30px rgba(0,229,255,0.2), inset 0 1px 0 rgba(255,255,255,0.06);
    border-color: rgba(0,229,255,0.3);
}

/* Progress Indicator */
.nav-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transition: width 0.3s ease;
    width: 0;
    box-shadow: 0 0 10px var(--accent);
}

.nav-btn {
    height: 44px; width: 44px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 8px;
    border: 1px solid var(--border);
    color: var(--text);
    background: rgba(255,255,255,0.02);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    position: relative;
}

.nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.nav-btn:hover::before {
    opacity: 0.1;
}

.nav-btn:hover { 
    background: rgba(255,255,255,0.08); 
    border-color: var(--accent); 
    transform: translateY(-2px) scale(1.05);
    box-shadow: 0 4px 12px rgba(0,229,255,0.3);
}

.nav-btn.active { 
    background: var(--accent); 
    color: #051014; 
    box-shadow: 0 6px 20px var(--shadow-accent), 0 0 0 3px rgba(0,229,255,0.1); 
    border-color: var(--accent);
    transform: translateY(-1px);
}

.nav-btn.nearby { 
    background: rgba(0,229,255,0.12); 
    border-color: rgba(0,229,255,0.5); 
    opacity: 0.8;
    box-shadow: 0 2px 8px rgba(0,229,255,0.15);
}

.nav-btn svg {
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.nav-btn:hover svg {
    transform: scale(1.1);
}

.nav-btn.active svg {
    transform: scale(1.05);
}
.lucide-icon { width: 28px; height: 28px; }
.nav-path { 
    font-size: 0.9rem; 
    color: var(--text); 
    opacity: 0.9;
    font-family: 'JetBrains Mono', monospace;
    padding: 0 8px;
    transition: all 0.3s ease;
}

.nav-path:hover {
    opacity: 1;
    color: var(--accent);
}
.hide-sm { display: none; }

@media (min-width: 768px) { .hide-sm { display: inline; } }

/* Simple tooltips for nav buttons */
.nav-btn { position: relative; }
.nav-btn[title]::after {
  content: attr(title);
  position: absolute;
  bottom: -34px; left: 50%; transform: translateX(-50%);
  background: rgba(10,14,16,0.92);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.nav-btn:hover::after { opacity: 1; transform: translateX(-50%) translateY(-2px); }
.nav-btn:active { transform: scale(0.95); }
.nav-btn.active:active { transform: scale(0.95); }


/* Buttons */
.btn { 
    display:inline-block; 
    padding:0.7em 1.3em; 
    border:1px solid var(--accent); 
    border-radius:5px; 
    transition:0.3s; 
    position: relative;
    overflow: hidden;
}

.btn-animate {
    position: relative;
    overflow: hidden;
}

.btn-animate::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--shadow-accent), transparent);
    transition: left 0.5s;
}

.btn-animate:hover::before {
    left: 100%;
}

.btn:hover { 
    background: var(--accent); 
    color: #051014; 
    transform: translateY(-2px);
    box-shadow: 0 5px 15px var(--shadow-accent);
}

.btn-download { 
    background: var(--accent); 
    color: #051014; 
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-icon {
    transition: transform 0.3s;
}

.btn-download:hover .btn-icon {
    transform: translateY(2px);
}

/* Hero Section */
.hero { 
    display:flex; 
    flex-wrap:wrap; 
    justify-content:space-between; 
    align-items:center; 
    padding:80px 20px 60px; 
    min-height: 100vh;
    scroll-margin-top: 80px;
}

.hero-text { flex:1; min-width:280px; }

.hero-text h1 { 
    font-size:2.5em; 
    margin-bottom:0.3em; 
    text-shadow: 0 0 20px var(--shadow-accent);
}

.hero-text h2 { 
    font-size:1.5em; 
    margin-bottom:0.6em; 
    color: var(--accent-2); 
}

.hero-text p { 
    max-width:600px; 
    margin-bottom:1em; 
}

.hero-buttons { 
    margin-top:1em; 
    display:flex; 
    gap:10px; 
    flex-wrap: wrap;
}

.hero-image img { 
    width:250px; 
    border-radius:15px; 
    border:2px solid var(--accent);
    transition: all 0.3s ease;
}

.profile-glow {
    box-shadow: 0 0 30px var(--shadow-accent);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 30px var(--shadow-accent); }
    50% { box-shadow: 0 0 50px rgba(0,229,255,0.6); }
    100% { box-shadow: 0 0 30px var(--shadow-accent); }
}

/* Fade In Animation */
.typewriter-delay {
    opacity: 0;
    animation: fadeIn 1s ease-in 0.5s forwards;
}

.typewriter-delay-2 {
    opacity: 0;
    animation: fadeIn 1s ease-in 1s forwards;
}

@keyframes fadeIn {
    to { opacity: 1; }
}

/* Skills Section */
#skills { 
    padding:80px 20px 60px; 
    text-align:center;
    scroll-margin-top: 80px;
}

.skills-grid { 
    display:grid; 
    grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); 
    gap:20px; 
    margin-top:30px; 
}

.skill-card { 
    background: rgba(255,255,255,0.05); 
    padding:20px; 
    border-radius:10px; 
    border:1px solid var(--border); 
    transition:all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.skill-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.skill-card:hover::before {
    transform: translateX(0);
}

.skill-card:hover { 
    background: rgba(0,229,255,0.08); 
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,229,255,0.18);
}

.card-header {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.skill-level {
    margin-top: 10px;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    overflow: hidden;
}

.skill-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 2px;
    transition: width 1s ease;
}

.brand-badges { 
  display: flex; 
  flex-wrap: wrap; 
  gap: 8px; 
  margin: 12px 0 10px; 
  justify-content: center;
  align-items: center;
}
.si-badge { 
  width: 32px; 
  height: 32px; 
  border-radius: 6px; 
  background: rgba(255,255,255,0.06);
  border: 1px solid var(--border);
  padding: 5px; 
  margin: 0;
  object-fit: contain;
  transition: all 0.3s ease;
  display: block;
}

.si-badge:hover {
  transform: translateY(-2px) scale(1.1);
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(0,229,255,0.3);
}

/* Fallback for broken images */
img[src*="simpleicons"], 
img[src*="tryhackme"] {
  background: rgba(255,255,255,0.03);
  position: relative;
}

img[src*="simpleicons"]:after,
img[src*="tryhackme"]:after {
  content: '⚠️';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

@media (max-width: 768px) {
  .brand-badges { gap: 8px; }
  .si-badge { width: 28px; height: 28px; padding: 4px; }
}

/* Projects Section */
#projects { 
    padding:80px 20px 60px; 
    scroll-margin-top: 80px;
    scroll-behavior: smooth;
}

#projects h2 {
    text-align: center;
}

/* Project Count Badge */
.project-count-badge {
    display: inline-block;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #051014;
    font-size: 0.5em;
    padding: 6px 12px;
    border-radius: 20px;
    margin-left: 10px;
    font-weight: 600;
    vertical-align: middle;
    animation: fadeIn 0.3s ease;
}

/* Search Highlight */
mark.search-highlight {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #051014;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 600;
    animation: highlightPulse 0.5s ease;
}

@keyframes highlightPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Projects Stats */
.projects-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin: 30px 0;
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

.stat-card {
    background: rgba(255,255,255,0.05);
    padding: 20px;
    border-radius: 10px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 8px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: rgba(0,229,255,0.08);
    border-color: var(--accent);
    transform: translateY(-3px);
}

.stat-number {
    font-size: 1.6em;
    font-weight: 600;
    color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.stat-label {
    font-size: 0.85em;
    color: var(--muted);
}

/* Top Language Icon */
#top-language-icon {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    padding: 4px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
}

/* Search and Filter Controls */
.projects-controls {
    margin: 30px 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.search-box {
    position: relative;
    width: 100%;
}

.search-box svg {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0,229,255,0.05);
}

.search-box input::placeholder {
    color: var(--muted);
}

.filter-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-controls select {
    flex: 1;
    min-width: 150px;
    padding: 12px 15px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter-controls select:hover {
    border-color: var(--accent);
}

.filter-controls select:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0,229,255,0.05);
}

.filter-controls select option {
    background: var(--bg-soft-1);
    color: var(--text);
}

.projects-grid { 
    display:grid; 
    grid-template-columns: repeat(3, 1fr);
    gap:20px; 
    margin-top:30px;
    grid-auto-rows: 1fr;
}

.loading-projects {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 40px;
    color: var(--muted);
}

.loading-projects.error-state {
    padding: 60px 40px;
}

.loading-projects.error-state svg {
    animation: errorShake 0.5s ease;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-10px); }
    75% { transform: translateX(10px); }
}

.project-card { 
    background: rgba(255,255,255,0.05); 
    padding: 20px; 
    border-radius: 10px; 
    border: 1px solid var(--border); 
    transition: all 0.3s ease;
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr auto auto;
    height: 100%;
    min-height: 380px;
    max-height: 380px;
    gap: 0;
    overflow: hidden;
}

.project-card:hover { 
    transform: translateY(-5px); 
    background: rgba(0,229,255,0.08); 
    box-shadow: 0 10px 30px rgba(0,229,255,0.18);
}

.project-header {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 32px;
    max-height: 32px;
    padding-right: 80px;
    max-width: calc(100% - 80px);
    margin: 6px 0;
}

.project-header img {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.project-header h3 {
    overflow: visible;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
    font-size: clamp(0.7em, 0.95em, 1.1em);
    line-height: 1.3;
}

.project-stats {
    display: flex;
    gap: 15px;
    margin: 10px 0;
    font-size: 14px;
    color: var(--muted);
    align-items: center;
}

.project-stats span {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* Stat Links */
.stat-link {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--muted);
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 4px 8px;
    border-radius: 4px;
}

.stat-link:hover {
    color: var(--accent);
    background: rgba(0,229,255,0.1);
    transform: translateY(-2px);
    text-decoration: none;
}

.stat-link svg {
    transition: transform 0.3s ease;
}

.stat-link:hover svg {
    transform: scale(1.1);
}

/* Language icon in project stats */
.project-stats .si-badge {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    padding: 2px;
    background: rgba(255,255,255,0.1);
    border: none;
}

.project-stats img {
    filter: brightness(0.9);
    transition: filter 0.3s ease;
}

.project-stats svg {
    transition: all 0.3s ease;
}

.project-card:hover .project-stats img {
    filter: brightness(1.2);
}

.project-card:hover .project-stats svg {
    transform: scale(1.1);
}

/* Golden star effect */
.project-card .project-stats span:first-child svg[fill="#FFD700"] {
    filter: drop-shadow(0 0 3px rgba(255, 215, 0, 0.6));
}

.project-card .tech { 
    font-size: 0.8em; 
    color: var(--muted);
    opacity: 0.7;
    margin: 0;
    text-align: right;
    font-style: italic;
}

/* Project card content structure */
.project-card > div:first-child {
    display: contents;
}

.project-card p:not(.tech) {
    margin: 0;
    padding: 0 10px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
    line-height: 1.5;
    max-height: 3em;
    min-height: 3em;
    font-size: 0.95em;
    text-align: center;
    word-wrap: break-word;
    overflow-wrap: break-word;
    position: relative;
}

.project-card p:not(.tech).expanded {
    -webkit-line-clamp: unset;
    max-height: none;
    min-height: auto;
}

.read-more-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.65em;
    cursor: pointer;
    padding: 3px 6px;
    margin-top: 4px;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    transition: all 0.3s ease;
    border-radius: 4px;
}

.read-more-btn:hover {
    background: rgba(0,229,255,0.1);
    transform: translateY(-1px);
}

.read-more-btn svg {
    width: 10px;
    height: 10px;
    transition: transform 0.3s ease;
}

.read-more-btn.expanded svg {
    transform: rotate(180deg);
}

.project-stats {
    padding-top: 12px;
    padding-bottom: 8px;
    margin-top: 12px;
    display: flex;
    gap: 10px;
    font-size: 13px;
    color: var(--muted);
    align-items: center;
    justify-content: space-between;
    min-height: 40px;
    flex-wrap: wrap;
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* Repository Type Badge */
.repo-type {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(0,229,255,0.1);
    border: 1px solid var(--accent);
    border-radius: 12px;
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    max-width: fit-content;
}

.repo-type svg {
    width: 12px;
    height: 12px;
}

/* Badges Container */
.badges-container {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    min-height: 28px;
}

/* License Badge */
.license-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    border-radius: 12px;
    font-size: 11px;
    color: var(--muted);
    font-weight: 500;
    max-width: fit-content;
}

.license-badge svg {
    width: 12px;
    height: 12px;
}

/* Project Meta Info */
.project-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 10px 0;
    font-size: 12px;
    color: var(--muted);
}

.project-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-meta svg {
    width: 14px;
    height: 14px;
}

/* Language Bar */
.language-bar {
    margin: 10px 0;
    height: 8px;
    background: rgba(255,255,255,0.1);
    border-radius: 4px;
    overflow: hidden;
    display: flex;
}

.language-segment {
    height: 100%;
    transition: all 0.3s ease;
}

.language-segment:hover {
    opacity: 0.8;
}

.language-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 8px 0;
    font-size: 11px;
}

.language-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.language-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

/* Share Button */
.project-share {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255,255,255,0.1);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 1;
}

/* Project Actions Container */
.project-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.project-copy,
.project-share {
    position: relative;
    background: rgba(255,255,255,0.08);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.project-copy:hover,
.project-share:hover {
    background: var(--accent);
    border-color: var(--accent);
    transform: scale(1.1);
}

.project-copy:active,
.project-share:active {
    transform: scale(0.95);
}

.project-copy svg,
.project-share svg {
    width: 14px;
    height: 14px;
    display: block;
}

/* Copy/Share Tooltip */
.copy-tooltip,
.share-tooltip {
    position: absolute;
    top: -35px;
    right: 0;
    background: var(--bg-soft-1);
    border: 1px solid var(--accent);
    border-radius: 6px;
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.copy-tooltip.show,
.share-tooltip.show {
    opacity: 1;
}

.project-card .btn {
    margin: 0;
    align-self: center;
    width: auto;
    padding: 0.7em 1.5em;
    text-align: center;
    min-height: 40px;
}

.contact-container { 
    display:flex; 
    flex-wrap:wrap; 
    gap:20px; 
    justify-content:center;
    scroll-margin-top: 80px;
}

#contact_me {
    padding: 80px 20px 60px;
    scroll-margin-top: 80px;
}

.contact_me {
    margin-top: 20px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

/* GitHub Activity */
.github-activity {
    margin-top: 30px;
    text-align: center;
}

.github-activity h3 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1.3em;
}

.github-activity img {
    width: 100%;
    max-width: 800px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg-soft-1);
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    filter: brightness(0.85) contrast(1.1);
    transition: all 0.3s ease;
}

.github-activity img:hover {
    filter: brightness(0.95) contrast(1.05);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 229, 255, 0.2);
}

/* Badges Section */
.badges-section {
    margin-top: 30px;
    text-align: center;
}

.badges-section h3 {
    margin-bottom: 15px;
    color: var(--text);
    font-size: 1.3em;
}

.badges-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.badge-item {
    transition: transform 0.3s ease;
}

.badge-item:hover {
    transform: translateY(-5px);
}

.badge-item img {
    height: 72px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
}

.badge-item iframe {
    width: min(420px, 100%);
    height: 110px;
    border: none;
    overflow: hidden;
    border-radius: 6px;
    background: transparent;
    display: block;
}

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: var(--accent);
    color: #051014;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-accent);
    transition: all 0.3s ease;
    opacity: 0;
    visibility: hidden;
    z-index: 999;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px var(--shadow-accent);
}

.back-to-top:active {
    transform: translateY(-1px);
}

.back-to-top svg {
    width: 24px;
    height: 24px;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: rgba(0,229,255,0.08);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.brand-icon {
    width: 18px;
    height: 18px;
    display: inline-block;
}

/* TryHackMe Badge */
.tryhackme-badge {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}
.tryhackme-badge img {
    height: 72px;
    border-radius: 4px;
    border: 1px solid var(--border);
    background: rgba(255,255,255,0.04);
}


/* Footer */
footer { 
    text-align:center; 
    padding:20px; 
    background: var(--bg); 
    border-top:1px solid var(--border); 
    margin-top:50px; 
}

/* Reveal Animation */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

.card-animate {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
    will-change: opacity, transform;
}

.card-animate.active {
    opacity: 1;
    transform: translateY(0);
    will-change: auto;
}

/* Responsive */
@media(max-width:1024px){
    .projects-grid { 
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width:768px){ 
    .hero { flex-direction:column; text-align:center; } 
    .hero-image { margin-top:20px; }
    .hero-text h1 { font-size:2em; }
    .skills-grid, .projects-grid { grid-template-columns:1fr; }
    
    .project-header {
        padding-right: 70px;
    }
    
    .project-actions {
        top: 10px;
        right: 10px;
        gap: 4px;
    }
    
    .project-copy,
    .project-share {
        width: 28px;
        height: 28px;
        padding: 6px;
    }
    
    .project-copy svg,
    .project-share svg {
        width: 12px;
        height: 12px;
    }
    
    .projects-stats {
        grid-template-columns: 1fr;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .filter-controls select {
        width: 100%;
    }
    
    .floating-nav {
        padding: 8px 10px;
        gap: 8px;
    }
    
    .nav-btn {
        width: 40px;
        height: 40px;
    }
    
    .lucide-icon {
        width: 22px;
        height: 22px;
    }
    
    .nav-path {
        font-size: 0.8rem;
    }
    
    .project-meta {
        font-size: 11px;
    }
    
    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
    
    .github-activity img {
        max-width: 100%;
    }
    
    .badges-grid {
        flex-direction: column;
    }
}

@media (max-width: 520px) {
    .tryhackme-badge img { height: 56px; }
    
    .search-box input {
        font-size: 13px;
        padding: 10px 10px 10px 40px;
    }
    
    .stat-number {
        font-size: 1.3em;
    }
    
    #top-language-icon {
        width: 22px;
        height: 22px;
    }
    
    .badge-item img {
        height: 60px;
    }
    
    .floating-nav {
        padding: 6px 8px;
        gap: 6px;
    }
    
    .nav-btn {
        width: 36px;
        height: 36px;
    }
    
    .lucide-icon {
        width: 20px;
        height: 20px;
    }
}
