/* --- RESET & VARIABLES --- */
:root {
    --primary: #00ff88;
    --primary-dim: rgba(0, 255, 136, 0.1);
    --secondary: #00ccff;
    --accent: #7000ff;
    --dark: #0a0a0a;
    --darker: #050505;
    --card-bg: rgba(20, 20, 20, 0.7);
    --text-light: #f0f0f0;
    --text-gray: #a0a0a0;
    --border: rgba(255, 255, 255, 0.08);
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --nav-height: 80px;
    --font-main: 'Inter', sans-serif;
    --font-code: 'Fira Code', monospace;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-main);
    line-height: 1.6;
    background-color: var(--dark);
    color: var(--text-light);
    overflow-x: hidden;
    background-image: 
        radial-gradient(circle at 15% 50%, var(--primary-dim) 0%, transparent 25%),
        radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.03) 0%, transparent 25%);
    transition: background-color 0.3s, color 0.3s;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.2; color: var(--text-light); }
h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); letter-spacing: -1px; }
h2 { font-size: clamp(2rem, 4vw, 3rem); letter-spacing: -0.5px; }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.8rem); }
p { margin-bottom: 1rem; color: var(--text-gray); font-size: 1.05rem; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
ul { list-style: none; }

/* --- UTILITY CLASSES --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.btn {
    display: inline-block; background: var(--primary); color: var(--dark); padding: 0.9rem 2.2rem;
    border-radius: 50px; font-weight: 700; border: none; cursor: pointer; font-size: 1rem;
    transition: var(--transition); position: relative; overflow: hidden; z-index: 1;
}
.btn::before {
    content: ''; position: absolute; top: 0; left: 0; width: 0; height: 100%;
    background: var(--secondary); transition: var(--transition); z-index: -1;
}
.btn:hover::before { width: 100%; }
.btn:hover { transform: translateY(-3px); box-shadow: 0 10px 20px var(--primary-dim); }

.btn-outline { background: transparent; border: 2px solid var(--primary); color: var(--primary); margin-left: 1rem; }
.btn-outline:hover { background: var(--primary-dim); color: var(--primary); }

.text-gradient {
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}

/* --- HEADER & NAV --- */
#header {
    position: fixed; top: 0; width: 100%; height: var(--nav-height);
    background: var(--card-bg); backdrop-filter: blur(15px); z-index: 1000;
    border-bottom: 1px solid var(--border); display: flex; align-items: center; transition: background 0.3s;
}
.nav-container { display: flex; justify-content: space-between; align-items: center; width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.logo { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.5px; display: flex; align-items: center; gap: 5px; }
.logo span:first-child { color: var(--primary); }
.navbar-menu { display: flex; gap: 2.5rem; }
.navbar-menu a { font-weight: 500; font-size: 0.95rem; position: relative; opacity: 0.8; color: var(--text-light); }
.navbar-menu a::after { content: ''; position: absolute; bottom: -5px; left: 0; width: 0; height: 2px; background: var(--primary); transition: var(--transition); }
.navbar-menu a:hover { opacity: 1; color: var(--primary); }
.navbar-menu a:hover::after { width: 100%; }
.menu-toggle { display: none; font-size: 1.5rem; cursor: pointer; color: var(--text-light); }

/* --- MOBILE BOTTOM NAV --- */
.mobile-bottom-nav {
    display: none; position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
    background: var(--card-bg); backdrop-filter: blur(15px); border-top: 1px solid var(--border);
    z-index: 1001; justify-content: space-around; align-items: center; padding-bottom: env(safe-area-inset-bottom); transition: background 0.3s;
}
.mobile-bottom-nav .nav-item { color: var(--text-gray); font-size: 1.3rem; padding: 10px; cursor: pointer; transition: var(--transition); display: flex; align-items: center; justify-content: center; flex: 1; height: 100%; }
.mobile-bottom-nav .nav-item:hover, .mobile-bottom-nav .nav-item.active { color: var(--primary); }

/* --- HERO SECTION --- */
#home { padding-top: calc(var(--nav-height) + 5rem); padding-bottom: 6rem; min-height: 100vh; display: flex; align-items: center; position: relative; }
.hero-wrapper { display: flex; align-items: center; gap: 4rem; flex-direction: row; }
.hero-content { flex: 1.2; }
.hero-badges-container { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 1.5rem; }
.hero-badge {
    display: inline-flex; align-items: center; gap: 8px; background: var(--primary-dim); border: 1px solid rgba(255, 255, 255, 0.1);
    border-left: 3px solid var(--primary); padding: 6px 16px; border-radius: 4px; color: var(--primary); font-weight: 600; font-size: 0.85rem; transition: var(--transition);
}
.hero-badge:hover { transform: translateY(-2px); background: rgba(255,255,255,0.05); }
.github-badge-img { height: 26px; border-radius: 4px; transition: var(--transition); }
.github-badge-img:hover { transform: translateY(-2px); }

/* --- WEATHER WIDGET --- */
.weather-widget {
    display: inline-flex; align-items: center; gap: 15px; background: var(--card-bg); border: 1px solid var(--border);
    padding: 10px 18px; border-radius: 50px; margin-bottom: 1.5rem; font-size: 0.9rem; color: var(--text-light);
    backdrop-filter: blur(10px); box-shadow: 0 4px 15px rgba(0,0,0,0.1); animation: fadeIn 0.8s ease-out;
}
.weather-location { font-weight: 700; color: var(--primary); display: flex; align-items: center; gap: 6px; }
.weather-info { display: flex; align-items: center; gap: 12px; border-left: 1px solid var(--border); padding-left: 12px; }
.weather-item { display: flex; align-items: center; gap: 6px; }

.hero-title { margin-bottom: 1.5rem; }
.hero-description { font-size: 1.15rem; max-width: 600px; margin-bottom: 2.5rem; line-height: 1.7; }
.hero-stats { display: flex; gap: 3rem; margin-top: 3.5rem; padding-top: 2rem; border-top: 1px solid var(--border); }
.stat-item h3 { color: var(--primary); margin-bottom: 0.2rem; font-size: 2rem; }
.stat-item p { font-size: 0.9rem; color: var(--text-gray); }

.hero-image { flex: 0.8; display: flex; justify-content: center; position: relative; }
.profile-photo {
    width: 100%; max-width: 380px; aspect-ratio: 1/1; border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    object-fit: cover; object-position: top center; transform: translateY(-20px); 
    border: 2px solid var(--primary-dim); box-shadow: 0 0 60px var(--primary-dim); animation: morph 8s ease-in-out infinite; background: #111;
}

@keyframes morph {
    0% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
    50% { border-radius: 70% 30% 30% 70% / 70% 70% 30% 30%; }
    100% { border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%; }
}

/* --- FLOATING MESSAGES --- */
.hero-msg-bubble {
    position: absolute; background: rgba(15, 15, 15, 0.9); backdrop-filter: blur(10px);
    border: 1px solid var(--border); border-left: 3px solid var(--primary); border-radius: 8px;
    padding: 8px 12px; max-width: 180px; box-shadow: 0 5px 15px rgba(0,0,0,0.5); z-index: 100; font-size: 0.8rem;
    cursor: grab; user-select: none; touch-action: none; transition: border-color 0.3s;
}
.hero-msg-bubble:active { cursor: grabbing; border-color: var(--secondary); }
.hero-msg-bubble strong { color: var(--primary); display: block; font-size: 0.7rem; margin-bottom: 2px; text-transform: uppercase; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-msg-bubble p { margin: 0; color: #eee; line-height: 1.25; font-size: 0.8rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* --- SECTIONS --- */
section { padding: 6rem 0; }
.section-header { text-align: center; margin-bottom: 4rem; }
.section-subtitle { color: var(--primary); text-transform: uppercase; letter-spacing: 2px; font-size: 0.85rem; font-weight: 700; display: block; margin-bottom: 0.5rem; }
.section-title { position: relative; display: inline-block; }

/* --- BLOG SECTION --- */
.blog-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.blog-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; display: flex; flex-direction: row; transition: var(--transition); cursor: pointer; }
.blog-card:hover { border-color: var(--secondary); transform: translateY(-5px); }
.vote-section { background: rgba(0,0,0,0.2); padding: 1rem 0.5rem; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 50px; border-right: 1px solid var(--border); }
.vote-btn { background: none; border: none; color: var(--text-gray); font-size: 1.2rem; cursor: pointer; padding: 5px; transition: 0.2s; }
.vote-btn:hover { color: var(--primary); background: rgba(255,255,255,0.05); border-radius: 4px; }
.vote-btn.upvoted { color: #ff4500; } 
.vote-btn.downvoted { color: #7193ff; }
.vote-count { font-weight: 700; font-size: 0.9rem; margin: 5px 0; color: var(--text-light); }
.blog-content { padding: 1.5rem; flex: 1; display: flex; flex-direction: column; position: relative; }
.blog-meta { font-size: 0.75rem; color: var(--text-gray); margin-bottom: 0.5rem; display: flex; align-items: center; gap: 10px; }
.blog-title { font-size: 1.3rem; margin-bottom: 0.3rem; line-height: 1.3; }
.blog-subtitle { font-size: 0.9rem; color: var(--primary); margin-bottom: 1rem; font-weight: 500; }
.blog-image { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 1rem; border: 1px solid var(--border); background: #111; }
.blog-text-preview { font-size: 0.95rem; color: var(--text-gray); line-height: 1.6; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; text-overflow: ellipsis; }

/* --- READ FULL POST MODAL --- */
#readPostModal .modal-content { width: 95%; max-width: 900px; height: 90vh; padding: 0; overflow: hidden; display: flex; flex-direction: column; text-align: left; background: var(--darker); }
.read-modal-body { padding: 2rem; overflow-y: auto; height: 100%; }
.read-modal-image { width: 100%; max-height: 400px; object-fit: cover; border-radius: 8px; margin: 1rem 0; border: 1px solid var(--border); }
.read-modal-text { font-size: 1rem; line-height: 1.8; color: var(--text-light); }
.read-modal-text img { max-width: 100%; height: auto; border-radius: 8px; }
.read-modal-text pre { background: var(--dark); padding: 1rem; border-radius: 8px; overflow-x: auto; border: 1px solid var(--border); }

/* --- QUILL OVERRIDES --- */
.ql-toolbar.ql-snow { background: #e0e0e0; border-color: var(--border) !important; border-radius: 8px 8px 0 0; }
.ql-container.ql-snow { border-color: var(--border) !important; border-radius: 0 0 8px 8px; background: rgba(0,0,0,0.3); color: var(--text-light); font-family: var(--font-main); font-size: 1rem; }
.ql-editor { min-height: 150px; }

/* --- ACHIEVEMENTS --- */
.achievements-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; }
.achievement-card { background: linear-gradient(145deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0.01) 100%); border: 1px solid var(--border); padding: 2rem; border-radius: 16px; position: relative; transition: var(--transition); }
.achievement-card::before { content: ''; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: var(--primary); border-radius: 4px 0 0 4px; }
.achievement-card:hover { transform: translateY(-5px); background: rgba(255,255,255,0.05); border-color: var(--primary); }
.achievement-icon { font-size: 2rem; color: var(--secondary); margin-bottom: 1rem; }
.achievement-highlight { color: var(--primary); font-weight: 600; font-size: 0.9rem; }

/* --- SKILLS --- */
.skills-content { display: grid; grid-template-columns: 1fr 1.5fr; gap: 4rem; align-items: center; }
.skills-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 1.2rem; }
.skill-card { background: var(--card-bg); border: 1px solid var(--border); padding: 1.2rem; border-radius: 12px; text-align: center; transition: var(--transition); display: flex; flex-direction: column; align-items: center; justify-content: center; height: 120px; }
.skill-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: 0 5px 15px var(--primary-dim); }
.skill-icon { font-size: 2rem; margin-bottom: 0.8rem; background: -webkit-linear-gradient(var(--primary), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }

/* --- TIMELINE --- */
.timeline { position: relative; max-width: 900px; margin: 0 auto; }
.timeline::after { content: ''; position: absolute; width: 2px; background: linear-gradient(to bottom, var(--primary), var(--secondary), transparent); top: 0; bottom: 0; left: 50%; margin-left: -1px; }
.timeline-item { padding: 10px 50px; position: relative; width: 50%; }
.left { left: 0; text-align: right; }
.right { left: 50%; text-align: left; }
.timeline-item::after { content: ''; position: absolute; width: 14px; height: 14px; background: var(--dark); border: 3px solid var(--primary); top: 28px; border-radius: 50%; z-index: 2; box-shadow: 0 0 10px var(--primary); }
.left::after { right: -7px; }
.right::after { left: -7px; }
.timeline-content { padding: 25px; background: var(--card-bg); border-radius: 12px; border: 1px solid var(--border); position: relative; transition: var(--transition); }
.timeline-content:hover { border-color: var(--secondary); transform: scale(1.02); box-shadow: 0 10px 30px rgba(0,0,0,0.5); }
.timeline-date { display: inline-block; color: var(--primary); font-size: 0.85rem; font-weight: 700; margin-bottom: 0.5rem; text-transform: uppercase; }
.timeline-content ul { text-align: left; padding-left: 15px; margin-top: 10px; }
.left .timeline-content ul { direction: rtl; text-align: right; padding-right: 15px; padding-left: 0; }
.timeline-content li { font-size: 0.9rem; margin-bottom: 6px; color: var(--text-gray); list-style-type: none; position: relative; }
.right .timeline-content li::before { content: '▹'; color: var(--primary); position: absolute; left: -15px; }
.left .timeline-content li::after { content: '◃'; color: var(--primary); position: absolute; right: -15px; }

/* --- PROJECTS --- */
.projects-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2rem; }
.project-card { background: var(--card-bg); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; transition: var(--transition); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.project-card.featured { grid-column: span 1; border-color: var(--primary); background: linear-gradient(160deg, var(--primary-dim) 0%, rgba(10,10,10,0.8) 100%); }

@media (min-width: 992px) {
    .project-card.featured { grid-column: span 2; display: flex; flex-direction: row; align-items: center; gap: 2rem; }
    .project-card.featured .project-content { flex: 1; }
    .project-card.featured .project-visual { flex: 0.8; height: 100%; min-height: 250px; background: rgba(0,0,0,0.3); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 4rem; color: var(--primary); }
}

.project-card:hover { transform: translateY(-8px); border-color: var(--secondary); box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4); }
.project-icon { font-size: 2rem; color: var(--primary); margin-bottom: 1rem; }
.tech-tags { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.5rem; }
.tech-tags span { background: rgba(255, 255, 255, 0.05); padding: 5px 12px; border-radius: 20px; font-size: 0.75rem; color: var(--text-light); border: 1px solid rgba(255,255,255,0.05); }
.project-links { display: flex; gap: 1rem; margin-top: auto; }
.link-btn { font-size: 0.9rem; font-weight: 600; color: var(--primary); display: flex; align-items: center; gap: 5px; }

/* --- COMMUNITY --- */
#community-stats { background: linear-gradient(to top, var(--dark), var(--darker)); position: relative; padding-bottom: 0; }
.discussion-form-card { background: var(--card-bg); padding: 1.5rem; border-radius: 12px; border: 1px solid var(--border); box-shadow: 0 10px 30px rgba(0,0,0,0.3); margin-bottom: 2rem; }
.discussion-form-card input, .discussion-form-card textarea { background: rgba(0,0,0,0.2); border: 1px solid rgba(255,255,255,0.1); margin-bottom: 0.8rem; }
.messages-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; margin-top: 2rem; }
.message-card { background: rgba(255,255,255,0.03); border: 1px solid var(--border); padding: 1.5rem; border-radius: 12px 12px 12px 0; position: relative; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.message-card p { font-size: 0.95rem; color: var(--text-light); margin-bottom: 0.5rem; }

/* --- CONTACT --- */
#contact { background: linear-gradient(to top, var(--darker), var(--dark)); padding: 6rem 0 2rem; border-top: 1px solid var(--border); }
.footer-wrapper { display: grid; grid-template-columns: 1fr 1fr; gap: 5rem; }
.contact-card { background: var(--card-bg); padding: 2.5rem; border-radius: 20px; border: 1px solid var(--border); }
input, textarea { width: 100%; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--border); padding: 1rem 1.2rem; border-radius: 8px; color: white; font-family: inherit; outline: none; transition: var(--transition); margin-bottom: 1rem; }
input:focus, textarea:focus { border-color: var(--primary); background: rgba(0, 255, 136, 0.02); box-shadow: 0 0 10px var(--primary-dim); }
.social-links { display: flex; gap: 1rem; margin-top: 2rem; }
.social-btn { width: 45px; height: 45px; border-radius: 50%; background: rgba(255,255,255,0.05); display: flex; align-items: center; justify-content: center; border: 1px solid rgba(255,255,255,0.1); }
.social-btn:hover { background: var(--primary); color: var(--dark); transform: translateY(-5px); }
.footer-bottom { margin-top: 5rem; padding-top: 2rem; border-top: 1px solid var(--border); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 1.5rem; text-align: center; }

/* --- RESPONSIVE --- */
@media screen and (max-width: 992px) {
    .hero-wrapper { flex-direction: column-reverse; text-align: center; gap: 3rem; }
    .hero-stats { justify-content: center; }
    .skills-content { grid-template-columns: 1fr; text-align: center; }
    .footer-wrapper { grid-template-columns: 1fr; gap: 3rem; }
}

@media screen and (max-width: 768px) {
    .menu-toggle { display: none !important; }
    .navbar-menu, .theme-toggle-btn { display: none !important; }
    .mobile-bottom-nav { display: flex; }
    #contact { padding-bottom: 6rem; }
    .blog-card { flex-direction: column; }
    .vote-section { flex-direction: row; border-right: none; border-top: 1px solid var(--border); width: 100%; }
    .timeline::after { left: 31px; } 
    .timeline-item { width: 100%; padding-left: 70px; padding-right: 20px; }
    .right { left: 0; }
    .timeline-item::after { left: 24px; }
    .left, .right { text-align: left; }
    .left .timeline-content ul { direction: ltr; text-align: left; padding-left: 15px; }
}

/* Floating UI */
.whatsapp-float { position: fixed; bottom: 30px; right: 30px; width: 60px; height: 60px; background: #25D366; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 2rem; box-shadow: 0 5px 20px rgba(37, 211, 102, 0.4); cursor: pointer; z-index: 900; transition: var(--transition); }
.like-float-btn { position: fixed; bottom: 30px; left: 30px; display: flex; align-items: center; gap: 10px; z-index: 900; background: var(--card-bg); backdrop-filter: blur(5px); padding: 8px 16px 8px 8px; border-radius: 50px; border: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.9); z-index: 2000; align-items: center; justify-content: center; backdrop-filter: blur(8px); }
.modal-content { background: var(--darker); padding: 2.5rem; border-radius: 16px; width: 90%; max-width: 400px; border: 1px solid var(--border); text-align: center; position: relative; }
.theme-panel { position: fixed; top: 100px; right: -360px; width: 340px; background: var(--darker); backdrop-filter: blur(15px); border-radius: 0 0 0 12px; border: 1px solid var(--border); z-index: 998; padding: 1.5rem; transition: 0.4s; }
.theme-panel.active { right: 0; }