/* ----------------------------------------------------------------------
   Jeevan Joseph Portfolio Styling (Enhanced V2)
   Focus: Professionalism, Clarity, and Technical Organization
------------------------------------------------------------------------- */

/* --- 1. Variables and Reset --- */
:root {
    --primary-color: #007bff; /* Main Blue: Professionalism, Links */
    --accent-color: #ffc107; /* Gold/Yellow: Highlighting, Accents */
    --dark-bg: #1e1e24; /* Deep Charcoal: Hero/Header Background */
    --light-bg: #ffffff;
    --text-color: #343a40; /* Dark Text */
    --secondary-text: #6c757d; /* Lighter Text for descriptions */
    --shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: #f8f9fa; /* Off-White/Light Gray background */
    color: var(--text-color);
    scroll-behavior: smooth; /* Smooth scrolling for anchor links */
}

/* --- 2. Layout & Typography --- */
.section {
    max-width: 1200px;
    padding: 80px 5%;
    margin: 0 auto;
}

h2 {
    text-align: center;
    margin-bottom: 50px;
    font-weight: 800;
    font-size: 2.2em;
    color: var(--primary-color);
}

/* --- 3. Navigation & Header --- */
.navbar {
    background-color: var(--dark-bg);
    color: var(--light-bg);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.navbar a {
    color: var(--light-bg);
    text-decoration: none;
    padding: 0 15px;
    font-weight: 300;
    transition: color 0.3s;
}

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

.logo {
    font-weight: 700 !important;
    font-size: 1.4em;
}

/* --- 4. Hero V2 (High Impact) --- */
.hero-v2 {
    background: var(--dark-bg);
    color: var(--light-bg);
    text-align: center;
    padding: 120px 5% 100px;
    border-bottom: 5px solid var(--accent-color);
}

.profile-photo-v2 {
    width: 150px;
    height: 150px;
    background-size: cover;
    background-position: center;
    border-radius: 50%;
    margin: 0 auto 25px;
    border: 7px solid var(--primary-color);
}

.hero-v2 h1 { 
    font-size: 3.8em; 
    margin-bottom: 10px; 
    font-weight: 800; 
}
.hero-v2 h2 { 
    font-size: 1.8em; 
    font-weight: 300; 
    color: #ced4da; 
    margin-bottom: 25px; 
}
.tagline { 
    color: #adb5bd; 
    font-size: 1.1em; 
    margin-bottom: 30px; 
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

/* --- 5. Buttons --- */
.button {
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 5px;
    font-weight: 600;
    transition: background-color 0.3s, border-color 0.3s;
    display: inline-block;
    margin-top: 10px;
}

.button.primary {
    background-color: var(--primary-color);
    color: white;
    border: 2px solid var(--primary-color);
}

.button.primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.button.secondary {
    background-color: transparent;
    color: var(--light-bg);
    border: 2px solid var(--light-bg);
}

.button.secondary:hover {
    background-color: var(--light-bg);
    color: var(--dark-bg);
}

/* --- 6. Skills Matrix (Updated for Grid Layout) --- */
.skills-matrix {
    padding: 80px 5%;
}

.skills-grid-wrapper {
    /* DESKTOP VIEW: Three-column grid */
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.skill-category-card {
    background: var(--light-bg);
    padding: 30px 25px;
    border-radius: 10px;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border-top: 5px solid var(--primary-color);
}

.skill-category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.category-header-v2 {
    font-size: 1.5em;
    font-weight: 700;
    color: var(--dark-bg);
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px dashed #e9ecef;
    text-align: left; /* Override h2 center alignment */
}

.skill-list-v2 {
    list-style: none;
    padding: 0;
}

.skill-list-v2 li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f1f1f1;
}

.skill-list-v2 li:last-child {
    border-bottom: none;
}

.skill-name {
    font-weight: 500;
    color: var(--text-color);
}

/* Level Badges */
.skill-level-v2 {
    font-size: 0.8em;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 4px;
    text-transform: uppercase;
}

.level-expert {
    background-color: #d4edda;
    color: #155724;
}
.level-specialist {
    background-color: #fff3cd;
    color: #856404;
}
.level-experienced {
    background-color: #cce5ff;
    color: #004085;
}

/* --- Responsive Adjustments for Mobile View (<= 768px) --- */
@media (max-width: 768px) {
    .skills-grid-wrapper {
        /* Mobile: Stacks the cards vertically */
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .skill-category-card {
        padding: 20px;
    }

    .category-header-v2 {
        font-size: 1.4em;
    }
}

/* --- 7. Experience Timeline (Fully Responsive) --- */
.timeline {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
}

/* The vertical line */
.timeline::after {
    content: '';
    position: absolute;
    width: 3px;
    background-color: var(--primary-color);
    top: 0;
    bottom: 0;
    left: 50%; /* Center alignment for desktop */
    margin-left: -1.5px;
}

/* Containers around the content (50% width on desktop) */
.timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
}

.timeline-item:nth-child(odd) { left: 0; }
.timeline-item:nth-child(even) { left: 50%; }

/* The circle marker */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 25px;
    height: 25px;
    right: -17px; /* Position on the right for odd items */
    background-color: var(--light-bg);
    border: 4px solid var(--accent-color);
    top: 25px;
    border-radius: 50%;
    z-index: 1;
}

/* Move the marker to the left for even items */
.timeline-item:nth-child(even)::after {
    left: -16px;
}

/* The content box */
.timeline-content {
    padding: 25px;
    background-color: var(--light-bg);
    position: relative;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.timeline-content:hover {
    transform: translateY(-3px);
}

.timeline-item:nth-child(odd) .timeline-content {
    border-right: 5px solid var(--primary-color);
}
.timeline-item:nth-child(even) .timeline-content {
    border-left: 5px solid var(--primary-color);
}

.timeline-content h3 { color: var(--text-color); font-size: 1.3em; margin-bottom: 5px; }
.timeline-content p { color: var(--secondary-text); margin-bottom: 10px; }


/* Date Placement (Desktop) */
.timeline-date {
    position: absolute;
    top: 30px;
    width: 150px;
    font-weight: 700;
    color: #495057;
    font-size: 0.9em;
}
.timeline-item:nth-child(odd) .timeline-date {
    right: 70%; 
    text-align: right;
}
.timeline-item:nth-child(even) .timeline-date {
    left: 70%;
    text-align: left;
}

.tech-tag {
    display: inline-block;
    background-color: #e9ecef;
    color: #495057;
    padding: 4px 10px;
    border-radius: 4px;
    margin-top: 5px;
    margin-right: 5px;
    font-size: 0.85em;
    font-weight: 500;
}

/* --- Responsive Adjustments (Mobile) --- */
@media (max-width: 768px) {
    /* --- Force Single-Column Layout on Mobile --- */
    .timeline::after {
        left: 31px; /* Move vertical line to the left */
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 70px; /* Space for the line/marker */
        padding-right: 25px;
    }
    
    /* Force all items to start from the left */
    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        left: 0%;
    }
    
    /* Position marker on the left for ALL items */
    .timeline-item::after {
        left: 15px;
        right: auto;
    }
    
    /* Remove border styles that assume a right/left split */
    .timeline-item:nth-child(odd) .timeline-content {
        border-right: none;
        border-left: 5px solid var(--primary-color);
    }
    
    /* Date Placement (Inline) */
    .timeline-date {
        position: static; /* Remove absolute positioning */
        text-align: left;
        margin-bottom: 5px;
        font-style: italic;
        color: #adb5bd; /* Subtler date color */
    }
    
    /* Remove margin rules that assume a split layout */
    .timeline-item:nth-child(even) .timeline-date,
    .timeline-item:nth-child(odd) .timeline-date {
        left: auto;
        right: auto;
        text-align: left;
    }
}

/* --- 8. Projects Grid V2 --- */
.projects-grid-v2 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.project-card-v2 {
    background-color: var(--light-bg);
    border-top: 4px solid var(--accent-color);
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: box-shadow 0.3s, transform 0.3s;
}

.project-card-v2:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.card-title { font-size: 1.5em; margin-bottom: 5px; }
.card-category { display: block; color: var(--primary-color); font-weight: 700; margin-bottom: 15px; font-size: 0.9em; }
.card-tech { font-size: 0.9em; color: var(--secondary-text); margin-top: 15px; }


/* --- 9. Contact Section (Form) --- */
.contact-form { max-width: 600px; margin: 0 auto; }

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 15px;
    margin-bottom: 20px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-family: inherit;
    font-size: 1em;
}

.contact-section {
    background-color: #e9ecef; /* Subtle background for contrast */
}

/* --- 10. Footer --- */
.footer {
    text-align: center;
    padding: 20px;
    background-color: var(--dark-bg);
    color: #adb5bd;
    font-size: 0.9em;
}

/* --- 11. Responsive Adjustments (For Mobile) --- */
@media (max-width: 768px) {
    .navbar {
        flex-direction: column;
    }
    .navbar nav {
        margin-top: 10px;
    }
    .hero-v2 h1 {
        font-size: 2.5em;
    }
    .hero-v2 h2 {
        font-size: 1.3em;
    }

    /* Timeline Stack on mobile */
    .timeline::after {
        left: 31px; /* Move line to the left */
    }
    .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }
    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        left: 0%;
    }
    .timeline-item::after {
        left: 15px;
    }
    .timeline-date {
        position: static; /* Place date above content */
        text-align: left;
        margin-bottom: 5px;
        font-style: italic;
    }
    .timeline-item:nth-child(even) .timeline-date,
    .timeline-item:nth-child(odd) .timeline-date {
        left: auto;
        right: auto;
        text-align: left;
    }
}
