:root {
    --bg-dark: #0d1117;
    --card-bg: #161b22;
    --border-color: #30363d;
    --text-main: #c9d1d9;
    --text-bright: #ffffff;
    --accent: #58a6ff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    line-height: 1.6;
    padding: 2rem 1rem;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 2.5rem;
}

/* Header */
.profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-main { display: flex; align-items: center; gap: 1.5rem; }

.profile-img-container {
    width: 110px; height: 110px;
    border-radius: 50%;
    border: 3px solid var(--accent);
    overflow: hidden;
    position: relative;
    background: #000;
}

.profile-img { width: 100%; height: 100%; object-fit: cover; position: relative; z-index: 2; }

.img-fallback {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    font-size: 2.5rem; color: #30363d;
}

.identity h1 { color: var(--text-bright); font-size: 2rem; }

.badge-row { display: flex; gap: 0.8rem; margin: 0.5rem 0; font-size: 0.9rem; }

.institution { color: var(--accent); font-weight: 600; }

.contact-row { display: flex; gap: 0.8rem; }

.social-icon {
    width: 38px; height: 38px;
    background: #21262d;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    display: flex; justify-content: center; align-items: center;
    color: var(--text-main); text-decoration: none; transition: 0.3s;
}

.social-icon:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-3px); }

.cv-download { width: auto; padding: 0 12px; gap: 5px; background: var(--accent); color: #000 !important; font-weight: bold; }

/* Sections */
.summary {
    background: #0d1117; padding: 1.2rem;
    border-radius: 1rem; border-left: 4px solid var(--accent);
    margin-bottom: 2.5rem;
}

.section-title { color: var(--text-bright); margin-bottom: 1.5rem; display: flex; align-items: center; gap: 10px; }

.skill-tags { display: flex; flex-wrap: wrap; gap: 0.7rem; }

.skill-tag {
    background: #21262d; padding: 0.4rem 0.9rem;
    border-radius: 20px; font-size: 0.85rem; border: 1px solid var(--border-color);
}

.cyber-tag { border-color: var(--accent); color: var(--accent); }

/* Projects Grid */
.project-cards {
    display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 2.5rem;
}

.project-item {
    background: #21262d; padding: 1.5rem; border-radius: 1rem;
    border: 1px solid var(--border-color); transition: 0.3s;
}

.project-item:hover { border-color: var(--accent); transform: translateY(-3px); }

.proj-icon { font-size: 1.8rem; color: var(--accent); margin-bottom: 1rem; }

.project-link {
    display: inline-block; margin-top: 1rem; color: var(--accent);
    text-decoration: none; font-size: 0.9rem; font-weight: bold;
}

/* Certifications Grid - النسخة الجديدة */
.certifications-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

.cert-card {
    background: #21262d;
    border-radius: 1rem;
    border: 1px solid var(--border-color);
    overflow: hidden;
    transition: 0.3s;
}

.cert-card:hover {
    border-color: var(--accent);
    transform: scale(1.02);
}

.cert-img-box {
    width: 100%;
    height: 180px;
    background: #000;
    border-bottom: 1px solid var(--border-color);
}

.cert-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* يحافظ على أبعاد الشهادة بدون قص */
    padding: 5px;
}

.cert-content {
    padding: 1.2rem;
}

.cert-content h3 {
    color: var(--text-bright);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.cert-content p {
    font-size: 0.85rem;
    color: var(--accent);
}

.role-badge {
    background: #238636; color: white;
    padding: 0.4rem 1rem; border-radius: 20px;
    font-size: 0.8rem; font-weight: bold;
}

.footer-note {
    text-align: center; margin-top: 3rem;
    padding-top: 1.5rem; border-top: 1px solid var(--border-color);
    font-size: 0.8rem; color: #8b949e;
}

@media (max-width: 768px) {
    .header-main, .project-cards { flex-direction: column; grid-template-columns: 1fr; }
    .container { padding: 1.5rem; }
}