﻿/* ============================================
   M Saif Ali - Portfolio Styles
   PHP Laravel Developer
   ============================================ */

:root {
    --primary: #0d6efd;
    --primary-dark: #0a58ca;
    --primary-subtle: rgba(13, 110, 253, 0.12);
    --bg-body: #f8fafc;
    --bg-section: #ffffff;
    --text-body: #212529;
    --text-muted: #6c757d;
    --nav-bg: rgba(13, 58, 109, 0.95);
    --nav-bg-scroll: rgba(13, 58, 109, 0.98);
    --card-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.06);
    --card-shadow-hover: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.1);
    --footer-bg: #0d3a6d;
    --footer-text: rgba(255, 255, 255, 0.85);
}

[data-bs-theme="dark"] {
    --primary: #6ea8fe;
    --primary-dark: #5a9cf8;
    --primary-subtle: rgba(110, 168, 254, 0.15);
    --bg-body: #0d1117;
    --bg-section: #161b22;
    --text-body: #e6edf3;
    --text-muted: #8b949e;
    --nav-bg: rgba(13, 17, 23, 0.95);
    --nav-bg-scroll: rgba(13, 17, 23, 0.98);
    --card-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.3);
    --card-shadow-hover: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4);
    --footer-bg: #010409;
    --footer-text: rgba(230, 237, 243, 0.8);
}

* {
    scroll-behavior: smooth;
}

html {
    scroll-padding-top: 80px;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-body);
    overflow-x: hidden;
}

/* Navbar */
.bg-nav {
    background: var(--nav-bg) !important;
    backdrop-filter: blur(12px);
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

.bg-nav.scrolled {
    background: var(--nav-bg-scroll) !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.navbar-brand {
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.nav-link {
    font-weight: 500;
    padding: 0.5rem 0.75rem !important;
    border-radius: 0.375rem;
    transition: color 0.2s, background 0.2s;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.9) !important;
    background: rgba(255, 255, 255, 0.1);
}

/* Navbar slide-in on load */
#mainNav {
    animation: navSlideDown 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes navSlideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Theme Toggle */
.btn-theme-toggle {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: background 0.2s, color 0.2s;
}

.btn-theme-toggle:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
    transform: rotate(15deg) scale(1.05);
}
.btn-theme-toggle {
    transition: transform 0.25s ease, background 0.2s ease;
}

[data-bs-theme="dark"] .btn-theme-toggle .sun-icon {
    display: none !important;
}

[data-bs-theme="dark"] .btn-theme-toggle .moon-icon {
    display: inline-block !important;
}

[data-bs-theme="light"] .btn-theme-toggle .moon-icon {
    display: none !important;
}

/* Hero Section */
.hero-section {
    position: relative;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.hero-subtitle {
    max-width: 540px;
}

.hero-image-wrapper {
    max-width: 320px;
}

.hero-profile-img {
    border: 4px solid var(--primary-subtle);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-profile-img:hover {
    transform: scale(1.03);
    box-shadow: 0 1rem 2.5rem rgba(13, 110, 253, 0.2) !important;
}

.exp-badge {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.hero-scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
}

.hero-scroll-indicator a {
    color: var(--text-muted);
    font-size: 1.5rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-8px); }
    60% { transform: translateY(-4px); }
}

/* Hero entrance animations */
.hero-animate {
    opacity: 0;
    transform: translateY(28px);
    animation: heroFadeUp 0.8s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-delay-1 { animation-delay: 0.15s; }
.hero-delay-2 { animation-delay: 0.25s; }
.hero-delay-3 { animation-delay: 0.35s; }
.hero-delay-4 { animation-delay: 0.45s; }
.hero-delay-5 { animation-delay: 0.6s; }

@keyframes heroFadeUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Hero background shapes (floating orbs) */
.hero-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}
.hero-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
    opacity: 0.4;
    animation: floatShape 18s ease-in-out infinite;
}
.hero-shape-1 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary) 0%, rgba(13, 110, 253, 0.3) 100%);
    top: -10%;
    right: -5%;
    animation-delay: 0s;
}
.hero-shape-2 {
    width: 300px;
    height: 300px;
    background: linear-gradient(225deg, rgba(13, 110, 253, 0.35) 0%, transparent 70%);
    bottom: 10%;
    left: -5%;
    animation-delay: -6s;
}
.hero-shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(315deg, var(--primary) 0%, transparent 60%);
    top: 50%;
    left: 40%;
    animation-delay: -12s;
}
@keyframes floatShape {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

[data-bs-theme="dark"] .hero-shape {
    opacity: 0.2;
}
[data-bs-theme="dark"] .hero-section {
    animation: none;
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-section) 100%);
}

/* Animated gradient hero background */
.hero-section {
    background: linear-gradient(135deg, var(--bg-body) 0%, var(--bg-section) 50%, var(--bg-body) 100%);
    background-size: 200% 200%;
    animation: gradientShift 12s ease infinite;
    position: relative;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Button glow effect */
.btn-glow {
    position: relative;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.btn-glow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.35);
}
.btn-glow:active {
    transform: translateY(0);
}

/* Scroll reveal – hidden by default */
.reveal-up {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1), transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal-up.visible {
    opacity: 1;
    transform: translateY(0);
}
.reveal-up[data-delay="1"].visible { transition-delay: 0.1s; }
.reveal-up[data-delay="2"].visible { transition-delay: 0.2s; }
.reveal-up[data-delay="3"].visible { transition-delay: 0.3s; }
.reveal-up[data-delay="4"].visible { transition-delay: 0.4s; }
.reveal-up[data-delay="5"].visible { transition-delay: 0.5s; }
.reveal-up[data-delay="6"].visible { transition-delay: 0.6s; }
.reveal-up[data-delay="7"].visible { transition-delay: 0.7s; }

/* Section underline grow-in */
.section-header .section-underline {
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.2s;
}
.section-header.visible .section-underline {
    transform: scaleX(1);
}

/* Section spacing & headers */
.section-py {
    padding-top: 5rem;
    padding-bottom: 5rem;
}

.section-title {
    font-size: 2rem;
    letter-spacing: -0.02em;
}

.section-underline {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-dark));
    border-radius: 2px;
}

.section-subtitle {
    max-width: 500px;
    margin-left: auto;
    margin-right: auto;
}

/* Background section alternate */
.bg-section {
    background-color: var(--bg-section);
}

/* Cards - hover lift effect */
.hover-lift {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: var(--card-shadow-hover) !important;
}

/* Card border glow on hover (light theme) */
.skill-card:hover,
.service-card:hover,
.project-card:hover {
    outline: 1px solid var(--primary-subtle);
}

/* About section – enhanced */
.about-section .section-header { margin-bottom: 3rem; }

.about-avatar-wrap {
    max-width: 220px;
    position: relative;
}
.about-avatar-wrap::after {
    content: '';
    position: absolute;
    inset: -8px;
    border: 2px solid var(--primary-subtle);
    border-radius: 1rem;
    z-index: 0;
}
.about-avatar {
    position: relative;
    z-index: 1;
    box-shadow: 0 1rem 2rem rgba(13, 110, 253, 0.15);
    transition: transform 0.3s ease;
}
.about-avatar:hover { transform: scale(1.02); }

.about-highlights { max-width: 280px; margin: 0 auto; }
.about-highlight-item {
    background: var(--bg-section);
    border: 1px solid rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.about-highlight-item:hover {
    transform: translateX(6px);
    box-shadow: var(--card-shadow);
}
[data-bs-theme="dark"] .about-highlight-item {
    border-color: rgba(255, 255, 255, 0.08);
    background: var(--bg-body);
}
.about-highlight-icon {
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--primary-subtle);
    font-size: 1.25rem;
}

.about-card {
    background-color: var(--bg-section);
    position: relative;
}
.about-card-accent {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(180deg, var(--primary), var(--primary-dark));
    border-radius: 4px 0 0 4px;
}
.about-intro-icon {
    font-size: 2rem;
    opacity: 0.9;
}
.about-tags { margin-top: 1rem; }
.about-tag {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background 0.2s ease, color 0.2s ease;
}
.about-tag:hover {
    background: var(--primary);
    color: #fff;
}

@media (max-width: 991.98px) {
    .about-profile-wrapper { margin-bottom: 1rem; }
    .about-highlights { max-width: 100%; }
}

/* Skill cards */
.skill-card .skill-icon-wrapper {
    transition: transform 0.3s ease;
}

.skill-card:hover .skill-icon-wrapper {
    transform: scale(1.05);
}

.skill-progress {
    border-radius: 4px;
    overflow: hidden;
}

/* Skill bar – animate width when visible (JS sets width) */
.skill-bar {
    width: 0 !important;
    transition: width 1s cubic-bezier(0.22, 1, 0.36, 1);
}
.skill-card.visible .skill-bar {
    width: var(--skill-width, 0) !important;
}

/* Service cards */
.service-icon {
    width: 56px;
    height: 56px;
    transition: transform 0.3s ease, background 0.3s ease;
}

.service-card:hover .service-icon {
    transform: scale(1.1);
    background: var(--primary-dark) !important;
}

/* Project cards */
.project-img-placeholder {
    min-height: 160px;
    transition: background 0.3s ease;
}

.project-card:hover .project-img-placeholder {
    background: rgba(13, 110, 253, 0.2) !important;
}

/* Project card icon subtle pulse on hover */
.project-card .project-img-placeholder i {
    transition: transform 0.4s ease;
}
.project-card:hover .project-img-placeholder i {
    transform: scale(1.1);
}

/* Tech Stack */
.tech-badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    background: var(--primary-subtle);
    color: var(--primary);
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
}
.tech-stack-card .card-body { min-height: 100px; }

/* Experience Timeline */
.timeline { position: relative; padding-left: 2rem; }
.timeline::before {
    content: '';
    position: absolute;
    left: 0.35rem;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(180deg, var(--primary), var(--primary-subtle));
    border-radius: 2px;
}
.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
    position: absolute;
    left: -2rem;
    top: 1.25rem;
    width: 12px;
    height: 12px;
    background: var(--primary);
    border-radius: 50%;
    border: 3px solid var(--bg-section);
    box-shadow: 0 0 0 2px var(--primary);
}
.timeline-content { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.timeline-content:hover { transform: translateX(4px); }

/* Project filter buttons */
.btn-filter {
    border-radius: 9999px;
    padding: 0.4rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--primary-subtle);
    background: var(--bg-section);
    color: var(--text-body);
    transition: all 0.2s ease;
}
.btn-filter:hover, .btn-filter.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
.project-item.hide { display: none !important; }

/* Statistics */
.stat-number { font-size: 2rem; line-height: 1.2; }
.stat-card .card-body { padding: 1rem !important; }

/* Testimonial carousel */
.testimonial-slide { min-height: 280px; }
.testimonial-stars { font-size: 1.25rem; letter-spacing: 0.2em; }
.testimonial-avatar { width: 56px; height: 56px; font-size: 1.1rem; }
#testimonialCarousel .carousel-control-prev,
#testimonialCarousel .carousel-control-next {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-subtle);
    opacity: 1;
    top: 50%;
    transform: translateY(-50%);
}
#testimonialCarousel .carousel-control-prev { left: 0; }
#testimonialCarousel .carousel-control-next { right: 0; }
#testimonialCarousel .carousel-control-prev-icon,
#testimonialCarousel .carousel-control-next-icon { filter: none; }
@media (min-width: 768px) {
    #testimonialCarousel .carousel-control-prev { left: -1.5rem; }
    #testimonialCarousel .carousel-control-next { right: -1.5rem; }
}

/* Project modal */
#projectModal .modal-content { overflow: hidden; }
.project-screenshot { background-color: var(--primary-subtle) !important; }

/* Testimonials */
.testimonial-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.testimonial-quote {
    line-height: 1;
}
.testimonial-avatar {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    font-size: 1rem;
}

/* Contact */
.contact-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
}

.map-wrapper iframe {
    display: block;
}

/* Footer */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
}

.social-link {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--footer-text);
    transition: background 0.2s, color 0.2s, transform 0.2s;
}

.social-link:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-3px);
}

/* Bootstrap overrides for theme */
[data-bs-theme="dark"] .bg-primary-subtle {
    background-color: var(--primary-subtle);
}

[data-bs-theme="dark"] .text-primary {
    color: var(--primary) !important;
}

[data-bs-theme="dark"] .btn-outline-primary {
    border-color: var(--primary);
    color: var(--primary);
}

[data-bs-theme="dark"] .btn-outline-primary:hover {
    background: var(--primary);
    color: #fff;
}

[data-bs-theme="dark"] .card {
    background-color: var(--bg-section);
    border-color: rgba(255, 255, 255, 0.06);
}

[data-bs-theme="dark"] .progress {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-bs-theme="dark"] .progress-bar {
    background-color: var(--primary);
}

/* Badge */
.bg-primary-subtle {
    background-color: var(--primary-subtle);
}

/* Responsive */
@media (max-width: 991.98px) {
    .section-py {
        padding-top: 3.5rem;
        padding-bottom: 3.5rem;
    }

    .hero-scroll-indicator {
        bottom: 1rem;
    }
}

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

    .btn-lg {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    .timeline { padding-left: 1.5rem; }
    .timeline-marker { left: -1.5rem; }
    .stat-number { font-size: 1.5rem; }
}

.exp-badge {
  display: inline-flex;
  align-items: center;
  background: #ffffff;
  color: #333;
  border: 1px solid rgba(0, 0, 0, 0.08);
  padding: 10px 16px;
  border-radius: 50px;
  font-size: 15px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}

.hero-subtitle {
  max-width: 560px;
}

.hero-status-card {
  position: absolute;
  bottom: 25px;
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  padding: 12px 18px;
  border-radius: 50px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 8px;
}

.status-dot {
  width: 10px;
  height: 10px;
  background: #28a745;
  border-radius: 50%;
  display: inline-block;
}

/* Codex redesign overrides */
.hero-section { min-height: calc(100vh - 72px); background: radial-gradient(circle at top left, rgba(13,110,253,.14), transparent 34%), linear-gradient(135deg, var(--bg-body) 0%, var(--bg-section) 100%); animation: none; overflow: hidden; }
.hero-bg-pattern { position: absolute; inset: 0; pointer-events: none; opacity: .42; background-image: linear-gradient(rgba(13,110,253,.08) 1px, transparent 1px), linear-gradient(90deg, rgba(13,110,253,.08) 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, #000, transparent 82%); }
.hero-image-wrapper { max-width: 390px; position: relative; padding: 14px; border-radius: 32px; background: linear-gradient(145deg, rgba(255,255,255,.9), rgba(13,110,253,.12)); border: 1px solid rgba(13,110,253,.16); }
.hero-image-wrapper::before { content: ''; position: absolute; inset: 28px -14px -14px 28px; border-radius: 32px; background: var(--primary); opacity: .08; z-index: -1; }
.hero-profile-img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: center top; border-radius: 24px; border: 0; }
.hero-status-card { position: absolute; bottom: 30px; display: flex; align-items: center; gap: 10px; padding: .85rem 1rem; border-radius: 16px; background: rgba(255,255,255,.92); color: #123; font-weight: 700; backdrop-filter: blur(12px); }
.status-dot { width: 10px; height: 10px; border-radius: 50%; background: #24c76a; box-shadow: 0 0 0 6px rgba(36,199,106,.16); flex: 0 0 auto; }
[data-bs-theme="dark"] .hero-status-card { background: rgba(13,17,23,.86); color: var(--text-body); }
.project-card { cursor: pointer; border-radius: 18px !important; }
.project-browser { position: relative; height: 230px; overflow: hidden; background: var(--bg-body); border-bottom: 1px solid rgba(0,0,0,.08); }
.browser-bar { height: 34px; display: flex; align-items: center; gap: 7px; padding: 0 13px; background: rgba(13,58,109,.08); border-bottom: 1px solid rgba(0,0,0,.06); }
.browser-bar span { width: 9px; height: 9px; border-radius: 50%; background: #ff5f57; }
.browser-bar span:nth-child(2) { background: #ffbd2e; }
.browser-bar span:nth-child(3) { background: #28c840; }
.project-browser .project-image { width: 100%; min-height: calc(100% - 34px); height: auto; display: block; object-fit: cover; object-position: top center; transform: translateY(0); transition: transform 5s ease; }
.project-card:hover .project-browser .project-image, .project-screenshot:hover .project-image { transform: translateY(calc(-100% + 196px)); }
.project-card-actions { display: flex; gap: .6rem; align-items: center; }
.project-card-actions .btn { min-width: 86px; }
.project-screenshot.project-browser { height: 360px; border: 1px solid rgba(13,110,253,.14); }
.project-screenshot.project-browser .project-image { min-height: calc(100% - 34px); }
.project-screenshot:hover .project-image { transform: translateY(calc(-100% + 326px)); }
@media (max-width: 575.98px) { .hero-image-wrapper { max-width: 310px; } .hero-status-card {  bottom: 22px; font-size: .82rem; } .project-browser { height: 210px; } .project-screenshot.project-browser { height: 280px; } }