@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');
@import url("fontawesome-all.min.css");

:root {
    --primary: #007bff;
    --primary-dark: #0056b3;
    --background: #ffffff;
    --background-alt: #f8f9fa;
    --card-bg: #ffffff;
    --text: #333333;
    --text-light: #666666;
    --border: #e9ecef;
    --shadow: rgba(0, 0, 0, 0.08);
    --nav-bg: rgba(255, 255, 255, 0.95);
}

[data-theme="dark"] {
    --background: #1a1a1a;
    --background-alt: #2d2d2d;
    --card-bg: #2d2d2d;
    --text: #ffffff;
    --text-light: #e0e0e0;  /* Brighter gray for better contrast */
    --border: #404040;
    --shadow: rgba(0, 0, 0, 0.2);
    --nav-bg: rgba(26, 26, 26, 0.95);  /* Darker, less transparent nav */
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.15s ease, 
                color 0.15s ease, 
                border-color 0.15s ease, 
                box-shadow 0.15s ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    line-height: 1.6;
    background-color: var(--background);
    color: var(--text);
    transition: background-color 0.15s ease, color 0.15s ease;
}

img {
    max-width: 100%;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading);
    line-height: 1.3;
    margin-bottom: 1rem;
    font-weight: 700;
}

h1 {
    font-size: 2.5rem;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
}

p {
    margin-bottom: 1.2rem;
}

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

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

ul {
    list-style-position: inside;
    margin-bottom: 1.2rem;
}

/* Layout & Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 5rem 0;
}

section:nth-child(even) {
    background-color: var(--background-alt);
}

.content-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2rem;
    align-items: start;
}

.about-text {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Navigation */
#nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--nav-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 1rem 0;
}

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

.brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--heading);
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
}

.nav-links li {
    margin-left: 2rem;
}

.nav-links a {
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary);
    transition: width 0.3s;
}

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

/* Hero Section */
#home {
    padding: 8rem 0 4rem;  /* More balanced padding */
    display: flex;
    align-items: center;
    min-height: 45vh;
    background-color: var(--background-alt);
}

#home .container {
    text-align: center;
    max-width: 800px;  /* Control content width */
    margin: 0 auto;
}

#home h1 {
    margin-bottom: 1rem;
    font-size: 3rem;
}

#home .subtitle {
    font-size: 1.2rem;
    max-width: 600px;
    margin: 0 auto 2rem;
    line-height: 1.5;
    color: var(--text-light);
    font-weight: 400;
}

[data-theme="dark"] #home .subtitle {
    opacity: 0.95;  /* Increase opacity for better visibility */
}

.btn-primary {
    background-color: var(--primary);
    color: white;
    padding: 0.8rem 1.8rem;
    margin-top: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.3s;
}

/* About Section */
#about .emphasis {
    padding: 1.2rem;
    background-color: rgba(0, 122, 204, 0.05);
    border-left: 4px solid var(--primary);
    margin-top: 2rem;
    font-weight: 500;
}

/* Projects Section */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--shadow);
}

.project-card h3 {
    color: var(--text);
    margin-bottom: 1rem;
}

.project-card p {
    color: var(--text-light);
}

.tech-tags {
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 1rem 0;
}

.project-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

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

/* Writing Section */
.writing-links {
    margin: 1.5rem 0;
    list-style: none;
    padding: 0;
}

.writing-links li {
    margin-bottom: 1rem;
}

.writing-links a {
    color: #007bff;  /* Original blue color */
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.writing-links a:hover {
    color: #0056b3;  /* Darker shade for hover */
    text-decoration: underline;
}

/* Links Section */
.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
    margin-top: 2rem;
}

.social-btn {
    display: inline-block;
    padding: 0.7rem 1.5rem;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    font-weight: 500;
    transition: background-color 0.3s;
}

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

/* Footer */
footer {
    padding: 2rem 0;
    text-align: center;
    color: #666;
}

.version-info {
    font-size: 0.9em;
    margin-top: 0.8rem;
    color: #888;
}

.version-info a {
    color: #666;
    text-decoration: none;
    padding: 0 2px;
    transition: color 0.2s ease;
}

.version-info a:hover {
    color: var(--primary);
}

.version-info .current {
    color: #444;
    font-weight: 500;
}

.version-switcher {
    margin-top: 1.5rem;
    font-size: 0.9rem;
}

.version-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 0.5rem;
}

.version-link {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--primary);
    color: white;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.version-link:hover {
    background-color: var(--primary-dark);
}

.current-version {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: #555;
    color: white;
    border-radius: 4px;
    cursor: default;
}

/* Profile Image */
.profile-image {
    width: 100%;
}

.image.fit {
    display: block;
    width: 100%;
}

.initials {
    font-family: 'Inter', sans-serif;
    font-weight: 700;
    font-size: 1.5rem;
    background: linear-gradient(135deg, #007bff, #00d2ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding: 0.2rem;
}

/* Theme Toggle */
.theme-toggle {
    background: none;
    border: none;
    padding: 0.4rem;  /* Reduced padding */
    cursor: pointer;
    color: var(--text);
    transition: all 0.3s ease;
    border-radius: 50%;
}

.theme-toggle:hover {
    background-color: var(--background-alt);
    transform: scale(1.1);
}

.theme-toggle i {
    font-size: 1rem;  /* Reduced font size */
}

[data-theme="dark"] .theme-toggle i {
    color: #ffd700;  /* Golden color for sun icon */
}

/* Responsive Design */
@media (max-width: 768px) {
    h1 {
        font-size: 2.2rem;
    }
    
    h2 {
        font-size: 1.8rem;
    }
    
    #home {
        height: auto;
        padding: 8rem 0 5rem;
    }
    
    .projects-grid {
        grid-template-columns: 1fr;
    }
    
    .social-links {
        flex-direction: column;
        align-items: center;
    }
    
    .social-btn {
        width: 100%;
        max-width: 300px;
        text-align: center;
    }
    
    .content-wrapper {
        grid-template-columns: 1fr;
    }
    
    .profile-image {
        max-width: 300px;
        margin: 0 auto 2rem;
    }
}

@media (max-width: 480px) {
    .brand {
        display: none;
    }
    
    .nav-container {
        justify-content: center;
        padding: 0 1rem;  /* Add padding for mobile */
    }
    
    .nav-links {
        display: flex;
        justify-content: center;  /* Center links */
        width: 100%;
        gap: 1rem;  /* Use gap instead of margins */
    }
    
    .nav-links li {
        margin: 0;  /* Remove margins */
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
    
    section {
        padding: 3rem 0;
    }
    
    .theme-toggle {
        padding: 0.3rem;  /* Even smaller on mobile */
    }
    
    .theme-toggle i {
        font-size: 0.9rem;  /* Smaller icon on mobile */
    }
}