/* =========================================
   1. Base & Reset
   ========================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Tajawal', sans-serif;
}

html {
    font-size: 22px;
    scroll-behavior: smooth;
    background-color: #051E37;
    scroll-behavior: smooth;
}

body {
    background: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    color: #333;
    overflow-x: hidden;
}

/* =========================================
   2. Shared Navigation & Headers
   ========================================= */
/* Floating Header (Skills & CV) */
.header-top {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 2000;
    background: transparent;
    padding: 1rem 1rem;
    direction: ltr;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    transition: border-bottom 0.3s ease;
}

.header-top.scrolled {
    background: #051E37 url('../assets/images/background.png') center/cover;
    backdrop-filter: blur(10px);
    border-bottom: 0.4rem solid #ce9b1b;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.skill-header.scrolled {
    background: #051E37 url('../assets/images/background2.png') center/cover;
}

/* Mini Header (Projects) */
.mini-header {
    direction: ltr;
    position: sticky;
    top: 0;
    z-index: 1000;
    background: #051E37 url('../assets/images/background.png') center/cover;
    border-bottom: 0.3rem solid #ce9b1b;
    padding: 1rem 1rem;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    min-height: 4.5rem;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.header-title {
    font-size: 1.5rem;
    text-align: center;
    margin: 0;
    font-weight: bold;
    color: white;
}

.lang-btn {
    justify-self: start;
    background: #ce9b1b;
    color: #fff;
    width: 3rem;
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.index-lang-btn { 
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: #ce9b1b;
    color: #fff;
    width: 3rem;
    aspect-ratio: 1;
    border-radius: 50%;
    border: none;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2);
    z-index: 9999;
}

.lang-btn:hover, .index-lang-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 0.2rem 0.5rem rgba(0, 0, 0, 0.2);
    filter: brightness(1.05);
}

.nav-links {
    justify-self: end;
    display: flex;
    gap: 0.5rem;
}

.nav-btn {
    background: #ce9b1b;
    color: #fff;
    text-decoration: none;
    width: 3rem;
    aspect-ratio: 1;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-weight: bold;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.nav-btn:hover {
    transform: scale(1.05);
    filter: brightness(1.1);
}

/* =========================================
   3. Shared Components (Buttons, Footer, Lightbox)
   ========================================= */
.footer {
    background: #051E37 url('../assets/images/background.png') center/cover;
    color: #ddd;
    text-align: center;
    padding: 1.5rem;
    border-top: 0.3rem solid #ce9b1b;
    font-size: 0.9rem;
    margin-top: auto;
}

.section-title, .section-header {
    font-size: 1.5rem;
    margin: 2rem 0 1rem;
    color: #051E37;
    border-bottom: 2px solid #dee6f0;
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-header i {
    color: #ce9b1b;
}

/* Lightbox Base */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 3000;
    justify-content: center;
    align-items: center;
    direction: ltr;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
    opacity: 1;
}

.lightbox-img {
    max-width: 90%;
    max-height: 90vh;
    border-radius: 0.5rem;
    object-fit: contain;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.lightbox-overlay.active .lightbox-img {
    transform: scale(1);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 2.5rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 3001;
    line-height: 1;
}

.lightbox-close:hover {
    color: #ce9b1b;
}

.lightbox-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    color: white;
    border: none;
    font-size: 3rem;
    cursor: pointer;
    padding: 1rem;
    transition: 0.2s;
}

.lightbox-btn:hover {
    color: #ce9b1b;
}

.lightbox-btn.prev {
    left: 20px;
}

.lightbox-btn.next {
    right: 20px;
}

/* =========================================
   4. Page Specific: Index
   ========================================= */
.index-header {
    background: #051E37 url('../assets/images/background.png') top/cover;
    min-height: 40vh;
    border-bottom: 0.5rem solid #ce9b1b;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 1rem;
    padding-top: 4rem;
    position: relative;
}

.index-header .lang-btn {
    position: absolute;
    top: 1rem;
    left: 1rem;
}

.profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100%;
}

.avatar {
    width: 10rem;
    aspect-ratio: 1;
    border-radius: 50%;
    border: 0.3rem solid #ce9b1b;
    margin: 0 auto 0.5rem;
}

.index-name {
    color: white;
    text-shadow: 0.1rem 0.1rem 0.2rem #000;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
    font-weight: bold;
}

.index-title {
    color: #ddd;
    font-size: 1rem;
    margin-bottom: 1.5rem;
    font-style: italic;
    font-family: 'Times New Roman', 'Tajawal', serif;
}

.index-main {
    width: 100%;
    max-width: 50rem;
    margin: 2rem auto;
    padding: 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    text-align: center;
}

.index-bio {
    font-style: italic;
    font-family: 'Times New Roman', 'Tajawal', serif;
    font-size: 1.1rem;
    color: #555;
    line-height: 1.6;
}

.index-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.index-btn {
    padding: 0.8rem 2rem;
    border-radius: 0.5rem;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    background: #29629b;
    flex: 1;
    transition: all 0.2s ease;
    display: grid;
    place-items: center;
}

.index-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.index-btn.gold {
    background: #ce9b1b;
}

.index-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.index-card {
    background: #fff;
    border: 1px solid #dee6f0;
    padding: 1rem;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    text-align: left;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
}

.index-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.4rem 0.8rem rgba(0, 0, 0, 0.08);
    border-color: #ce9b1b;
}

.index-card i {
    color: #ce9b1b;
    font-size: 1.3rem;
    width: 1.5rem;
    text-align: center;
}

/* =========================================
   5. Page Specific: Projects
   ========================================= */
.projects-container {
    width: 100%;
    max-width: 85rem;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.projects-grid.single-col {
    grid-template-columns: 1fr;
}

.project-card {
    background: #fff;
    border: 1px solid #dee6f0;
    border-radius: 0.8rem;
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}

.project-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(5, 30, 55, 0.1);
    border-color: #ce9b1b;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-size: 1.1rem;
    font-weight: bold;
    color: #051E37;
    border-bottom: 2px solid #dee6f0;
    padding-bottom: 0.5rem;
}

.card-header i {
    font-size: 1.5rem;
    color: #ce9b1b;
    transition: transform 0.3s ease;
}

.project-card:hover .card-header i {
    transform: scale(1.1);
}

.card-desc {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

.tech-stack {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.tech-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.9rem;
    color: #666;
    gap: 0.3rem;
    text-align: center;
    transition: transform 0.2s ease;
}

.tech-item:hover {
    transform: translateY(-3px);
}

.tech-item i, .tech-item img {
    font-size: 2.5rem;
    color: #29629b;
    height: 2.5rem;
}

.problem-solution h4 {
    font-size: 0.9rem;
    color: #051E37;
    margin-bottom: 0.3rem;
}

.problem-solution p {
    font-size: 0.8rem;
    color: #555;
    line-height: 1.4;
}

.action-box {
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 0.5rem;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.action-info {
    font-size: 0.8rem;
}

.action-info span {
    display: block;
    margin-bottom: 0.2rem;
}

.action-btn {
    background: #50a14f;
    color: white;
    border: none;
    padding: 0.5rem 2rem;
    border-radius: 0.4rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.8rem;
}

.action-btn:hover {
    background: #3e813d;
    transform: scale(1.05);
}

.desktop-app-preview {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.video-player {
    width: 100%;
    aspect-ratio: 16/9;
    border: solid 1px #bbb;
    border-radius: 0.5rem;
    background: #000;
    object-fit: cover;
    outline: none;
}

/* Carousel */
.carousel-wrapper {
    width: 100%;
    position: relative;
}

.carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    border: solid 1px #bbb;
    scroll-behavior: smooth;
    scrollbar-width: none;
    border-radius: 0.5rem;
    background: #000;
}

.carousel::-webkit-scrollbar {
    display: none;
}

.carousel-img {
    flex: 0 0 100%;
    width: 100%;
    aspect-ratio: 16/9;
    scroll-snap-align: center;
    object-fit: cover;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.carousel-img:hover {
    opacity: 0.9;
}

.dots {
    text-align: center;
    margin-top: 8px;
    direction: ltr;
}

.dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background: #ccc;
    border-radius: 50%;
    margin: 0 4px;
    cursor: pointer;
    transition: 0.3s;
}

.dot.active {
    background: #ce9b1b;
    transform: scale(1.2);
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    z-index: 10;
    transition: 0.3s;
}

.carousel-btn:hover {
    background: #ce9b1b;
}

.carousel-btn.prev {
    left: 5px;
}

.carousel-btn.next {
    right: 5px;
}

/* =========================================
   6. Page Specific: Skills
   ========================================= */
.skills-header {
    background: #051E37 url('../assets/images/background2.png') bottom/cover;
    padding: 8rem 2rem 10rem 2rem;
    color: white;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.skills-header h1 {
    font-size: 2.5rem;
    color: #ce9b1b;
}

.skills-header p {
    font-size: 1.1rem;
    color: #dee6f0;
    max-width: 700px;
    line-height: 1.6;
    text-shadow: 0.1rem 0.1rem 0.1rem #000;
}

.skills-wrapper {
    width: 100%;
    max-width: 85rem;
    margin: -6rem auto 4rem auto;
    padding: 0 1rem;
    position: relative;
    z-index: 10;
}

.skills-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(420px, 1fr));
    gap: 2.5rem;
}

.skill-card {
    position: relative;
    background: #ffffff;
    color: #051E37;
    overflow: hidden;
    border-radius: 1rem;
    padding: 2.5rem;
    box-shadow: 0 12px 40px rgba(8, 24, 58, 0.08);
    display: flex;
    flex-direction: column;
    border-bottom: 4px solid #ce9b1b;
    scroll-margin-top: 8rem;
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.3s ease;
}

.skill-card.visible {
    opacity: 1;
    transform: translateY(0);
}

.skill-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 45px rgba(8, 24, 58, 0.15);
}

.bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
    background: radial-gradient(circle at 20% 30%, #ce9b1b15, transparent 40%), radial-gradient(circle at 80% 70%, #051E370a, transparent 40%);
    animation: floatBg 12s infinite alternate;
}

@keyframes floatBg {
    from {
        transform: translate(0, 0);
    }
    to {
        transform: translate(-15px, 15px);
    }
}

.bg-icon {
    position: absolute;
    right: -20px;
    bottom: -20px;
    font-size: 10rem;
    color: #051E37;
    opacity: 0.03;
    transform: rotate(-15deg);
    pointer-events: none;
    transition: 0.5s;
    z-index: 1;
}

[dir="rtl"] .bg-icon {
    right: auto;
    left: -20px;
    transform: rotate(15deg);
}

.skill-card:hover .bg-icon {
    opacity: 0.06;
    transform: scale(1.1) rotate(0);
    color: #ce9b1b;
}

.card-inner {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.title {
    font-size: 1.8rem;
    font-weight: bold;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: #051E37;
}

.highlight-gold {
    background: linear-gradient(90deg, #ce9b1b, #d9a828);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.description {
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 2rem;
    color: #444;
}

.bold-word {
    font-weight: bold;
    color: #051E37;
}

.accent-word {
    font-style: italic;
    color: #2a3a5f;
}

.clean-skill-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin-bottom: 2rem;
}

.skill-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0 0.6rem 0.6rem;
    border: 1px solid rgba(5, 30, 55, 0.08);
    border-radius: 10rem;
    color: #051E37;
    font-weight: 600;
    font-size: 1rem;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
[dir="rtl"] .skill-item {
    padding: 0.6rem 0.6rem 0.6rem 0;
}

.skill-item:hover {
    border-color: #ce9b1b;
    transform: translateX(4px);
}

[dir="rtl"] .skill-item:hover {
    transform: translateX(-4px);
}

.skill-icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    background: rgba(206, 155, 27, 0.1);
    color: #ce9b1b;
    border-radius: 50%;
    font-size: 1rem;
}

.signature {
    margin-top: auto;
    border-top: 1px dashed rgba(8, 24, 58, 0.2);
    padding-top: 1.2rem;
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
}

/* =========================================
   7. Page Specific: CV
   ========================================= */
.cv-header {
    background: #051E37 url('../assets/images/background.png') center/cover;
    border-bottom: 0.4rem solid #ce9b1b;
    padding: 6rem 2rem 2rem 2rem;
    color: white;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.cv-header.scrolled {
    border-bottom: none;
}

.header-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 0 auto;
    width: 100%;
}

.name-title-group {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.cv-name {
    font-size: 1.8rem;
    font-weight: bold;
}

.cv-job-title {
    font-size: 1.1rem;
    font-style: italic;
    font-family: 'Times New Roman', 'Tajawal';
    color: #eee;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    font-size: 0.95rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    text-decoration: none;
    color: white;
}

.cv-wrapper {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 2rem;
    width: 100%;
    max-width: 85rem;
    margin: 2rem auto;
    padding: 0 1rem;
    align-items: start;
}

.cv-main {
    background: #fff;
    padding: 2rem;
    border-radius: 0.8rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02);
    border: 1px solid #dee6f0;
}

.intro-text {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #555;
    padding-bottom: 2rem;
    margin-bottom: 2rem;
}

.intro-text strong {
    color: #ce9b1b;
}

.timeline {
    border-left: 2px solid #ce9b1b;
    padding-left: 1.5rem;
    margin-left: 0.5rem;
    margin-bottom: 2.5rem;
}

[dir="rtl"] .timeline {
    border-left: none;
    border-right: 2px solid #ce9b1b;
    padding-left: 0;
    padding-right: 1.5rem;
    margin-left: 0;
    margin-right: 0.5rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    width: 14px;
    height: 14px;
    background: #051E37;
    border: 3px solid #ce9b1b;
    border-radius: 50%;
    top: -1px;
    left: -1.87rem;
}

[dir="rtl"] .timeline-dot {
    left: auto;
    right: -1.88rem;
}

.timeline-date {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.3rem;
    font-weight: bold;
}

.timeline-title {
    font-size: 1.1rem;
    color: #051E37;
    font-weight: bold;
    margin-bottom: 0.2rem;
}

.timeline-subtitle {
    font-size: 0.9rem;
    color: #ce9b1b;
    margin-bottom: 0.8rem;
    font-style: italic;
}

.timeline-desc {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.5;
}

.timeline-desc ul {
    padding-left: 1.2rem;
    margin-top: 0.5rem;
}

[dir="rtl"] .timeline-desc ul {
    padding-left: 0;
    padding-right: 1.2rem;
}

.timeline-desc li {
    margin-bottom: 0.3rem;
}

.certs-container {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cert-thumb {
    width: 15rem;
    max-width: 100%;
    height: 10rem;
    object-fit: cover;
    border-radius: 0.5rem;
    border: 2px solid #dee6f0;
    margin-top: 1rem;
    cursor: zoom-in;
    transition: 0.2s;
}

.cert-thumb:hover {
    transform: scale(1.05);
    border-color: #ce9b1b;
}

.cv-skills-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.2rem;
    margin-bottom: 2.5rem;
}

.skills-group {
    background: #f8f9fa;
    padding: 1.2rem;
    border-radius: 0.6rem;
    border: 1px solid #dee6f0;
    transition: 0.3s;
    text-decoration: none;
}

.skills-group:hover {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
    border-color: #ce9b1b;
}

.skills-group-title {
    font-size: 0.95rem;
    color: #051E37;
    margin-bottom: 1rem;
    font-weight: bold;
    border-bottom: 2px dotted #ccc;
    padding-bottom: 0.5rem;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag {
    background: #dee6f0;
    color: #051E37;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: 0.1s;
}

.tag:hover {
    background: #051E37;
    color: #fff;
}

.lang-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.lang-card {
    background: #f8f9fa;
    border: 1px solid #dee6f0;
    border-radius: 0.5rem;
    padding: 1rem;
}

.lang-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 0.5rem;
}

.lang-name {
    font-weight: bold;
    color: #051E37;
    font-size: 1.05rem;
}

.lang-level {
    background: #ce9b1b;
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: bold;
}

.lang-desc {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.4;
}

.cv-sidebar {
    position: sticky;
    top: 6rem;
    background: #fff;
    padding: 1rem;
    border-radius: 0.8rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #dee6f0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: center;
}

.cv-preview-box {
    width: 100%;
    border: 1px solid #eee;
    border-radius: 0.5rem;
    overflow: hidden;
    background: #f8f9fa;
    text-align: center;
}

.cv-preview-img {
    width: 100%;
    display: block;
    object-fit: cover;
    transition: 0.3s;
}

.cv-preview-img:hover {
    filter: brightness(0.9);
}

.download-btn {
    width: 100%;
    background: #50a14f;
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 0.5rem;
    font-weight: bold;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: 0.2s;
}

.download-btn:hover {
    background: #3e813d;
    transform: translateY(-2px);
}

/* =========================================
   8. Media Queries
   ========================================= */
@media (max-width: 1280px) {
    .skills-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 1024px) {
    .tech-item i, .tech-item img {
        font-size: 2rem;
        height: 2rem;
    }
    .projects-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 992px) {
    html {
        font-size: 19px;
    }
    .cv-wrapper {
        grid-template-columns: 1fr;
    }
    .cv-sidebar {
        position: static;
        order: -1;
    }
    .contact-grid {
        grid-template-columns: 1fr 1fr;
    }
    .contact-empty {
        display: none;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }
    .header-title {
        display: none;
    }
    .header-top, .mini-header {
        grid-template-columns: 1fr 1fr;
    }
    .index-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }
    .index-btn:nth-child(2) {
        order: 1;
        grid-column: span 2;
    }
    .index-btn:nth-child(3) {
        order: 2;
    }
    .index-btn:nth-child(1) {
        order: 3;
    }
    .index-grid {
        grid-template-columns: 1fr;
    }
    .index-name {
        font-size: 1.5rem;
    }
    .action-box {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    .action-btn {
        width: 100%;
    }
    .skills-header {
        padding-top: 6rem;
        padding-bottom: 8rem;
    }
    .skills-wrapper {
        margin-top: -4rem;
    }
    .clean-skill-list {
        grid-template-columns: 1fr;
    }
    .contact-grid, .lang-grid, .cv-skills-grid {
        grid-template-columns: 1fr;
    }
    .cv-header {
        padding-top: 5.5rem;
    }
    .cv-name {
        font-size: 1.4rem;
    }
}
