/* Base Styles */
:root {
--primary-color: #4f46e5;
--secondary-color: #818cf8;
--dark-color: #1e293b;
--light-color: #f8fafc;
--text-color: #334155;
--bg-color: #ffffff;
--card-bg: #ffffff;
--shadow-color: rgba(0, 0, 0, 0.1);
--transition: all 0.3s ease;
}

/* Dark Mode Variables */
[data-theme="dark"] {
--primary-color: #818cf8;
--secondary-color: #a5b4fc;
--dark-color: #f8fafc;
--light-color: #1e293b;
--text-color: #cbd5e1;
--bg-color: #0f172a;
--card-bg: #1e293b;
--shadow-color: rgba(0, 0, 0, 0.3);
}

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

html {
scroll-behavior: smooth;
}

body {
font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
line-height: 1.6;
color: var(--text-color);
background-color: var(--bg-color);
transition: background-color 0.3s ease, color 0.3s ease;
}

a {
text-decoration: none;
color: inherit;
}

ul {
list-style: none;
}

img {
max-width: 100%;
}

.container {
width: 90%;
max-width: 1200px;
margin: 0 auto;
padding: 0 20px;
}

.btn {
display: inline-block;
background: var(--primary-color);
color: white;
padding: 12px 24px;
border-radius: 50px;
transition: var(--transition);
border: none;
cursor: pointer;
font-weight: 600;
}

.btn:hover {
background: var(--secondary-color);
transform: translateY(-3px);
box-shadow: 0 10px 20px var(--shadow-color);
}

section {
padding: 80px 0;
}

.section-title {
text-align: center;
margin-bottom: 60px;
font-size: 2.5rem;
color: var(--dark-color);
position: relative;
}

.section-title::after {
content: "";
position: absolute;
bottom: -15px;
left: 50%;
transform: translateX(-50%);
width: 80px;
height: 4px;
background: var(--primary-color);
border-radius: 2px;
}

/* Header */
header {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: 1000;
background-color: var(--bg-color);
box-shadow: 0 2px 10px var(--shadow-color);
padding: 15px 0;
transition: var(--transition);
}

header.scrolled {
padding: 10px 0;
}

.header-container {
display: flex;
justify-content: space-between;
align-items: center;
}

.logo {
font-size: 1.8rem;
font-weight: 700;
color: var(--primary-color);
}

.nav-menu {
display: flex;
align-items: center;
}

.nav-list {
display: flex;
margin-right: 30px;
}

.nav-item {
margin: 0 15px;
}

.nav-link {
font-weight: 600;
position: relative;
padding: 5px 0;
transition: var(--transition);
}

.nav-link::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 0;
height: 2px;
background: var(--primary-color);
transition: var(--transition);
}

.nav-link:hover {
color: var(--primary-color);
}

.nav-link:hover::after {
width: 100%;
}

.header-actions {
display: flex;
align-items: center;
gap: 20px;
}

.theme-toggle {
background: none;
border: none;
font-size: 1.3rem;
cursor: pointer;
color: var(--text-color);
transition: var(--transition);
padding: 8px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}

.theme-toggle:hover {
background: var(--light-color);
color: var(--primary-color);
}

.profile-pic {
width: 45px;
height: 45px;
border-radius: 50%;
overflow: hidden;
border: 2px solid var(--primary-color);
cursor: pointer;
transition: var(--transition);
}

.profile-pic:hover {
transform: scale(1.1);
}

.mobile-toggle {
display: none;
font-size: 1.5rem;
cursor: pointer;
color: var(--dark-color);
}

/* Hero Section */
.hero {
min-height: 100vh;
display: flex;
align-items: center;
background: var(--bg-color);
position: relative;
overflow: hidden;
padding-top: 80px;
}

[data-theme="dark"] .hero {
background: var(--bg-color);
}

.hero::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%234f46e5" fill-opacity="0.05" d="M0,192L48,197.3C96,203,192,213,288,229.3C384,245,480,267,576,250.7C672,235,768,181,864,181.3C960,181,1056,235,1152,234.7C1248,235,1344,181,1392,154.7L1440,128L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
background-size: cover;
background-position: bottom;
z-index: 0;
opacity: 0.3;
}

.hero-container {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 60px;
align-items: center;
position: relative;
z-index: 1;
}

.hero-content {
max-width: 600px;
}

.hero-title {
font-size: 3.5rem;
margin-bottom: 20px;
color: var(--dark-color);
line-height: 1.2;
animation: fadeInUp 1s ease;
}

.hero-subtitle {
font-size: 1.2rem;
margin-bottom: 30px;
color: var(--text-color);
animation: fadeInUp 1s ease 0.2s;
animation-fill-mode: both;
}

.hero-btns {
display: flex;
gap: 15px;
animation: fadeInUp 1s ease 0.4s;
animation-fill-mode: both;
}

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

.btn-secondary:hover {
background: var(--primary-color);
color: white;
}

.hero-image {
display: flex;
justify-content: center;
align-items: center;
animation: fadeInRight 1s ease 0.6s;
animation-fill-mode: both;
}

.hero-image-wrapper {
position: relative;
width: 400px;
height: 400px;
}

.hero-image-bg {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
background: var(--primary-color);
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
opacity: 0.1;
animation: morphing 8s ease-in-out infinite;
}

.hero-image img {
position: relative;
width: 100%;
height: 100%;
object-fit: cover;
border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
border: 5px solid var(--primary-color);
animation: morphing 8s ease-in-out infinite;
animation-delay: 0.5s;
}

@keyframes morphing {
0% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}
50% {
    border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%;
}
100% {
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
}
}

/* About Section */
.about {
background-color: var(--card-bg);
}

.about-content {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 50px;
align-items: center;
}

.about-img {
border-radius: 10px;
overflow: hidden;
box-shadow: 0 20px 30px var(--shadow-color);
transform: rotate(-3deg);
transition: var(--transition);
margin-left: 50px;
}

.about-img:hover {
transform: rotate(0);
}

.about-text h3 {
font-size: 2rem;
margin-bottom: 20px;
color: var(--dark-color);
}

.about-text p {
margin-bottom: 20px;
}

.skills {
display: flex;
flex-wrap: wrap;
gap: 10px;
margin-top: 30px;
}

.skill-tag {
background: var(--light-color);
padding: 8px 16px;
border-radius: 50px;
font-size: 0.9rem;
font-weight: 600;
color: var(--primary-color);
transition: var(--transition);
border: 1px solid transparent;
}

[data-theme="dark"] .skill-tag {
border-color: var(--primary-color);
}

.skill-tag:hover {
background: var(--primary-color);
color: white;
transform: translateY(-3px);
}

/* Portfolio Section */
.portfolio {
background-color: var(--bg-color);
}

.portfolio-filter {
display: flex;
justify-content: center;
flex-wrap: wrap;
gap: 15px;
margin-bottom: 40px;
}

.filter-btn {
background: var(--card-bg);
padding: 8px 20px;
border-radius: 50px;
font-weight: 600;
color: var(--text-color);
border: none;
cursor: pointer;
transition: var(--transition);
box-shadow: 0 2px 10px var(--shadow-color);
}

.filter-btn.active,
.filter-btn:hover {
background: var(--primary-color);
color: white;
}

/* Horizontal Scroll Portfolio Grid */
.portfolio-scroll-container,
.certificates-scroll-container {
position: relative;
overflow: hidden;
}

.portfolio-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 30px;
}

.certificates-grid {
display: flex;
gap: 30px;
overflow-x: auto;
scroll-behavior: smooth;
padding: 20px 0;
scrollbar-width: thin;
scrollbar-color: var(--primary-color) var(--light-color);
/* Show 3 items initially */
max-width: calc(3 * 350px + 2 * 30px); /* 3 items + 2 gaps */
}

.portfolio-item {
background: var(--card-bg);
border-radius: 10px;
overflow: hidden;
box-shadow: 0 10px 20px var(--shadow-color);
transition: var(--transition);
width: 350px;
flex-shrink: 0;
}

.portfolio-item:hover {
transform: translateY(-10px);
box-shadow: 0 20px 30px var(--shadow-color);
}

.portfolio-img {
height: 200px;
overflow: hidden;
}

.portfolio-img img {
width: 100%;
height: 100%;
object-fit: cover;
transition: var(--transition);
}

.portfolio-item:hover .portfolio-img img {
transform: scale(1.1);
}

.portfolio-content {
padding: 20px;
}

.portfolio-title {
font-size: 1.2rem;
margin-bottom: 10px;
color: var(--dark-color);
}

.portfolio-category {
font-size: 0.9rem;
color: var(--primary-color);
margin-bottom: 15px;
}

.portfolio-desc {
margin-bottom: 20px;
font-size: 0.95rem;
}

.portfolio-link {
display: inline-block;
color: var(--primary-color);
font-weight: 600;
transition: var(--transition);
}

.portfolio-link:hover {
color: var(--secondary-color);
transform: translateX(5px);
}

/* Certificates Section */
.certificates {
background-color: var(--card-bg);
}

/* Horizontal Scroll Certificates Grid */
.certificates-scroll-container {
position: relative;
overflow: hidden;
}

.certificates-grid {
display: flex;
gap: 30px;
overflow-x: auto;
scroll-behavior: smooth;
padding: 20px 0;
scrollbar-width: thin;
scrollbar-color: var(--primary-color) var(--light-color);
/* Show 3 items initially */
max-width: calc(3 * 350px + 2 * 30px); /* 3 items + 2 gaps */
}

.certificates-grid::-webkit-scrollbar {
height: 8px;
}

.certificates-grid::-webkit-scrollbar-track {
background: var(--light-color);
border-radius: 10px;
}

.certificates-grid::-webkit-scrollbar-thumb {
background: var(--primary-color);
border-radius: 10px;
transition: var(--transition);
}

.certificates-grid::-webkit-scrollbar-thumb:hover {
background: var(--secondary-color);
}

.certificate-item {
background: var(--bg-color);
border-radius: 10px;
overflow: hidden;
box-shadow: 0 10px 20px var(--shadow-color);
transition: var(--transition);
position: relative;
width: 320px;
flex-shrink: 0;
}

[data-theme="dark"] .certificate-item {
background: var(--card-bg);
}

.certificate-item:hover {
transform: translateY(-5px);
box-shadow: 0 15px 25px var(--shadow-color);
}

.certificate-img {
min-height: 250px;
max-height: 350px;
overflow: hidden;
display: flex;
align-items: center;
justify-content: center;
background: var(--light-color);
padding: 10px;
}

[data-theme="dark"] .certificate-img {
background: var(--card-bg);
}

.certificate-img img {
width: 350px;
height: 350px;
max-height: 100%;
object-fit: contain;
transition: var(--transition);
border-radius: 5px;
}

.certificate-item:hover .certificate-img img {
transform: scale(1.02);
}

.certificate-content {
padding: 20px;
}

.certificate-title {
font-size: 1.2rem;
margin-bottom: 10px;
color: var(--dark-color);
}

.certificate-issuer {
font-size: 0.9rem;
color: var(--primary-color);
margin-bottom: 10px;
}

.certificate-date {
font-size: 0.85rem;
color: var(--text-color);
margin-bottom: 15px;
}

.certificate-link {
display: inline-block;
color: var(--primary-color);
font-weight: 600;
transition: var(--transition);
}

.certificate-link:hover {
color: var(--secondary-color);
transform: translateX(5px);
}

/* Contact Modal - Always Dark Mode */
.modal {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.7);
display: flex;
justify-content: center;
align-items: center;
z-index: 2000;
opacity: 0;
visibility: hidden;
transition: var(--transition);
}

.modal.active {
opacity: 1;
visibility: visible;
}

.modal-content {
background: #1e293b; /* Always dark background */
color: #cbd5e1; /* Always light text */
width: 90%;
max-width: 500px;
border-radius: 10px;
padding: 30px;
position: relative;
transform: translateY(-50px);
transition: var(--transition);
}

.modal.active .modal-content {
transform: translateY(0);
}

.modal-close {
position: absolute;
top: 15px;
right: 15px;
font-size: 1.5rem;
cursor: pointer;
color: #cbd5e1; /* Always light color */
transition: var(--transition);
}

.modal-close:hover {
color: #818cf8; /* Always primary color */
transform: rotate(90deg);
}

.modal-title {
font-size: 1.8rem;
margin-bottom: 20px;
color: #f8fafc; /* Always light color */
text-align: center;
}

.contact-info {
margin-bottom: 30px;
}

.contact-item {
display: flex;
align-items: center;
margin-bottom: 15px;
}

.contact-icon {
width: 40px;
height: 40px;
background: rgba(129, 140, 248, 0.1); /* Always primary with opacity */
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
margin-right: 15px;
color: #818cf8; /* Always primary color */
font-size: 1.2rem;
}

.contact-text {
font-size: 1rem;
color: #f8fafc; /* Always light color */
}

.contact-text span {
display: block;
font-size: 0.9rem;
color: #cbd5e1; /* Always muted light color */
opacity: 0.8;
}

.contact-form .form-group {
margin-bottom: 20px;
}

.contact-form label {
display: block;
margin-bottom: 5px;
font-weight: 600;
color: #f8fafc; /* Always light color */
}

.contact-form input,
.contact-form textarea {
width: 100%;
padding: 12px 15px;
border: 1px solid #334155; /* Always dark border */
background: #0f172a; /* Always dark background */
color: #cbd5e1; /* Always light text */
border-radius: 5px;
font-size: 1rem;
transition: var(--transition);
}

.contact-form input:focus,
.contact-form textarea:focus {
border-color: #818cf8; /* Always primary color */
outline: none;
box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

.contact-form textarea {
height: 120px;
resize: none;
}

/* Social links in modal - always dark mode styling */
.modal .social-links {
display: flex;
gap: 15px;
justify-content: center;
margin-top: 20px;
}

.modal .social-link {
width: 40px;
height: 40px;
background: rgba(248, 250, 252, 0.1); /* Always light with opacity */
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
color: #f8fafc; /* Always light color */
font-size: 1.2rem;
transition: var(--transition);
}

.modal .social-link:hover {
background: #818cf8; /* Always primary color */
transform: translateY(-5px);
}

/* Footer */
footer {
background: var(--dark-color);
color: white;
padding: 50px 0 20px;
}

[data-theme="dark"] footer {
background: #0a0f1c;
}

.footer-content {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
gap: 30px;
margin-bottom: 40px;
}

.footer-logo {
font-size: 2rem;
font-weight: 700;
margin-bottom: 15px;
color: white;
}

.footer-desc {
margin-bottom: 20px;
opacity: 0.8;
}

.social-links {
display: flex;
gap: 15px;
}

.social-link {
width: 40px;
height: 40px;
background: rgba(255, 255, 255, 0.1);
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
color: white;
font-size: 1.2rem;
transition: var(--transition);
}

.social-link:hover {
background: var(--primary-color);
transform: translateY(-5px);
}

.footer-title {
font-size: 1.2rem;
margin-bottom: 20px;
position: relative;
padding-bottom: 10px;
}

.footer-title::after {
content: "";
position: absolute;
bottom: 0;
left: 0;
width: 50px;
height: 2px;
background: var(--primary-color);
}

.footer-links li {
margin-bottom: 10px;
}

.footer-links a {
opacity: 0.8;
transition: var(--transition);
}

.footer-links a:hover {
opacity: 1;
color: var(--primary-color);
padding-left: 5px;
}

.footer-bottom {
text-align: center;
padding-top: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
font-size: 0.9rem;
opacity: 0.7;
}

/* Animations */
@keyframes fadeInUp {
from {
    opacity: 0;
    transform: translateY(30px);
}
to {
    opacity: 1;
    transform: translateY(0);
}
}

@keyframes fadeInRight {
from {
    opacity: 0;
    transform: translateX(30px);
}
to {
    opacity: 1;
    transform: translateX(0);
}
}

/* Responsive Styles */
@media (max-width: 992px) {
.section-title {
    font-size: 2rem;
}

.hero-container {
    grid-template-columns: 1fr;
    gap: 40px;
}

.hero-title {
    font-size: 2.8rem;
}

.hero-image {
    order: -1;
}

.hero-image-wrapper {
    width: 300px;
    height: 300px;
}

.about-content {
    grid-template-columns: 1fr;
    gap: 30px;
}

.about-img {
    max-width: 500px;
    margin: 0 auto;
}

.portfolio-grid,
.certificates-grid {
    max-width: calc(2 * 300px + 1 * 30px); /* Show 2 items on tablet */
}

.portfolio-item {
    width: 300px;
}

.certificate-item {
    width: 280px;
}
}

@media (max-width: 768px) {
.mobile-toggle {
    display: block;
}

.nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: var(--card-bg);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 30px 30px;
    transition: var(--transition);
    box-shadow: -5px 0 15px var(--shadow-color);
}

.nav-menu.active {
    right: 0;
}

.nav-list {
    flex-direction: column;
    width: 100%;
    margin-right: 0;
    margin-bottom: 30px;
}

.nav-item {
    margin: 10px 0;
    width: 100%;
}

.nav-link {
    display: block;
    padding: 10px 0;
}

.header-actions {
    flex-direction: column;
    gap: 15px;
    width: 100%;
}

.theme-toggle {
    align-self: flex-start;
}

.profile-pic {
    margin-top: 20px;
}

.hero {
    min-height: auto;
    padding: 100px 0 60px;
}

.hero-title {
    font-size: 2.5rem;
}

.hero-btns {
    flex-direction: column;
    gap: 10px;
}

.hero-btns .btn {
    width: 100%;
    text-align: center;
}

.portfolio-filter {
    gap: 10px;
}

.filter-btn {
    padding: 6px 15px;
    font-size: 0.9rem;
}

.portfolio-grid,
.certificates-grid {
    max-width: calc(1 * 280px); /* Show 1 item on mobile */
}

.portfolio-item {
    width: 280px;
}

.certificate-item {
    width: 250px;
}
}

@media (max-width: 576px) {
section {
    padding: 60px 0;
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: 40px;
}

.hero-title {
    font-size: 2rem;
}

.hero-subtitle {
    font-size: 1rem;
}

.hero-image-wrapper {
    width: 250px;
    height: 250px;
}

.certificate-img {
    min-height: 200px;
    max-height: 300px;
}

.portfolio-grid,
.certificates-grid {
    max-width: calc(1 * 260px); /* Show 1 item on small mobile */
}

.portfolio-item {
    width: 260px;
}

.certificate-item {
    width: 220px;
}
}