/* V2 Professional Elite Researcher Redesign */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

:root {
    /* Color Palette - Deep Elite Dark Mode */
    --bg-body: #05070a;
    --bg-sidebar: rgba(13, 17, 23, 0.8);
    --bg-card: rgba(13, 17, 23, 0.6);
    --text-main: #e6edf3;
    --text-headers: #f0f6fc;
    --text-muted: #8b949e;
    --accent-primary: #58a6ff;
    --accent-secondary: #bc8cff;
    --accent-glow: rgba(88, 166, 255, 0.15);
    --border-subtle: rgba(48, 54, 61, 0.5);

    /* Layout & Spacing */
    --width-sidebar: 300px;
    --width-content: 850px;
    --spacing-unit: 2rem;
    --border-radius: 12px;
    --transition-speed: 0.4s;
    --glass-blur: blur(12px);
}

/* Light Mode Overrides - Apple Inspired Clean */
body.light-mode {
    --bg-body: #f5f7f9;
    --bg-sidebar: rgba(255, 255, 255, 0.8);
    --bg-card: rgba(255, 255, 255, 0.8);
    --text-main: #1f2328;
    --text-headers: #111111;
    --text-muted: #636c76;
    --accent-primary: #0969da;
    --accent-secondary: #8250df;
    --accent-glow: rgba(9, 105, 218, 0.1);
    --border-subtle: rgba(208, 215, 222, 0.5);
}

html {
    scroll-behavior: smooth;
}

/* Custom Minimalist Scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
    border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-primary);
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.8;
    font-size: 16px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color var(--transition-speed);
    overflow-x: hidden;
    /* Prevent horizontal jitter */
    -webkit-font-smoothing: antialiased;
}

img {
    max-width: 100%;
    height: auto;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-headers);
    line-height: 1.2;
    margin-bottom: 1.25rem;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    background: linear-gradient(135deg, var(--text-headers) 0%, var(--accent-primary) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2 {
    font-size: 1.9rem;
    padding-bottom: 0.75rem;
    margin-top: 3.5rem;
    border-bottom: 1px solid var(--border-subtle);
}

h3 {
    font-size: 1.5rem;
    margin-top: 2.5rem;
    color: var(--accent-primary);
}

p {
    margin-bottom: 1.75rem;
}

a {
    color: var(--accent-primary);
    text-decoration: none;
    transition: all var(--transition-speed) ease;
}

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

/* Layout Wrapper */
.wrapper {
    display: flex;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    flex: 1;
}

/* Sidebar Styles */
.sidebar {
    width: var(--width-sidebar);
    background-color: var(--bg-sidebar);
    backdrop-filter: var(--glass-blur);
    padding: 4rem 2.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    z-index: 10;
    overflow-y: auto;
    scrollbar-width: thin;
    /* Firefox */
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    /* Hardware acceleration */
}

/* Minimalist Sidebar Scrollbar (Webkit) */
.sidebar::-webkit-scrollbar {
    width: 3px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: transparent;
}

.sidebar:hover::-webkit-scrollbar-thumb {
    background: var(--border-subtle);
}

.site-title {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.site-title a {
    color: var(--text-headers);
}

.description {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 3rem;
}

/* Profile Image */
.profile-section {
    margin-bottom: 2.5rem;
}

.profile-img {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    object-fit: cover;
    padding: 4px;
    border: 1px solid var(--accent-primary);
    box-shadow: 0 0 30px var(--accent-glow);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed);
}

.profile-img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 0 50px var(--accent-glow);
}

/* Theme Toggle */
.theme-toggle-wrapper {
    margin-bottom: 2rem;
}

.theme-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    color: var(--text-main);
    padding: 0.75rem 1.25rem;
    border-radius: 40px;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all var(--transition-speed);
}

.theme-btn:hover {
    background: var(--accent-primary);
    color: white;
    transform: translateY(-2px);
}

/* Social Links */
.social-links {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.social-links a {
    font-size: 1.5rem;
    color: var(--text-main);
    opacity: 0.7;
    transition: all var(--transition-speed) cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.social-links a:hover {
    color: var(--accent-primary);
    transform: translateY(-5px) scale(1.1);
    opacity: 1;
}

/* Navigation */
.sidebar nav {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar nav a {
    font-family: 'Outfit', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-main);
    padding: 0.8rem 1.2rem;
    border-radius: var(--border-radius);
    transition: all 0.2s ease;
}

.sidebar nav a:hover {
    background: var(--bg-card);
    color: var(--accent-primary);
    padding-left: 1.5rem;
}

.sidebar nav a.active {
    background: var(--accent-primary);
    color: white;
    box-shadow: 0 4px 15px var(--accent-glow);
}

/* Main Content */
.content {
    flex: 1;
    padding: var(--spacing-unit) 5rem;
    max-width: var(--width-content);
}

/* Post List Styling */
.post-list {
    list-style: none !important;
    padding: 0;
    margin: 0;
}

.post-item {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    padding: 2.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-subtle);
    margin-bottom: 2.5rem;
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        box-shadow 0.6s cubic-bezier(0.34, 1.56, 0.64, 1),
        border-color 0.4s ease;
    will-change: transform, box-shadow;
    list-style-type: none !important;
}

.post-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
    border-color: var(--accent-primary);
}

.post-meta {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-secondary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1rem;
    display: block;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 1rem 2.25rem;
    background: linear-gradient(135deg, var(--accent-primary) 0%, var(--accent-secondary) 100%);
    color: white;
    border-radius: 40px;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    box-shadow: 0 10px 20px var(--accent-glow);
    transition: all var(--transition-speed);
    border: none;
    cursor: pointer;
}

.btn:hover {
    transform: scale(1.05) translateY(-3px);
    box-shadow: 0 15px 30px var(--accent-glow);
    color: white;
}

/* Form Styles - Focused & Premium */
form {
    display: flex;
    flex-direction: column;
    gap: 1.75rem;
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    padding: 3.5rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-subtle);
    margin: 2rem auto;
    max-width: 600px;
    /* Centered narrow form */
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
}

form label {
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--accent-primary);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

form input,
form textarea {
    width: 100% !important;
    padding: 1.2rem 1.5rem;
    background: rgba(0, 0, 0, 0.4) !important;
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all var(--transition-speed);
}

body.light-mode form input,
body.light-mode form textarea {
    background: rgba(255, 255, 255, 0.8) !important;
    border-color: rgba(0, 0, 0, 0.1);
    color: #111;
}

form input:focus,
form textarea:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 4px var(--accent-glow);
    background: rgba(0, 0, 0, 0.5);
}

body.light-mode form input:focus,
body.light-mode form textarea:focus {
    background: white;
    border-color: var(--accent-primary);
}

/* Form Feedback Messages */
.form-status {
    display: none;
    padding: 1.25rem;
    border-radius: 12px;
    margin-top: 1.5rem;
    font-size: 0.95rem;
    font-weight: 500;
    text-align: center;
    backdrop-filter: var(--glass-blur);
    animation: fadeIn 0.4s ease;
}

.form-status.success {
    background: rgba(46, 160, 67, 0.1);
    border: 1px solid rgba(46, 160, 67, 0.4);
    color: #3fb950;
    box-shadow: 0 0 20px rgba(46, 160, 67, 0.1);
}

.form-status.success::before {
    content: '✓';
    margin-right: 10px;
    font-weight: 700;
}

.form-status.error {
    background: rgba(248, 81, 73, 0.15);
    border: 1px solid rgba(248, 81, 73, 0.5);
    color: #f85149;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

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

/* Mobile Responsive */
@media (max-width: 1000px) {
    :root {
        --width-sidebar: 100%;
        --width-content: 100%;
    }

    .wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem 1rem;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .sidebar nav {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.5rem;
    }

    .sidebar nav a {
        padding: 0.6rem 1rem;
        font-size: 0.95rem;
    }

    .content {
        padding: 1.5rem 1.5rem;
        max-width: 100%;
    }

    h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 600px) {
    .sidebar {
        padding: 0.75rem 1rem;
    }

    .profile-section {
        margin-bottom: 1rem;
    }

    .profile-img {
        width: 70px;
        height: 70px;
    }

    .site-title {
        font-size: 1.25rem;
        margin-bottom: 0.25rem;
    }

    .description {
        margin-bottom: 0.75rem;
        font-size: 0.75rem;
        line-height: 1.4;
    }

    .social-links {
        gap: 0.5rem;
        margin-bottom: 0.75rem;
    }

    .social-links a {
        font-size: 1.2rem;
    }

    .theme-toggle-wrapper {
        margin-bottom: 0.75rem;
    }

    .theme-btn {
        padding: 0.4rem 0.8rem;
        font-size: 0.75rem;
        gap: 0.5rem;
    }

    .content {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.6rem;
        margin-top: 2.5rem;
    }

    .post-item {
        padding: 1.5rem;
    }

    form {
        padding: 2rem 1.5rem;
    }

    .btn {
        width: 100%;
        text-align: center;
    }
}