/* ========== Variables & Themes ========== */
:root {
    /* Dark theme (default) */
    --bg-primary: rgb(3, 7, 18);
    --bg-secondary: rgb(10, 15, 30);
    --text-primary: #f0f0f0;
    --text-secondary: #a0a0a0;
    --accent: #64ffda;
    --accent-hover: #4db6ac;
    --card-bg: rgb(15, 20, 35);
    --section-bg: rgb(7, 12, 25);
    --border: rgb(30, 40, 60);
}

[data-theme="light"] {
    /* Light theme */
    --bg-primary: #f5f7fa;
    --bg-secondary: #eef1f5;
    --text-primary: #2d3748;
    --text-secondary: #4a5568;
    --accent: #0d9488;
    --accent-hover: #0f766e;
    --card-bg: #ffffff;
    --section-bg: #edf2f7;
    --border: #cbd5e0;
}

/* ========== Base Styles ========== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
        Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
}

html,
body {
    overflow-x: hidden;
    position: relative;
    width: 100%;
}

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

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

section {
    padding: 5rem 0;
}

.highlight {
    color: var(--accent);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

/* Apply animations to initial elements */
header {
    animation: fadeIn 0.6s ease-out;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease-out 0.2s both;
}

.hero-title {
    animation: fadeInUp 0.8s ease-out 0.4s both;
}

.hero-role {
    animation: fadeInUp 0.8s ease-out 0.6s both;
}

.hero-description {
    animation: fadeInUp 0.8s ease-out 0.8s both;
}

.hero .btn {
    animation: fadeInUp 0.8s ease-out 1s both;
}

.profile-image {
    animation: fadeIn 1s ease-out 0.5s both;
}

.github-contrib {
    animation: fadeIn 1s ease-out 0.7s both;
}

/* ========== Header & Navigation ========== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--bg-primary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

header.hide {
    transform: translateY(-100%);
}

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

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

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 1rem;
    transition: color 0.3s ease;
    position: relative;
}

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

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

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

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

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    cursor: pointer;
}

/* ========== Hero Section ========== */
main {
    padding-top: 72px;
    /* Match header height */
}

.hero {
    min-height: calc(100vh - 72px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 5rem 0;
    position: relative;
}

.hero-content {
    max-width: 800px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
}

.hero-text {
    flex: 1;
}

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

.hero-subtitle {
    color: var(--accent);
    font-size: 1.2rem;
    margin-bottom: 1rem;
    font-weight: 500;
}

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

.hero-name {
    color: var(--accent);
}

.hero-role {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-weight: 500;
    max-width: 600px;
}

.hero-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
    margin-top: 1.5rem;
}

.hero-location i {
    color: var(--accent);
    font-size: 1rem;
}

/* Adjust responsive styles */
@media (max-width: 992px) {
    .hero-role {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-location {
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .hero-role {
        font-size: 1rem;
    }
}

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

.profile-image {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.profile-image:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(100, 255, 218, 0.2);
}

.github-contrib {
    max-width: 100%;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.github-contrib:hover {
    transform: translateY(-3px);
}

/* ========== Buttons ========== */
.btn {
    display: inline-block;
    background-color: transparent;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn:hover {
    background-color: rgba(100, 255, 218, 0.1);
    transform: translateY(-2px);
}

.btn i {
    margin-right: 0.5rem;
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-primary);
    border: 1px solid var(--accent);
    position: relative;
}

.btn-secondary:hover {
    background-color: rgba(var(--accent-rgb, 100, 255, 218, 0.1));
}

.theme-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem;
    margin-left: 1rem;
    border-radius: 50%;
    transition: background-color 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background-color: rgba(100, 255, 218, 0.1);
    transform: translateY(-2px);
}

/* ========== Section Styles ========== */
.section-title {
    font-size: 2rem;
    margin-bottom: 2.5rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--accent);
}

/* ========== Skills Section ========== */
.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 3rem;
}

.skill-tag {
    background-color: var(--card-bg);
    color: var(--text-primary);
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    border: 1px solid var(--border);
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
}

.skill-tag:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Skill tooltip styles */
.skill-tag::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent);
    color: var(--bg-primary);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    white-space: normal;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    z-index: 100;
    font-weight: 500;
    max-width: 250px;
    text-align: center;
    line-height: 1.3;
}

/* Mobile: Allow tooltip text to wrap */
@media (max-width: 768px) {
    .skill-tag::after {
        white-space: normal;
        max-width: 200px;
        text-align: center;
        line-height: 1.3;
    }
}

.skill-tag::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid var(--accent);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 100;
}

.skill-tag:hover::after,
.skill-tag:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Mobile: Show tooltip on active class */
.skill-tag.active::after,
.skill-tag.active::before {
    opacity: 1;
    visibility: visible;
}

/* ========== Experience Section ========== */
.experience-timeline {
    position: relative;
}

.timeline-item {
    margin-bottom: 3rem;
    position: relative;
    padding-left: 2rem;
}

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

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

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

.timeline-date {
    font-size: 0.9rem;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.timeline-company {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.timeline-position {
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.timeline-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.timeline-description ul {
    list-style-position: outside;
    padding-left: 1.5rem;
    margin-top: 0.5rem;
}

.timeline-description li {
    margin-bottom: 0.5rem;
}

/* ========== Projects Section ========== */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
}

.project-card {
    background-color: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.project-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent);
}

.project-content {
    padding: 1.5rem;
}

.project-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.project-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
}

.project-tech span {
    font-size: 0.8rem;
    color: var(--accent);
}

/* ========== Contact Section ========== */
.contact {
    background-color: var(--section-bg);
    border-top: 1px solid var(--border);
}

.contact-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.contact-title {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.contact-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    max-width: 600px;
}

.contact-actions {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

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

.social-link {
    color: var(--text-primary);
    font-size: 1.5rem;
    transition: color 0.3s ease, transform 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.social-link:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.social-label {
    font-size: 0.9rem;
}

/* Location styles */
.location {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
    font-size: 1rem;
}

.location i {
    color: var(--accent);
    font-size: 1.1rem;
}

/* Adjust for mobile */
@media (max-width: 576px) {
    .location {
        font-size: 0.9rem;
    }
}

/* ========== Footer ========== */
footer {
    background-color: var(--bg-primary);
    padding: 2rem 0;
    text-align: center;
    border-top: 1px solid var(--border);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* ========== External Links ========== */
.external-link {
    text-decoration: none;
    color: inherit;
    position: relative;
    transition: color 0.3s ease;
    padding-right: 1.2rem;
    display: inline-flex;
    align-items: center;
}

.external-link:hover {
    color: var(--accent);
}

.external-link i {
    font-size: 0.8rem;
    opacity: 0.6;
    margin-left: 0.3rem;
    transition: opacity 0.3s ease, transform 0.3s ease;
    position: relative;
}

.external-link:hover i {
    opacity: 1;
    transform: translateY(-1px);
}

.external-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.external-link:hover::after {
    width: calc(100% - 1rem);
}

/* ========== Tooltips ========== */
.tooltip {
    position: absolute;
    bottom: -40px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--accent);
    color: var(--bg-primary);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.8rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s;
    white-space: nowrap;
    pointer-events: none;
}

.tooltip::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%);
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 6px solid var(--accent);
}

.tooltip.show {
    opacity: 1;
    visibility: visible;
}

/* ========== Responsive Styles ========== */
@media (max-width: 992px) {
    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        gap: 3rem;
    }

    .profile-image {
        width: 180px;
        height: 180px;
    }

    .github-contrib {
        max-width: 90%;
    }
}

@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .nav-links {
        position: fixed;
        top: 72px;
        right: -100%;
        flex-direction: column;
        background-color: var(--bg-primary);
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 2rem;
        border-top: 1px solid var(--border);
        height: calc(100vh - 72px);
        overflow-y: auto;
    }

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

    .mobile-menu-btn {
        display: block;
    }

    .project-grid {
        grid-template-columns: 1fr;
    }

    .container {
        padding: 0 1rem;
        width: 100%;
        box-sizing: border-box;
    }

    section {
        padding: 3rem 0;
    }

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

@media (max-width: 576px) {
    .profile-image {
        width: 150px;
        height: 150px;
    }

    .github-contrib {
        max-width: 100%;
    }

    .btn {
        font-size: 0.9rem;
        padding: 0.75rem 1rem;
    }

    .contact-actions {
        flex-direction: column;
        width: 100%;
    }
}

/* Chat component styles */
.chat-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1000;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.chat-button {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--bg-primary);
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border: none;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.chat-button:hover {
    transform: scale(1.05);
}

.chat-container {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 320px;
    height: 400px;
    background-color: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.chat-container.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.chat-header {
    padding: 15px;
    background-color: var(--accent);
    color: var(--bg-primary);
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-close {
    background: none;
    border: none;
    color: var(--bg-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-messages {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.message {
    max-width: 80%;
    padding: 10px 15px;
    border-radius: 18px;
    font-size: 0.9rem;
    line-height: 1.4;
}

.message.received {
    align-self: flex-start;
    background-color: var(--section-bg);
    border-bottom-left-radius: 5px;
}

.message.sent {
    align-self: flex-end;
    background-color: var(--accent);
    color: var(--bg-primary);
    border-bottom-right-radius: 5px;
}

.chat-input-container {
    padding: 15px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 10px;
}

.chat-input {
    flex: 1;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    font-size: 0.9rem;
}

.chat-input:focus {
    outline: none;
    border-color: var(--accent);
}

.chat-submit {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--accent);
    color: var(--bg-primary);
    border: none;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    font-size: 1rem;
}

.chat-submit:disabled {
    background-color: var(--border);
    cursor: not-allowed;
}

.typing-indicator {
    display: flex;
    align-items: center;
    align-self: flex-start;
    background-color: var(--section-bg);
    padding: 8px 15px;
    border-radius: 18px;
    border-bottom-left-radius: 5px;
    margin-bottom: 5px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    display: inline-block;
    margin: 0 1px;
    opacity: 0.6;
}

.typing-indicator span:nth-child(1) {
    animation: blink 1s infinite 0.2s;
}

.typing-indicator span:nth-child(2) {
    animation: blink 1s infinite 0.4s;
}

.typing-indicator span:nth-child(3) {
    animation: blink 1s infinite 0.6s;
}

@keyframes blink {
    0% {
        opacity: 0.2;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.2;
    }
}

@media (max-width: 576px) {
    .chat-container {
        width: 280px;
        height: 350px;
        right: 0;
    }
}

.email-display {
    margin-bottom: 1rem;
    width: 100%;
    text-align: center;
}

.email-address {
    font-size: 1.25rem;
    color: var(--accent);
    font-weight: 500;
}

.email-buttons {
    display: flex;
    gap: 1rem;
    width: 100%;
    justify-content: center;
}

@media (max-width: 576px) {
    .email-buttons {
        flex-direction: column;
    }
}

.dev-feature {
    display: none !important;
}
