/* Custom CSS for Pappu Kumar Portfolio */

:root {
    /* Light Mode Colors */
    --primary-color: #4361ee;
    --primary-hover: #3a53d0;
    --primary-light: rgba(67, 97, 238, 0.1);
    --secondary-color: #3f3d56;
    --text-color: #333333;
    --text-muted: #6c757d;
    --bg-color: #ffffff;
    --bg-alt: #f8f9fa;
    --card-bg: #ffffff;
    --border-color: #e9ecef;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    
    /* Fonts */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
}

/* Dark Mode Colors */
body.dark-mode {
    --primary-color: #4cc9f0;
    --primary-hover: #3eb5d9;
    --primary-light: rgba(76, 201, 240, 0.15);
    --secondary-color: #b0b3b8;
    --text-color: #f5f6f7;
    --text-muted: #a0a4a8;
    --bg-color: #0f172a;
    --bg-alt: #1e293b;
    --card-bg: #1e293b;
    --border-color: #334155;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
    --box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-color);
    background-color: var(--bg-color);
    transition: background-color 0.4s ease, color 0.4s ease;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--text-color);
}

.tracking-wide { letter-spacing: 0.05em; }

/* Utilities */
.text-primary { color: var(--primary-color) !important; }
.bg-primary { background-color: var(--primary-color) !important; }
.bg-primary-light { background-color: var(--primary-light) !important; }
.border-primary-subtle { border-color: var(--primary-light) !important; }

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px var(--primary-light);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    color: #fff;
    transform: translateY(-2px);
}

.bg-gradient-primary {
    background: linear-gradient(90deg, var(--primary-color) 0%, #8a2be2 100%);
}

.section-bg { background-color: var(--bg-alt); }
.card, .bg-white { 
    background-color: var(--card-bg) !important; 
    border-color: var(--border-color) !important;
}
.text-muted { color: var(--text-muted) !important; }

.transition-hover {
    transition: all 0.3s ease;
}
.transition-hover:hover {
    transform: translateY(-5px);
}

/* Glassmorphism */
.glassmorphism {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
}

.bg-glass {
    background: var(--glass-bg);
    backdrop-filter: blur(5px);
}

::selection {
    background: var(--primary-color);
    color: #fff;
}

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

.spinner {
    width: 60px;
    height: 60px;
    border: 5px solid var(--primary-light);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Navbar */
.navbar {
    padding: 20px 0;
    transition: all 0.4s ease;
    background: transparent;
}

.navbar.scrolled {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--box-shadow);
    padding: 12px 0;
}

.navbar-brand {
    font-size: 2rem;
    font-family: var(--font-heading);
    color: var(--text-color) !important;
    letter-spacing: -1px;
}

.nav-link {
    color: var(--text-color) !important;
    font-weight: 500;
    margin: 0 10px;
    position: relative;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 3px;
    bottom: -5px;
    left: 0;
    background-color: var(--primary-color);
    transition: width 0.3s ease;
    border-radius: 5px;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

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

#theme-toggle {
    width: 45px;
    height: 45px;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Hero Section */
.hero-section {
    min-height: 100vh;
    padding-top: 80px;
}

.hero-img-box .blob-shape {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 420px;
    height: 520px;
    background: linear-gradient(135deg, var(--primary-color), #8a2be2);
    border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%;
    animation: morph 8s ease-in-out infinite;
    z-index: 1;
    opacity: 0.6;
    filter: blur(20px);
}

@keyframes morph {
    0%, 100% { border-radius: 40% 60% 70% 30% / 40% 50% 60% 50%; }
    34% { border-radius: 70% 30% 50% 50% / 30% 30% 70% 70%; }
    67% { border-radius: 100% 60% 60% 100% / 100% 100% 60% 60%; }
}

.floating-card {
    z-index: 3;
    animation: float 4s ease-in-out infinite;
    min-width: 140px;
}

@keyframes float {
    0%, 100% { transform: translate(-50%, -50%) translateY(0); }
    50% { transform: translate(-50%, -50%) translateY(-15px); }
}

.social-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--card-bg);
    color: var(--text-color);
    box-shadow: var(--box-shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    font-size: 1.2rem;
}

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

/* Section Titles */
.title-line {
    width: 80px;
    height: 4px;
    background-color: var(--primary-color);
    border-radius: 2px;
    position: relative;
    margin-top: 15px;
}

.title-line::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 8px;
    background-color: var(--primary-color);
    border-radius: 4px;
    top: -2px;
    left: 50%;
    transform: translateX(-50%);
    animation: move 3s infinite linear;
}

@keyframes move {
    0% { left: 0; }
    50% { left: 100%; }
    100% { left: 0; }
}

/* Progress Bars */
.progress {
    background-color: var(--primary-light);
    border-radius: 10px;
    overflow: visible;
}

.progress-bar {
    position: relative;
    border-radius: 10px;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: -3px;
    right: 0;
    width: 16px;
    height: 16px;
    background-color: #fff;
    border: 4px solid var(--primary-color);
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0,0,0,0.2);
}

/* Service Cards */
.service-card {
    background-color: var(--card-bg);
    transition: all 0.4s ease;
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-15px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
    border-color: var(--primary-color) !important;
}

.service-card .icon-wrapper {
    width: 80px;
    height: 80px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--primary-light);
    color: var(--primary-color);
    border-radius: 20px;
    transform: rotate(45deg);
    transition: all 0.4s ease;
}

.service-card .icon-wrapper i {
    transform: rotate(-45deg);
    font-size: 32px;
}

.service-card:hover .icon-wrapper {
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 50%;
    transform: rotate(0deg);
}
.service-card:hover .icon-wrapper i {
    transform: rotate(0deg);
}

/* Project Filter & Cards */
.filter-btns .btn {
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.3s;
    border: none;
}

.filter-btns .btn:hover,
.filter-btns .btn.active {
    background-color: var(--primary-color);
    color: #fff;
    box-shadow: 0 5px 15px var(--primary-light);
}

.project-card {
    background-color: var(--card-bg);
    transition: all 0.4s ease;
}

.project-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    transition: all 0.4s ease;
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-link {
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    text-decoration: none;
    transform: translateY(30px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    opacity: 0;
}

.project-card:hover .project-link {
    transform: translateY(0);
    opacity: 1;
}

.project-link:hover {
    background-color: var(--primary-color) !important;
    transform: translateY(-5px) !important;
}
.project-link:hover i {
    color: #fff !important;
}

/* Timeline */
.timeline-container {
    max-width: 1000px;
    margin: 0 auto;
}

.timeline-line {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 3px;
    background-color: var(--primary-light);
    transform: translateX(-50%);
    border-radius: 5px;
}

.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    margin-bottom: 30px;
    clear: both;
}

.timeline-item.left { left: 0; float: left; text-align: right; }
.timeline-item.right { left: 50%; float: right; text-align: left; }

.timeline-container::after {
    content: "";
    display: table;
    clear: both;
}

.timeline-item::after {
    content: '';
    position: absolute;
    top: 40px;
    width: 24px;
    height: 24px;
    background-color: var(--primary-color);
    border: 5px solid var(--bg-color);
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

.timeline-item.left::after { right: -12px; }
.timeline-item.right::after { left: -12px; }

/* Contact Form */
.form-control {
    background-color: var(--bg-alt) !important;
    color: var(--text-color) !important;
}

.form-control:focus {
    box-shadow: none;
    border-color: var(--primary-color) !important;
    background-color: var(--card-bg) !important;
}

.contact-item:hover .icon-box {
    background-color: var(--primary-color) !important;
    color: #fff !important;
}

/* Footer Links */
.footer-links a, .footer-links span {
    transition: all 0.3s;
}
.footer-links a:hover {
    color: var(--primary-color) !important;
    padding-left: 5px;
}

/* Back to top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 99;
    font-size: 20px;
}

.back-to-top.active {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px var(--primary-light) !important;
}

/* Responsive */
@media (max-width: 991px) {
    .timeline-line { left: 30px; }
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 15px; text-align: left !important; }
    .timeline-item.left, .timeline-item.right { left: 0; }
    .timeline-item.left::after, .timeline-item.right::after { left: 18px; right: auto; }
    .navbar-collapse {
        background-color: var(--card-bg);
        padding: 20px;
        border-radius: 15px;
        box-shadow: var(--box-shadow);
        margin-top: 15px;
    }
}
