/* Dark Theme Color Variables */
:root {
    --bg-body: #0d1117;
    --bg-surface: #161b22;
    --bg-elevated: #21262d;
    --border-color: #30363d;
    --accent-primary: #58a6ff;
    --accent-secondary: #238636;
    --text-primary: #e6edf3;
    --text-secondary: #8b949e;
    --text-muted: #6e7681;
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Base Styles */
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
}

/* Navbar Customization */
.navbar {
    background-color: var(--bg-surface) !important;
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 600;
    color: var(--text-primary) !important;
}

.nav-link {
    color: var(--text-secondary) !important;
    font-weight: 500;
    transition: color 0.2s ease;
}

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

/* Main Content Area */
main {
    background-color: var(--bg-surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

/* Profile Section */
.profile {
    text-align: center;
}

.profile img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    object-position: center;
    border-radius: 50%;
    border: 3px solid var(--accent-primary);
    margin-bottom: 1rem;
}

.profile h1 {
    margin-top: 0.5rem;
    font-size: 1.75rem;
    color: var(--text-primary);
}

.profile p {
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.profile a {
    color: var(--accent-primary);
    text-decoration: none;
}

.profile a:hover {
    text-decoration: underline;
}

/* Social Icons */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.4rem;
    transition: all 0.3s ease;
}

.social-icons a:hover {
    color: var(--accent-primary);
    border-color: var(--accent-primary);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(88, 166, 255, 0.3);
}

/* Hero Tagline */
.hero-tagline {
    color: var(--accent-primary);
    font-size: 1.1rem;
    font-weight: 500;
    margin-top: 0.25rem;
    margin-bottom: 1rem;
}

/* Skills Section */
.skills-section {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.skills-section h3 {
    color: var(--text-primary);
    font-size: 1.1rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.skill-category {
    margin-bottom: 1.25rem;
}

.skill-category-title {
    color: var(--text-secondary);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.skill-badges {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.skill-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-secondary);
    font-size: 0.85rem;
    transition: all 0.2s ease;
}

.skill-badge:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

/* GitHub Activity Section */
.github-activity-section {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.github-activity-section h2 {
    color: var(--text-primary);
    font-size: 1.25rem;
    margin-bottom: 1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.github-activity-section h2 i {
    color: var(--accent-primary);
}

.github-activity-section .calendar {
    overflow-x: auto;
    padding: 0.5rem 0;
}

/* GitHub Calendar - Match GitHub's Dark Theme */
.calendar .contrib-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.calendar .contrib-legend {
    margin-left: auto;
}

.calendar .contrib-legend .legend-label {
    color: var(--text-muted) !important;
    font-size: 0.7rem;
}

.calendar .text-muted {
    color: var(--text-muted) !important;
}

.calendar text.wday,
.calendar text.month {
    fill: var(--text-muted) !important;
    font-size: 9px;
}

/* GitHub's exact contribution colors for dark theme */
.calendar .ContributionCalendar-day[data-level="0"] {
    fill: #161b22 !important;
    outline: 1px solid rgba(27, 31, 35, 0.06);
}

.calendar .ContributionCalendar-day[data-level="1"] {
    fill: #0e4429 !important;
}

.calendar .ContributionCalendar-day[data-level="2"] {
    fill: #006d32 !important;
}

.calendar .ContributionCalendar-day[data-level="3"] {
    fill: #26a641 !important;
}

.calendar .ContributionCalendar-day[data-level="4"] {
    fill: #39d353 !important;
}

.calendar rect.ContributionCalendar-day {
    rx: 2;
    ry: 2;
}

.github-profile-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    color: var(--accent-primary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: opacity 0.2s ease;
}

.github-profile-link:hover {
    opacity: 0.8;
    text-decoration: underline;
}

.github-profile-link i {
    font-size: 0.75rem;
}

/* Bio Section */
.bio h2 {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.bio h2:first-child {
    margin-top: 0;
}

.bio p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.bio ul {
    color: var(--text-secondary);
    padding-left: 1.5rem;
}

.bio li {
    margin-bottom: 0.25rem;
}

.bio a {
    color: var(--accent-primary);
    text-decoration: none;
}

.bio a:hover {
    text-decoration: underline;
}

/* Cards (Bootstrap Override) */
.card {
    background-color: var(--bg-elevated) !important;
    border: 1px solid var(--border-color) !important;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
    border-color: var(--accent-primary) !important;
    transform: translateY(-2px);
}

.card-title {
    color: var(--text-primary) !important;
    font-weight: 600;
}

.card-body ul {
    color: var(--text-secondary);
    padding-left: 1.25rem;
    margin-bottom: 0;
}

.card-body li {
    margin-bottom: 0.25rem;
}

.card-footer {
    background-color: transparent !important;
    border-top: 1px solid var(--border-color) !important;
}

/* Buttons */
.btn-outline-primary {
    color: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
}

.btn-outline-primary:hover {
    background-color: var(--accent-primary) !important;
    color: var(--bg-body) !important;
}

.btn-outline-secondary {
    color: var(--text-secondary) !important;
    border-color: var(--border-color) !important;
}

.btn-outline-secondary:hover {
    background-color: var(--bg-elevated) !important;
    border-color: var(--text-secondary) !important;
    color: var(--text-primary) !important;
}

.btn-primary {
    background-color: var(--accent-primary) !important;
    border-color: var(--accent-primary) !important;
    color: var(--bg-body) !important;
}

.btn-primary:hover {
    background-color: #4c9aed !important;
    border-color: #4c9aed !important;
}

/* Project Detail Pages */
.project h2 {
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
}

.project p {
    color: var(--text-secondary);
    line-height: 1.7;
}

.project a {
    color: var(--accent-primary);
    text-decoration: none;
}

.project a:hover {
    text-decoration: underline;
}

.project strong {
    color: var(--text-primary);
}

/* Project List Styling */
.project-list ul {
    list-style-type: disc;
    padding-left: 1.5rem;
    color: var(--text-secondary);
}

.project-list ul ul {
    margin-top: 0.5rem;
    margin-left: 1rem;
    list-style-type: circle;
}

.project-list li {
    margin-bottom: 0.5rem;
}

.project-list.two-column ul {
    display: flex;
    flex-wrap: wrap;
    padding-left: 0;
    list-style: none;
    gap: 2rem;
}

.project-list.two-column ul > li {
    flex: 1 1 45%;
    min-width: 280px;
}

.project-list.two-column ul ul {
    display: block;
    margin-top: 0.5rem;
    padding-left: 1.25rem;
    list-style: disc;
}

/* Slideshow Styles */
.slideshow-container {
    max-width: 900px;
    position: relative;
    margin: 1.5rem auto;
    background-color: var(--bg-elevated);
    border-radius: 8px;
    padding: 1rem;
    border: 1px solid var(--border-color);
}

.slideshow-img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.mySlides {
    display: none;
}

.prev, .next {
    cursor: pointer;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    font-weight: bold;
    font-size: 1rem;
    transition: background-color 0.2s ease;
    border-radius: 4px;
    background-color: var(--bg-surface);
    border: 1px solid var(--border-color);
    user-select: none;
}

.prev:hover, .next:hover {
    background-color: var(--accent-primary);
    color: var(--bg-body);
    border-color: var(--accent-primary);
}

.dot-container {
    text-align: center;
    padding-top: 0.75rem;
}

.dot {
    cursor: pointer;
    height: 12px;
    width: 12px;
    margin: 0 4px;
    background-color: var(--border-color);
    border-radius: 50%;
    display: inline-block;
    transition: background-color 0.3s ease;
}

.dot.active, .dot:hover {
    background-color: var(--accent-primary);
}

.text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    padding: 0.5rem;
    text-align: center;
    margin-top: 0.5rem;
}

/* Footer */
.footer {
    background-color: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-top: 2rem;
}

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

.footer-bottom p {
    margin: 0;
}

.footer-bottom a {
    color: var(--accent-primary);
    text-decoration: none;
}

.footer-bottom a:hover {
    text-decoration: underline;
}

/* Center last card when it's alone in a row (odd total count) */
@media (min-width: 768px) {
    .row-cols-md-2 > .col:last-child:nth-child(odd) {
        margin-left: auto;
        margin-right: auto;
    }
}

/* Page Titles */
main > h1 {
    color: var(--text-primary);
    text-align: center;
    margin-bottom: 1.5rem;
}

/* Responsive Adjustments */
@media (max-width: 991.98px) {
    .profile {
        margin-bottom: 2rem;
    }

    .profile img {
        width: 180px;
        height: 180px;
    }
}

@media (max-width: 767.98px) {
    main {
        margin-top: 1rem;
        margin-bottom: 1rem;
        padding: 1.5rem;
    }

    .profile img {
        width: 150px;
        height: 150px;
    }

    .slideshow-container {
        padding: 0.75rem;
    }
}

/* Fade Animation for Slideshows */
@keyframes fadeIn {
    from { opacity: 0.4; }
    to { opacity: 1; }
}

.fade-slide {
    animation: fadeIn 0.5s ease;
}

/* Contact Section */
.contact-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.contact-buttons .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

/* Image Carousel */
.image-carousel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
}

.carousel-track-container {
    flex: 1;
    overflow: hidden;
    border-radius: 8px;
}

.carousel-track {
    display: flex;
    gap: 12px;
    transition: transform 0.3s ease;
}

.carousel-slide {
    flex: 0 0 calc(25% - 9px);
    min-width: calc(25% - 9px);
}

.carousel-slide img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    transition: border-color 0.2s ease;
}

.carousel-slide img:hover {
    border-color: var(--accent-primary);
}

.carousel-arrow {
    background-color: var(--bg-elevated);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.carousel-arrow:hover {
    border-color: var(--accent-primary);
    color: var(--accent-primary);
}

@media (max-width: 767.98px) {
    .carousel-slide {
        flex: 0 0 calc(50% - 6px);
        min-width: calc(50% - 6px);
    }
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: var(--text-primary);
    font-size: 2.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.lightbox-close:hover {
    color: var(--accent-primary);
}
