/* Base Styles */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --dark: #1e293b;
    --light: #f8fafc;
    --gray: #e2e8f0;
    --border-radius: 8px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #fff;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Layout */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.75rem; }

p {
    margin-bottom: 1.25rem;
    font-size: 1rem;
    line-height: 1.6;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.8rem 0;
    width: 100%;
}

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

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    z-index: 1001;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease-in-out;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* Hero Section */
.hero {
    padding: 6rem 0 4rem;
    min-height: 100vh;
    display: flex;
    align-items: center;
}

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

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

.hero-title {
    font-size: 3rem;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--secondary);
    margin-bottom: 2rem;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    min-height: 50px;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

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

.btn-secondary:hover {
    background-color: rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

.hero-image {
    position: relative;
}

.code-snippet {
    background: #1e1e1e;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.code-snippet pre {
    margin: 0;
    overflow-x: auto;
}

.code-snippet code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9rem;
    line-height: 1.5;
    color: #9cdcfe;
}

/* Footer */
footer {
    background: #f8fafc;
    padding: 2rem 0;
    text-align: center;
    color: #334155;
    border-top: 1px solid #e2e8f0;
}

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

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: white;
    color: #2563eb;
    border-radius: 50%;
    font-size: 1.25rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #e2e8f0;
}

.social-link:hover {
    background: #2563eb;
    color: white;
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(37, 99, 235, 0.3);
}

/* Ensure Font Awesome icons are visible */
.social-link i {
    display: inline-block;
    font-size: 1.25rem;
    line-height: 1;
}

/* Mobile Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger .bar {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .hero-content {
        padding-top: 2rem;
        margin: 0 auto;
    }
    
    .cta-buttons {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .code-snippet {
        margin-top: 2rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .code-snippet pre {
        font-size: 0.8rem;
        padding: 1rem;
    }
}

@media (max-width: 768px) {
    .hamburger {
        display: flex;
        z-index: 1002;
    }
    
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: 0.3s ease-in-out;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links a {
        padding: 1rem;
        font-size: 1.1rem;
    }
    
    .hero {
        padding: 5rem 0 2rem;
    }
    
    .hero-title {
        font-size: 2.2rem;
    }
    
    .hero-description {
        font-size: 1.1rem;
    }
    
    .btn {
        padding: 0.8rem 1.2rem;
        font-size: 0.95rem;
        width: 100%;
        max-width: 200px;
        margin: 0.3rem auto;
    }
}

@media (max-width: 480px) {
    h1 { 
        font-size: 2rem !important; 
        line-height: 1.2;
    }
    
    h2 { 
        font-size: 1.6rem !important;
        line-height: 1.3;
    }
    
    h3 { 
        font-size: 1.4rem !important;
        line-height: 1.4;
    }
    
    .hero {
        padding: 4rem 0 1.5rem;
    }
    
    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 1rem;
    }
    
    .hero-description {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .code-snippet {
        padding: 0.8rem;
    }
    
    .code-snippet pre {
        font-size: 0.7rem;
    }
    
    .nav-links {
        width: 80%;
    }
}

/* Prevent horizontal scrolling */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
}

/* Improve touch targets */
button, .btn, a {
    -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    min-height: 44px;
    min-width: 44px;
}

/* Fix for iOS viewport height */
@supports (-webkit-touch-callout: none) {
    .hero {
        min-height: -webkit-fill-available;
    }
}

/* About Section */
.about-section {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.about-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
    align-items: flex-start;
    margin-top: 50px;
}

.about-image {
    text-align: center;
    position: relative;
    margin-top: 2rem;
}

.about-text {
    padding: 20px 0;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .about-content {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .about-image {
        margin: 0 auto;
        max-width: 400px;
    }
    
    .about-text {
        text-align: center;
    }
    
    .personal-info-container {
        align-items: center;
    }
}

@media (max-width: 768px) {
    .about-section {
        padding: 60px 0;
    }
    
    .about-content {
        margin-top: 30px;
    }
    
    .image-container {
        width: 250px;
        height: 250px;
    }
    
    .personal-info {
        text-align: left;
        width: 100%;
    }
    
    .info-item {
        justify-content: center;
    }
}

.image-container {
    width: 300px;
    height: 300px;
    margin: 0 auto;
    border-radius: 50%;
    padding: 8px;
    background: linear-gradient(45deg, var(--primary), var(--primary-dark));
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.about-image:hover .image-container {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.profile-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid white;
    opacity: 0;
    transition: opacity 0.8s ease-in-out, transform 0.8s ease-in-out;
    transform: scale(0.9);
}

.profile-image.active {
    opacity: 1;
    transform: scale(1);
}

.about-image:hover .profile-image.active {
    transform: scale(1.03);
}

/* Personal Info Section */
.personal-info-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
}

.personal-info {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.info-label {
    font-weight: 600;
    color: var(--dark);
    min-width: 80px;
}

.info-value {
    color: var(--secondary);
}

.download-cv {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--primary);
    color: white;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    margin-top: 1rem;
    width: fit-content;
}

.download-cv:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Education Section */
.education-section {
    margin-top: 6rem;
    padding-top: 4rem;
    border-top: 1px solid #eee;
}

/* Certificates */
.certificates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.certificate-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.certificate-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.skill-category {
    background: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    height: 100%;
}

.skill-category:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

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

@media (max-width: 768px) {
    .skills-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .skill-category {
        padding: 1.5rem;
    }
    
    .skill-category h3 {
        font-size: 1.3rem;
    }
    
    .skill-item {
        margin-bottom: 1rem;
    }
}

.certificate-image {
    position: relative;
    overflow: hidden;
    height: 200px;
}

.certificate-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.certificate-card:hover .certificate-image img {
    transform: scale(1.05);
}

.certificate-details {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.certificate-details h3 {
    margin: 0 0 0.5rem;
    color: var(--dark);
    font-size: 1.25rem;
    transition: color 0.3s ease;
}

.certificate-card:hover .certificate-details h3 {
    color: var(--primary);
}

.certificate-details p {
    color: var(--secondary);
    margin: 0 0 0.5rem;
    font-size: 0.95rem;
}

.certificate-details .date {
    color: var(--secondary);
    font-size: 0.85rem;
    margin-bottom: 1rem;
    display: block;
}

.certificate-details .btn {
    margin-top: auto;
    align-self: flex-start;
}

/* Responsive styles for certificates */
@media (max-width: 768px) {
    .certificates-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .certificate-image {
        height: 180px;
    }
}

@media (max-width: 480px) {
    .certificates-grid {
        grid-template-columns: 1fr;
    }
}

.certificate-details .date {
    display: block;
    font-size: 0.85rem;
    color: var(--gray-dark);
    margin-bottom: 1.25rem;
}

.certificate-details .btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    z-index: 1;
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: var(--primary);
    color: white;
    border-radius: 5px;
    text-decoration: none;
    font-weight: 500;
    border: none;
    cursor: pointer;
}

.certificate-details .btn::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--primary-dark);
    z-index: -1;
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.3s ease;
}

.certificate-card:hover .btn::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 3.5rem; }
h2 { font-size: 2.5rem; }
h3 { font-size: 2rem; }
h4 { font-size: 1.5rem; }

p {
    margin-bottom: 1.5rem;
    color: var(--secondary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

/* Personal Info Section */
.personal-info-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 1.5rem 0;
    align-items: flex-start;
}

.personal-info {
    flex: 1;
    min-width: 250px;
}

.info-item {
    display: flex;
    margin-bottom: 0.75rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray);
}

.info-label {
    font-weight: 600;
    min-width: 100px;
    color: var(--secondary);
}

.info-value {
    color: var(--dark);
}

.download-cv {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    margin-top: 1rem;
    text-decoration: none;
    transition: var(--transition);
    align-self: flex-start;
    white-space: nowrap;
}

.download-cv i {
    font-size: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: var(--border-radius);
    font-weight: 600;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-size: 1rem;
}

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

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.btn-secondary:hover {
    background-color: rgba(37, 99, 235, 0.1);
    transform: translateY(-2px);
}

/* Navigation */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 0.8rem 0;
    width: 100%;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 1rem;
}

.logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--dark);
    text-decoration: none;
    z-index: 1001;
}

.nav-links {
    display: flex;
    gap: 1.5rem;
    transition: all 0.3s ease-in-out;
}

.nav-links a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary);
    background: rgba(37, 99, 235, 0.1);
}

/* Mobile Menu Button */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger span {
    display: block;
    height: 3px;
    width: 100%;
    background: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        max-width: 300px;
        height: 100vh;
        background: white;
        flex-direction: column;
        padding: 5rem 2rem 2rem;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.3s ease-in-out;
    }

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

    .nav-links a {
        padding: 0.8rem 1rem;
        border-radius: 6px;
        margin: 0.25rem 0;
    }

    /* Animate hamburger to X */
    .hamburger.active span:nth-child(1) {
        transform: translateY(9px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-9px) rotate(-45deg);
    }
}

/* Adjust container padding for mobile */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Adjust main content to account for fixed navbar */
main {
    padding-top: 70px; /* Height of navbar + some spacing */
}

/* Ensure content doesn't get hidden behind fixed navbar */
.hero {
    padding: 2rem 0;
}

/* Make buttons more touch-friendly on mobile */
.btn {
    min-height: 44px;
    min-width: 120px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    line-height: 1.5;
}

/* Improve touch targets for mobile */
a, button, .btn, .nav-links a {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
}

/* Prevent horizontal scrolling */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Improve button feedback on touch devices */
button, .btn, a {
    transition: transform 0.1s ease, box-shadow 0.1s ease;
}

button:active, .btn:active, a:active {
    transform: scale(0.98);
}

/* Improve form elements for mobile */
input, textarea, select, button {
    font-size: 16px; /* Prevents iOS zoom on focus */
    -webkit-appearance: none;
    border-radius: var(--border-radius);
}

/* Ensure images are responsive */
img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 6rem 0 4rem;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
}

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

.hero-content h1 {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
}

.highlight {
    color: var(--primary);
    position: relative;
    display: inline-block;
}

.highlight::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 10px;
    background-color: rgba(37, 99, 235, 0.2);
    z-index: -1;
    border-radius: 4px;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.hero-image {
    position: relative;
}

.code-snippet {
    background-color: #1e293b;
    border-radius: var(--border-radius);
    padding: 2rem;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.code-snippet pre {
    margin: 0;
    overflow-x: auto;
}

.code-snippet code {
    color: #f8fafc;
    font-family: 'Fira Code', monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* Footer */
footer {
    background-color: var(--dark);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: #000000;
    font-size: 1.5rem;
    transition: var(--transition);
}

.social-links a:hover {
    color: var(--primary);
    transform: translateY(-3px);
}

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

.animate-fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

/* Responsive Design */
@media (max-width: 1024px) {
    h1 { font-size: 3rem; }
    h2 { font-size: 2.25rem; }
    h3 { font-size: 1.75rem; }
}

@media (max-width: 768px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .cta-buttons {
        justify-content: center;
    }

    .nav-links {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background-color: white;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        transition: var(--transition);
        gap: 2rem;
    }

    .nav-links.active {
        left: 0;
    }

    .hamburger {
        display: block;
    }

    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }
}

@media (max-width: 480px) {
    h1 { font-size: 2.5rem; }
    h2 { font-size: 2rem; }
    h3 { font-size: 1.5rem; }
    
    .cta-buttons {
        flex-direction: column;
    }
    
    .btn-secondary {
        margin-left: 0;
        margin-top: 1rem;
    }
}

.typewriter {
    border-right: 2px solid white;
}
