/* ========== CSS Variables for Theme Colors ========== */
:root {
    /* Light Mode Colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-light: #60a5fa;
    --secondary-color: #6b7280;
    --secondary-hover: #4b5563;
    
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-tertiary: #f3f4f6;
    
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-tertiary: #9ca3af;
    
    --border-color: #e5e7eb;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-md: rgba(0, 0, 0, 0.15);
    
    --accent-yellow: #fbbf24;
    --accent-red: #ef4444;
    --accent-green: #10b981;
}

/* Dark Mode Colors */
[data-theme="dark"] {
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-light: #93c5fd;
    --secondary-color: #9ca3af;
    --secondary-hover: #d1d5db;
    
    --bg-primary: #111827;
    --bg-secondary: #1f2937;
    --bg-tertiary: #374151;
    
    --text-primary: #f9fafb;
    --text-secondary: #d1d5db;
    --text-tertiary: #9ca3af;
    
    --border-color: #374151;
    --shadow: rgba(0, 0, 0, 0.3);
    --shadow-md: rgba(0, 0, 0, 0.5);
    
    --accent-yellow: #f59e0b;
    --accent-red: #dc2626;
    --accent-green: #059669;
}

/* ========== Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}


/* ========== Navigation ========== */
.nav-bar {
    position: fixed;
    top: 0;
    width: 100%;
    background-color: var(--bg-primary);
    box-shadow: 0 2px 8px var(--shadow);
    z-index: 50;
    transition: background-color 0.3s ease;
}

.nav-logo {
    opacity: 0;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
}

.nav-logo.visible {
    opacity: 1;
}

.nav-logo-img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 12px;
    border: 2px solid var(--accent-yellow);
}

.nav-logo-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-logo-text {
    font-size: 18px;
    font-weight: bold;
    color: var(--text-primary);
}

.nav-link {
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
    position: relative;
}

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

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
}

.mobile-menu {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--bg-primary);
    box-shadow: 0 4px 12px var(--shadow);
    transition: transform 0.3s ease;
}

.nav-hidden {
    transform: translateX(100%);
}

/* ========== Sections ========== */
.section {
    min-height: 100vh;
    padding-top: 80px;
}

.section-alt {
    background-color: var(--bg-primary);
}

.section-title {
    font-size: 30px;
    font-weight: bold;
    text-align: center;
    margin-bottom: 48px;
    color: var(--text-primary);
}

/* ========== Typography ========== */
.text-secondary {
    color: var(--text-secondary);
}

.text-link {
    color: var(--primary-color);
    transition: color 0.3s ease;
}

.text-link:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* ========== Profile Image ========== */
.profile-img {
    width: 256px;
    height: 256px;
    border-radius: 50%;
    overflow: hidden;
    border: 4px solid var(--accent-yellow);
    box-shadow: 0 8px 24px var(--shadow-md);
}

.profile-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== Cursor Animation ========== */
.cursor {
    display: inline-block;
    margin-left: 2px;
    width: 2px;
    background: var(--text-secondary);
    animation: blink 0.7s infinite;
}

@keyframes blink {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ========== Buttons ========== */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 16px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    width: 100%;
}

@media (min-width: 768px) {
    .btn {
        width: auto;
    }
}

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

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

.btn-location {
    background: var(--accent-yellow);
    color: white;
}

.btn-location:hover {
    background: #f59e0b;
}

.btn-email {
    background: var(--accent-red);
    color: white;
}

.btn-email:hover {
    background: #dc2626;
}

.btn-phone {
    background: var(--accent-green);
    color: white;
}

.btn-phone:hover {
    background: #059669;
}

.btn-linkedin {
    background: #0a66c2;
    color: white;
}

.btn-linkedin:hover {
    background: #004182;
}

.btn-github {
    background: #24292e;
    color: white;
}

.btn-github:hover {
    background: #000000;
}

/* ========== Skills Carousel ========== */
@keyframes scroll-left {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.animate-scroll-left {
    animation: scroll-left 30s linear infinite;
}

.skill-card {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.skill-card:hover {
    transform: scale(1.1);
}

.skill-card .skill-name {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(6px);
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 14px;
    font-weight: bold;
    opacity: 0;
    transition: opacity 0.3s;
    border-radius: 12px;
}

.skill-card.show-name .skill-name {
    opacity: 1;
}

/* ========== Cards ========== */
.card {
    background-color: var(--bg-primary);
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    transition: all 0.3s ease;
}

.card:hover {
    box-shadow: 0 8px 24px var(--shadow-md);
}

/* ========== Timeline ========== */
.timeline-item {
    position: relative;
    padding-left: 30px;
    margin-bottom: 40px;
}

.timeline-item:before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary-color);
}

.timeline-item:after {
    content: '';
    position: absolute;
    left: 5px;
    top: 12px;
    width: 2px;
    height: calc(100% + 28px);
    background: var(--border-color);
}

.timeline-item:last-child:after {
    display: none;
}

/* ========== Badge ========== */
.badge {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 14px;
}

/* ========== Icon Box ========== */
.icon-box {
    width: 48px;
    height: 48px;
    margin-right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-tertiary);
    border-radius: 12px;
    color: var(--primary-color);
    font-size: 20px;
}

/* ========== Projects ========== */
.project-card {
    background-color: var(--bg-primary);
    border-radius: 12px;
    box-shadow: 0 4px 12px var(--shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 24px var(--shadow-md);
}

.project-img {
    height: 192px;
    background-color: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.project-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ========== Forms ========== */
.form-label {
    display: block;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--text-tertiary);
}

/* ========== Contact Links ========== */
.contact-link {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.social-link {
    color: var(--text-primary);
    transition: color 0.3s ease;
}

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

/* ========== Footer ========== */
.footer {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 24px 0;
}

/* ========== Theme Toggle & Scroll to Top Buttons ========== */
.theme-toggle {
    position: fixed;
    bottom: 24px;
    left: 24px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 16px var(--shadow-md);
    z-index: 1000;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

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

/* ========== Scroll to Top Button ========== */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px; /* Positioned on the right side */
    background: var(--primary-color);
    color: white;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    box-shadow: 0 6px 16px var(--shadow-md);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.scroll-top.visible {
    opacity: 1;
}

.scroll-top:hover {
    background: var(--primary-hover);
    transform: scale(1.1);
}

/* ========== Responsive Adjustments ========== */
@media (max-width: 768px) {
    .section {
        padding-top: 60px;
    }
    
    .section-title {
        font-size: 24px;
        margin-bottom: 32px;
    }
    
    .theme-toggle {
        width: 56px;
        height: 56px;
        bottom: 80px; /* Raised up on mobile */
        left: 16px;
        font-size: 20px;
    }
    
    .scroll-top {
        width: 56px;
        height: 56px;
        bottom: 80px; /* Raised up on mobile, same line */
        right: 16px; /* On the right side for mobile */
        font-size: 20px;
    }
}