/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

:root {
    /* Light Theme Variables */
    --bg-primary: #f8f9fa;
    --bg-secondary: #ffffff;
    --text-primary: #333333;
    --text-secondary: #555555;
    --accent-color: #3498db;
    --hover-color: #2980b9;
    --card-bg: #ffffff;
    --header-bg: #2c3e50;
    --hero-bg: #3498db;
    --footer-bg: #1a252f;
    --border-color: #e2e8f0;
    --shadow-color: rgba(0, 0, 0, 0.1);
    --category-bg: #3498db;
    
    /* Transition Speed */
    --transition-speed: 0.3s;
}

.dark-theme {
    /* Dark Theme Variables */
    --bg-primary: #121212;
    --bg-secondary: #1e1e1e;
    --text-primary: #f8f9fa;
    --text-secondary: #cccccc;
    --accent-color: #3498db;
    --hover-color: #2980b9;
    --card-bg: #252525;
    --header-bg: #1a1a1a;
    --hero-bg: #2c3e50;
    --footer-bg: #0f0f0f;
    --border-color: #2d2d2d;
    --shadow-color: rgba(0, 0, 0, 0.3);
    --category-bg: #2980b9;
}

body {
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-primary);
    transition: background-color var(--transition-speed) ease, 
                color var(--transition-speed) ease;
}

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

/* Theme Toggle */
.theme-toggle {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 1001;
}

#theme-toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    color: white;
    background-color: var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px var(--shadow-color);
    transition: transform 0.3s ease, color 0.3s ease;
}

#theme-toggle-btn:hover {
    transform: rotate(15deg);
}

#theme-toggle-btn .fa-sun {
    display: none;
}

.dark-theme #theme-toggle-btn .fa-moon {
    display: none;
}

.dark-theme #theme-toggle-btn .fa-sun {
    display: inline-block;
}

header {
    background-color: var(--header-bg);
    color: white;
    padding: 1.5rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px var(--shadow-color);
    transition: background-color var(--transition-speed) ease;
}

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

.name {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    transition: color var(--transition-speed) ease;
}

.name:visited, .name:active {
    color: white;
    text-decoration: none;
}

nav a {
    color: white;
    text-decoration: none;
    margin-left: 2rem;
    transition: color var(--transition-speed) ease;
    position: relative;
    padding: 0.5rem 0;
}

nav a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width var(--transition-speed) ease;
}

nav a:hover::after {
    width: 100%;
}

nav a:hover, .name:hover {
    color: var(--accent-color);
}

.hero {
    background-color: var(--hero-bg);
    color: white;
    text-align: center;
    /* Adjust top padding to account for fixed header height */
    padding-top: 10rem;
    padding-bottom: 6rem;
    margin-top: 0;
    position: relative;
    overflow: hidden;
    transition: background-color var(--transition-speed) ease;
    background-attachment: fixed;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.7), rgba(44, 62, 80, 0.7));
    opacity: 0.6;
    z-index: 1;
}

.dark-theme .hero::before {
    background: linear-gradient(45deg, rgba(52, 152, 219, 0.5), rgba(44, 62, 80, 0.5));
    opacity: 0.3;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background: linear-gradient(to top, var(--bg-primary), transparent);
    z-index: 2;
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    animation: fadeInUp 0.8s ease;
}

.hero h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    animation: fadeInUp 1.2s ease;
}

.projects {
    padding: 5rem 0;
    background-color: var(--bg-primary);
    transition: background-color var(--transition-speed) ease;
}

.section-title::after {
    content: none; /* Remove the original underline */
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-primary);
    font-size: 2.2rem;
    position: relative;
    left: 50%;
    transform: translateX(-50%);
    padding-bottom: 1rem;
    transition: color var(--transition-speed) ease;
    background: linear-gradient(90deg, transparent, var(--accent-color), transparent);
    background-size: 200% 3px;
    background-position: 0% 100%;
    background-repeat: no-repeat;
    animation: gradientMove 3s ease infinite alternate;
}

@keyframes gradientMove {
    0% {
        background-position: 0% 100%;
    }
    100% {
        background-position: 100% 100%;
    }
}

.section-title.light-text {
    color: white;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    padding: 1rem;
}

.project-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background: var(--card-bg);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 5px 15px var(--shadow-color);
    transition: transform 0.5s ease, 
                box-shadow 0.5s ease,
                background-color 0.3s ease,
                opacity 0.5s ease,
                border-left 0.3s ease;
    border: 1px solid var(--border-color);
    border-left: 3px solid transparent;
    opacity: 0;
    transform: translateY(20px);
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 20px var(--shadow-color);
    border-left: 3px solid var(--accent-color);
}

/* Project Card Active State */
.project-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
}

.dark-theme .project-card {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.4);
}

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

.project-card p {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    transition: color var(--transition-speed) ease;
}

.project-links {
    margin-top: 1rem;
    display: flex;
    gap: 1.5rem;
}

.project-links a {
    transition: color var(--transition-speed) ease;
    text-decoration: none;
    color: var(--accent-color);
}

.project-links a.live-demo {
    display: inline-flex;
    align-items: center;
    color: #16a34a; /* Green color for live demos */
    transition: color var(--transition-speed) ease;
}

.project-links a.source-code {
    display: inline-flex;
    align-items: center;
    color: #6366f1; /* Purple color for source code */
    transition: color var(--transition-speed) ease;
}

.dark-theme .project-links a {
    color: #64b5f6; /* Lighter blue shade for better visibility in dark mode */
}

.dark-theme .project-links a.source-code {
    color: #818cf8; /* Lighter purple in dark mode */
}

.dark-theme .project-links a.live-demo {
    color: #4ade80; /* Lighter green in dark mode */
}

.project-links a.live-demo:hover {
    color: #15803d !important; /* Darker green on hover */
}

.project-links a.source-code:hover {
    color: #4f46e5 !important; /* Darker purple on hover */
}

.project-links a i {
    margin-right: 5px;
}

.project-links a:hover {
    color: var(--hover-color) !important;
}

.category-label {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background-color: var(--category-bg);
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
    transition: background-color var(--transition-speed) ease, 
                transform var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.project-card:hover .category-label {
    transform: translateY(-3px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

.contact {
    background-color: var(--header-bg);
    color: white;
    padding: 5rem 0;
    text-align: center;
    transition: background-color var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
}

.contact::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(circle at 25px 25px, rgba(255, 255, 255, 0.05) 2%, transparent 0%);
    background-size: 50px 50px;
    opacity: 0.5;
    z-index: 0;
}

.contact .container {
    position: relative;
    z-index: 1;
}

.social-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 2rem;
    margin: 2rem auto 0;
    width: fit-content;
}

.social-links a {
    color: white;
    font-size: 2rem;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 60px;
    height: 60px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    overflow: hidden;
}

.social-links a::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    transform: scale(0);
    transition: transform 0.3s ease;
    z-index: -1;
}

.social-links a:hover {
    transform: translateY(-5px) scale(1.1);
}

.social-links a:hover::before {
    transform: scale(1);
}

.linkedin:hover {
    color: #0077b5;
    background-color: rgba(0, 119, 181, 0.2);
}

.github:hover {
    color: #6e5494;
    background-color: rgba(110, 84, 148, 0.2);
}

.instagram:hover {
    color: #e4405f;
    background-color: rgba(228, 64, 95, 0.2);
}

.tryhackme:hover {
    color: #c11f1f;
    background-color: rgba(193, 31, 31, 0.2);
}

footer {
    background-color: var(--footer-bg);
    color: white;
    text-align: center;
    padding: 2rem 0;
    transition: background-color var(--transition-speed) ease;
}

/* Scroll-to-top Button */
.scroll-to-top {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    background-color: var(--accent-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 2px 10px var(--shadow-color);
    z-index: 999;
    pointer-events: none;
    animation: pulse 2s infinite;
}

.scroll-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.scroll-to-top:hover {
    transform: translateY(-5px);
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(52, 152, 219, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(52, 152, 219, 0);
    }
}

/* Page Loader */
.page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

.page-loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(52, 152, 219, 0.2);
    border-radius: 50%;
    border-top-color: var(--accent-color);
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

/* Focus styles for accessibility */
.project-card:focus-within,
.social-links a:focus,
nav a:focus,
.theme-toggle button:focus,
.scroll-to-top:focus {
    outline: 2px solid var(--accent-color);
    outline-offset: 2px;
}

.dark-theme .project-card:focus-within,
.dark-theme .social-links a:focus,
.dark-theme nav a:focus,
.dark-theme .theme-toggle button:focus,
.dark-theme .scroll-to-top:focus {
    outline-color: #64b5f6;
}

/* CV Section */
.cv-section {
    padding: 5rem 0;
    background-color: var(--bg-secondary);
    transition: background-color var(--transition-speed) ease;
}

.cv-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.cv-header {
    margin-bottom: 3rem;
}

.cv-description {
    margin-bottom: 2rem;
}

.cv-description p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
    transition: color var(--transition-speed) ease;
}

.cv-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    justify-items: center;
}

.cv-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px var(--shadow-color);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    max-width: 400px;
    width: 100%;
    position: relative;
    overflow: hidden;
    opacity: 1;
    transform: translateY(0);
}

.cv-card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(52, 152, 219, 0.05) 0%, transparent 70%);
    transform: rotate(45deg);
    transition: all 0.3s ease;
    z-index: 0;
}

.cv-card:hover::before {
    transform: rotate(45deg) scale(1.2);
}

.cv-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px var(--shadow-color);
    border-color: var(--accent-color);
}

.cv-card-content {
    position: relative;
    z-index: 1;
}

.cv-icon {
    font-size: 3rem;
    color: var(--accent-color);
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.cv-card:hover .cv-icon {
    transform: scale(1.1) rotate(5deg);
    color: var(--hover-color);
}

.cv-card h3 {
    font-size: 1.5rem;
    color: var(--text-primary);
    margin-bottom: 1rem;
    transition: color var(--transition-speed) ease;
}

.cv-card p {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    line-height: 1.6;
    transition: color var(--transition-speed) ease;
}

.cv-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cv-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cv-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: left 0.3s ease;
    z-index: -1;
}

.cv-btn:hover::before {
    left: 0;
}

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

.view-btn::before {
    background-color: var(--accent-color);
}

.view-btn:hover {
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.3);
}

.download-btn {
    background-color: var(--accent-color);
    color: white;
    border: 2px solid var(--accent-color);
}

.download-btn::before {
    background-color: var(--hover-color);
}

.download-btn:hover {
    background-color: var(--hover-color);
    border-color: var(--hover-color);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(41, 128, 185, 0.3);
}

.cv-btn i {
    transition: transform 0.3s ease;
}

.cv-btn:hover i {
    transform: scale(1.1);
}

.download-btn:hover i {
    animation: downloadPulse 0.6s ease;
}

@keyframes downloadPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-toggle {
    cursor: pointer;
}

.dropdown-toggle i {
    margin-left: 5px;
    transition: transform 0.3s ease;
}

.dropdown:hover .dropdown-toggle i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: var(--card-bg);
    min-width: 180px;
    box-shadow: 0 8px 16px var(--shadow-color);
    border-radius: 8px;
    padding: 0.5rem 0;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    color: var(--text-primary) !important;
    padding: 0.75rem 1.25rem;
    text-decoration: none;
    display: block;
    margin: 0 !important;
    transition: background-color 0.3s ease, color 0.3s ease;
    font-size: 0.9rem;
    position: relative;
}

.dropdown-menu a::after {
    content: none; /* Remove the underline that's applied to nav links */
}

.dropdown-menu a:hover {
    background-color: rgba(52, 152, 219, 0.1);
    color: var(--accent-color) !important;
}

.dropdown-menu a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background-color: var(--accent-color);
    transition: width 0.3s ease;
}

.dropdown-menu a:hover::before {
    width: 4px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }

    nav {
        margin-top: 1rem;
    }

    nav a {
        margin: 0 1rem;
        font-size: 0.9rem;
    }

    .hero {
        padding-top: 9rem;
        padding-bottom: 4rem;
    }

    .hero h1 {
        font-size: 2.2rem;
    }

    .hero h2 {
        font-size: 1.4rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .social-links {
        gap: 1rem;
    }

    .social-links a {
        font-size: 1.5rem;
        width: 50px;
        height: 50px;
    }

    .theme-toggle {
        top: 1rem;
        right: 1rem;
    }

    .dropdown {
        margin: 0.5rem 0;
    }
    
    .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 0;
        visibility: hidden;
        height: 0;
        padding: 0;
        margin: 0;
        box-shadow: none;
        border: none;
        background-color: rgba(52, 152, 219, 0.1);
        border-radius: 5px;
        transition: opacity 0.3s ease, visibility 0.3s ease, height 0.3s ease, padding 0.3s ease;
    }
    
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        height: auto;
        padding: 0.5rem 0;
    }
    
    .dropdown-menu a {
        padding: 0.5rem 1rem;
        text-align: center;
    }
    
    .dropdown-menu a::before {
        display: none;
    }    /* CV Section Mobile */
    .cv-section {
        padding: 3rem 0;
    }

    .cv-cards {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .cv-card {
        padding: 2rem 1.5rem;
        margin: 0 1rem;
    }

    .cv-icon {
        font-size: 2.5rem;
    }

    .cv-actions {
        flex-direction: column;
        align-items: center;
    }

    .cv-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
        padding: 0.9rem 1.5rem;
    }

    .cv-description p {
        font-size: 1rem;
        padding: 0 1rem;
    }
}

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

    .hero h1 {
        font-size: 1.8rem;
    }

    .hero h2 {
        font-size: 1.2rem;
    }

    .hero p {
        font-size: 1rem;
    }    /* CV Section Small Mobile */
    .cv-card {
        padding: 1.5rem 1rem;
        margin: 0 0.5rem;
    }

    .cv-icon {
        font-size: 2rem;
        margin-bottom: 1rem;
    }

    .cv-card h3 {
        font-size: 1.3rem;
    }

    .cv-card p {
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
    }

    nav a {
        margin: 0 0.5rem;
        font-size: 0.8rem;
    }
}