/* 
    Ofentse Batlang - Portfolio Stylesheet
    Refined & Optimized Version
*/

:root {
    --bg-primary: #000000;
    --bg-secondary: #0a0a0a;
    --text-primary: #ffffff;
    --text-secondary: #b0b0b0;
    --accent-blue: #39ff14;
    --accent-light: #70ff57;
    --gradient: linear-gradient(135deg, #39ff14 0%, #00bc00 100%);
    --shadow: 0 0 20px rgba(57, 255, 20, 0.3), 0 0 40px rgba(57, 255, 20, 0.1);
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --accent-blue: #2563eb;
    --accent-light: #60a5fa;
    --gradient: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.5s ease;
}

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

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

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

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-pulse { animation: pulse 2s infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

@keyframes pulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
    70% { transform: scale(1.05); box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
    100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

.animate-fade-in-up { animation: fadeInUp 0.8s ease-out forwards; }
.animate-pulse { animation: pulse 2s infinite; }

.delay-100 { animation-delay: 0.1s; }
.delay-200 { animation-delay: 0.2s; }
.delay-300 { animation-delay: 0.3s; }
.delay-400 { animation-delay: 0.4s; }
.delay-500 { animation-delay: 0.5s; }

/* ====================
   NAVIGATION
   ==================== */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 1000;
    padding: 1.25rem 0;
    transition: var(--transition);
    animation: slideDown 0.5s ease-out;
}

[data-theme="light"] nav {
    background: rgba(255, 255, 255, 0.9);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

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

.nav-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    opacity: 0.8;
}

.nav-links a:hover, .nav-links a.active {
    opacity: 1;
    color: var(--accent-blue);
}

/* ====================
   THEME TOGGLE (Fixed Units)
   ==================== */
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid rgba(255,255,255,0.1);
    width: 60px;
    height: 32px;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 4px;
    transition: var(--transition);
}

.theme-toggle-switch {
    width: 24px;
    height: 24px;
    background: var(--gradient);
    border-radius: 50%;
    position: absolute;
    left: 4px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] .theme-toggle-switch {
    transform: translateX(28px);
}

.theme-icon {
    position: absolute;
    font-size: 0.8rem;
    z-index: 1;
    pointer-events: none;
    transition: var(--transition);
}

.sun { left: 8px; color: #fbbf24; opacity: 0; }
.moon { right: 8px; color: #fbbf24; opacity: 1; }

[data-theme="light"] .sun { opacity: 1; }
[data-theme="light"] .moon { opacity: 0; }

/* ====================
   SECTIONS
   ==================== */
section {
    padding: 100px 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 3rem;
    text-align: center;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ====================
   HERO / ABOUT
   ==================== */
.hero-section .container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.profile-section {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 24px;
    text-align: center;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    margin: 0 auto 2rem;
    overflow: hidden;
    border: 4px solid var(--accent-blue);
}

.profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-section h1 { font-size: 1.75rem; margin-bottom: 0.5rem; }
.profile-section .title { color: var(--accent-light); font-weight: 600; margin-bottom: 1.5rem; }

.social-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1.5rem 0;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.social-icon:hover {
    background: var(--accent-blue);
    color: white;
    transform: translateY(-3px);
}

.contact-info {
    text-align: left;
    border-top: 1px solid rgba(255,255,255,0.05);
    padding-top: 1.5rem;
    margin-top: 1.5rem;
}

.contact-info p {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.contact-info i { color: var(--accent-blue); width: 16px; }

.download-cv {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--accent-blue);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    margin-top: 1.5rem;
    transition: var(--transition);
}

.download-cv:hover { transform: translateY(-2px); box-shadow: var(--shadow); }

.intro-text { font-size: 1.15rem; color: var(--text-secondary); margin-bottom: 2rem; }

.info-section {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.info-item .info-label { font-size: 0.85rem; color: var(--text-secondary); display: block; }
.info-item .info-value { font-weight: 600; }
.info-item .available { color: #10b981; }

/* ====================
   SKILLS
   ==================== */
.skills-container { display: grid; gap: 4rem; }
.skills-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); 
    gap: 2rem; 
}

.skill-card {
    background: var(--bg-secondary);
    padding: 2rem;
    border-radius: 20px;
    text-align: center;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.03);
}

.skill-card:hover { transform: translateY(-10px); border-color: var(--accent-blue); }
.skill-card i { font-size: 2.5rem; color: var(--accent-blue); margin-bottom: 1rem; }

.skill-bar { width: 100%; height: 6px; background: var(--bg-primary); border-radius: 10px; margin-top: 1rem; }
.skill-progress { height: 100%; background: var(--gradient); width: 0; transition: width 1.5s ease; }

.skills-chart-container {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 24px;
}

.pie-chart-layout { display: flex; align-items: center; justify-content: center; gap: 4rem; flex-wrap: wrap; }

/* ====================
   PROJECTS
   ==================== */
.projects-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); 
    gap: 2.5rem; 
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 20px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid rgba(255,255,255,0.05);
}

.project-card:hover { transform: translateY(-10px); box-shadow: var(--shadow); }

.project-image { 
    width: 100%; 
    height: 200px; 
    overflow: hidden; 
    background: var(--bg-primary);
}

.project-image img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
    transition: transform 0.5s ease;
}

.project-card:hover .project-image img { transform: scale(1.1); }

.project-content { padding: 1.5rem; }
.project-content h3 { margin-bottom: 0.75rem; }
.project-content p { color: var(--text-secondary); font-size: 0.95rem; margin-bottom: 1.5rem; }

.tech-tags { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.tech-tag { 
    font-size: 0.75rem; 
    font-weight: 600; 
    padding: 0.4rem 0.8rem; 
    background: rgba(37, 99, 235, 0.1); 
    color: var(--accent-light); 
    border-radius: 20px; 
}

.project-links a { 
    text-decoration: none; 
    color: var(--accent-blue); 
    font-weight: 600; 
    display: inline-flex; 
    align-items: center; 
    gap: 0.5rem; 
    transition: var(--transition);
}

.demo-link {
    margin-left: 1rem;
    padding: 0.4rem 1rem;
    border: 1px solid var(--accent-blue);
    border-radius: 20px;
    font-size: 0.85rem;
}

.demo-link:hover {
    background: var(--accent-blue);
    color: white !important;
}

/* ====================
   CONTACT FORM
   ==================== */
.contact-container {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
}

.contact-details { display: flex; flex-direction: column; gap: 2rem; }
.contact-detail-item { display: flex; gap: 1.5rem; }
.contact-detail-icon { 
    width: 50px; 
    height: 50px; 
    background: var(--bg-secondary); 
    border-radius: 12px; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    color: var(--accent-blue); 
    font-size: 1.25rem;
}

.contact-form {
    background: var(--bg-secondary);
    padding: 3rem;
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 1.5rem; }
.form-group { margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }

.form-group label { font-size: 0.9rem; font-weight: 600; color: var(--text-secondary); }

.form-group input, .form-group textarea {
    background: var(--bg-primary);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-primary);
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.contact-submit {
    width: 100%;
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.form-note { margin-top: 1rem; text-align: center; font-size: 0.9rem; font-weight: 500; }
.form-note.success { color: #10b981; }
.form-note.error { color: #ef4444; }

/* ====================
   FOOTER
   ==================== */
footer {
    padding: 4rem 2rem;
    background: var(--bg-secondary);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-links { display: flex; justify-content: center; gap: 2.5rem; margin-bottom: 2.5rem; flex-wrap: wrap; }
.footer-links a { text-decoration: none; color: var(--text-secondary); transition: var(--transition); }
.footer-links a:hover { color: var(--accent-blue); }

.copyright { opacity: 0.6; font-size: 0.9rem; }

/* ====================
   MOBILE RESPONSIVE
   ==================== */
@media (max-width: 1024px) {
    .hero-section .container, .contact-container { grid-template-columns: 1fr; gap: 3rem; }
    .profile-section { position: static; max-width: 500px; margin: 0 auto; }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: 0; left: 0; width: 100%; height: 100vh;
        background: var(--bg-primary);
        flex-direction: column;
        justify-content: center;
        padding: 2rem;
    }
    .nav-links.active { display: flex; }
    .mobile-menu-toggle { display: block; background: none; border: none; font-size: 1.5rem; color: var(--text-primary); cursor: pointer; }
    .form-row { grid-template-columns: 1fr; }
    .section-title { font-size: 2rem; }
}

/* Timeline */
.timeline { position: relative; padding: 2rem 0; }
.timeline::before { content: ''; position: absolute; left: 50%; width: 2px; height: 100%; background: var(--accent-blue); }
.timeline-item { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-bottom: 4rem; }
.timeline-item:nth-child(even) { flex-direction: row-reverse; }
.timeline-content { width: 45%; background: var(--bg-secondary); padding: 2rem; border-radius: 20px; position: relative; }
.timeline-icon { 
    position: absolute; left: 50%; transform: translateX(-50%); 
    width: 40px; height: 40px; background: var(--gradient); 
    border-radius: 50%; display: flex; align-items: center; 
    justify-content: center; color: white; z-index: 10;
}

@media (max-width: 768px) {
    .timeline::before { left: 20px; }
    .timeline-item { justify-content: flex-start; }
    .timeline-item:nth-child(even) { flex-direction: row; }
    .timeline-content { width: calc(100% - 60px); margin-left: 60px; }
    .timeline-icon { left: 20px; }
}
