/* Base styles */
body {
    background: #050816;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* ============================================ */
/* HOMEPAGE IMPROVEMENTS */
/* ============================================ */

/* Section titles */
.section-title {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

.section-title:after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #3b82f6, transparent);
    border-radius: 3px;
}

/* Sticky navbar */
.sticky-top {
    backdrop-filter: blur(10px);
}

/* Card improvements for homepage */
.card {
    transition: all 0.3s ease;
    overflow: hidden;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-img-top {
    transition: transform 0.3s ease;
}

.card:hover .card-img-top {
    transform: scale(1.02);
}

/* Button improvements */
.btn-outline-primary {
    border-color: #3b82f6;
    color: #60a5fa;
}

.btn-outline-primary:hover {
    background-color: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

/* Badge styling */
.badge {
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 20px;
}

/* Footer */
footer {
    background: rgba(0, 0, 0, 0.3);
}

footer a:hover {
    color: #60a5fa !important;
}

/* Improved text justification */
.about-text {
    text-align: justify;
    text-justify: inter-word; /* Better word spacing for justification */
    hyphens: auto; /* Allows hyphenation for better justification */
    word-spacing: normal;
    letter-spacing: normal;
}

/* Alternative: For better readability on web, consider using 'auto' instead of justify */
/* .about-text {
    text-align: left;
    max-width: 65ch;
    margin-left: auto;
    margin-right: auto;
} */

/* Figure captions */
figcaption {
    font-size: 0.9rem;
    color: #d0d0d0;
    font-style: italic;
    text-align: center;
    margin-top: 8px;
}

/* Media elements */
video, img {
    border-radius: 8px;
    max-width: 100%;
    height: auto;
    display: block; /* Prevents inline spacing issues */
}

/* Profile photo */
.profile-photo {
    width: 280px;
    max-width: 80%;
    border-radius: 50%; /* Makes it circular - change to 8px for rounded corners */
    object-fit: cover;
    aspect-ratio: 1 / 1;
}

/* Timeline styles - Enhanced */
.timeline {
    border-left: 3px solid #3b82f6; /* Blue accent instead of gray */
    margin-left: 30px;
    padding-left: 30px;
    position: relative;
}

.timeline-item {
    position: relative;
    margin-bottom: 40px;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -39px;
    top: 6px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #3b82f6; /* Matching accent color */
    border: 2px solid #050816;
    box-shadow: 0 0 0 2px #3b82f6;
    transition: all 0.3s ease;
}

.timeline-item:hover::before {
    transform: scale(1.2);
    background: #60a5fa;
}

.timeline-year {
    font-size: 1.4rem;
    font-weight: bold;
    color: #60a5fa; /* Brighter blue for visibility */
    margin-bottom: 12px;
    font-family: monospace;
}

.timeline-entry {
    margin-bottom: 20px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.timeline-entry:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(5px);
}

.timeline-entry em {
    font-size: 1.05rem;
    color: #cbd5e1;
    font-style: italic;
}

.timeline-entry strong {
    display: block;
    color: #f1f5f9;
    font-weight: 600;
    margin-bottom: 5px;
    font-size: 1rem;
}

/* Additional useful styles */

/* Headings */
h1, h2, h3, h4, h5, h6 {
    color: #f8f9fa;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
    line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 {
    font-size: 2rem;
    border-bottom: 2px solid #3b82f6;
    padding-bottom: 10px;
    display: inline-block;
}
h3 { font-size: 1.5rem; }

/* Links */
a {
    color: #60a5fa;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Buttons */
.button, button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.button:hover, button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

/* Cards / Paper entries */
.card, .paper-entry {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.card:hover, .paper-entry:hover {
    background: rgba(255, 255, 255, 0.08);
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Grid layouts */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin: 24px 0;
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        font-size: 16px;
    }
    
    .timeline {
        margin-left: 20px;
        padding-left: 20px;
    }
    
    .timeline-item::before {
        left: -29px;
    }
    
    h1 { font-size: 2rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.25rem; }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* Code blocks */
code, pre {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
    font-family: 'Courier New', monospace;
}

pre {
    padding: 16px;
    overflow-x: auto;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Selection color */
::selection {
    background: #3b82f6;
    color: white;
}

/* Scrollbar styling */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: #1e293b;
}

::-webkit-scrollbar-thumb {
    background: #3b82f6;
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #60a5fa;
}

//* ============================================ */
/* CONTACT PAGE CARD STYLES - OPTIMAL SOLUTION */
/* ============================================ */

/* Card base styling */
.card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

/* Card text colors */
.card-body {
    color: #e2e8f0;
    padding: 1.5rem;
}

.card-body strong {
    color: #ffffff;
    font-weight: 600;
}

/* Card titles */
.card-title {
    color: #60a5fa !important;
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

/* Address styling */
.card-body address {
    color: #e2e8f0;
    font-style: normal;
    line-height: 1.8;
    margin-bottom: 0;
}

/* Email links */
.card-body a:not(.btn) {
    color: #60a5fa;
    word-break: break-all;
    text-decoration: none;
    transition: color 0.3s ease;
}

.card-body a:not(.btn):hover {
    color: #93c5fd;
    text-decoration: underline;
}

/* Alert/office hours styling */
.alert {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    color: #cbd5e1;
}

.alert h6 {
    color: #60a5fa;
    margin-bottom: 8px;
}

/* Remove bg-dark class interference if accidentally added */
.card.bg-dark,
.card.bg-dark .card-body {
    background: transparent;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .card-body {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
}

/* ============================================ */
/* PUBLICATIONS PAGE IMPROVEMENTS */
/* ============================================ */

/* Compact paper entries */
.paper-entry {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 12px;
    transition: all 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.paper-entry:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateX(4px);
    border-color: rgba(59, 130, 246, 0.3);
}

/* Badge styling */
.badge {
    font-weight: 500;
    padding: 4px 10px;
    font-size: 0.75rem;
    border-radius: 20px;
}

.badge-primary {
    background: #3b82f6;
}

.badge-info {
    background: #06b6d4;
}

.badge-warning {
    background: #f59e0b;
    color: #1e293b;
}

.badge-success {
    background: #10b981;
}

.badge-secondary {
    background: #475569;
}

/* Metric cards */
.metric-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-3px);
}

.metric-card h3 {
    font-size: 2rem;
    font-weight: bold;
    color: #60a5fa;
    margin-bottom: 5px;
    margin-top: 0;
}

/* Author and journal text */
.authors {
    color: #cbd5e1;
    font-size: 0.9rem;
    line-height: 1.4;
}

.journal {
    color: #94a3b8;
    font-size: 0.85rem;
    font-style: italic;
}

/* Search input */
.form-control:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 0.2rem rgba(59, 130, 246, 0.25);
    outline: none;
}

/* Button group improvements */
.btn-group .btn-primary {
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(59, 130, 246, 0.3);
    color: #60a5fa;
}

.btn-group .btn-primary.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.btn-group .btn-primary:hover {
    background: #2563eb;
    color: white;
}

.btn-outline-secondary {
    border-color: #475569;
    color: #94a3b8;
}

.btn-outline-secondary.active {
    background: #475569;
    border-color: #475569;
    color: white;
}

.btn-outline-secondary:hover {
    background: #334155;
    border-color: #334155;
    color: white;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .paper-entry {
        padding: 12px 15px;
    }
    
    .metric-card h3 {
        font-size: 1.5rem;
    }
    
    .btn-group {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .btn-group .btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .paper-entry h5 {
        font-size: 0.95rem;
    }
    
    .authors, .journal {
        font-size: 0.8rem;
    }
}

/* Hover effect for paper titles */
.hover-primary:hover {
    color: #60a5fa !important;
}
/* ============================================ */
/* METRICS CARDS STYLES */
/* ============================================ */

/* Metrics counter styling */
#pubs, #firstauthor, #manyauthors, #citations, #hindex, #i10index {
    font-size: 3rem;
    font-weight: bold;
    color: #60a5fa;
    margin-bottom: 10px;
}

.metric-card {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.06);
    transform: translateY(-3px);
}

/* ============================================ */
/* FOOTER STYLES (if needed) */
/* ============================================ */

footer {
    background: rgba(0, 0, 0, 0.3);
    padding: 20px 0;
    margin-top: 40px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.9rem;
}

/* ============================================ */
/* UTILITY CLASSES */
/* ============================================ */

.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }
.mt-5 { margin-top: 2rem; }

.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }
.mb-5 { margin-bottom: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.w-100 { width: 100%; }

/* Responsive font sizes for metrics */
@media (max-width: 768px) {
    #pubs, #firstauthor, #manyauthors, #citations, #hindex, #i10index {
        font-size: 2rem;
    }
    
    .btn-outline-primary, .btn-danger {
        font-size: 0.9rem;
        padding: 8px 12px;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
}

/* Print styles (optional) */
@media print {
    body {
        background: white;
        color: black;
    }
    
    .card, .paper-entry {
        background: white;
        border: 1px solid #ddd;
        page-break-inside: avoid;
    }
    
    a {
        color: black;
        text-decoration: underline;
    }
    
    .btn, button {
        display: none;
    }
}
/* ============================================ */
/* METRICS CARDS - OPTIMAL VISIBILITY */
/* ============================================ */
/* This section is safe to add - no conflicts with existing styles */

.metric-card {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    padding: 20px 15px;
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.metric-card:hover {
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    border-color: rgba(59, 130, 246, 0.4);
}

.metric-card h3 {
    font-size: 2.2rem;
    font-weight: bold;
    color: #60a5fa !important;  /* Added !important to override any generic h3 rules */
    margin-bottom: 8px;
    margin-top: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

.metric-card p {
    color: #f1f5f9 !important;  /* Added !important for guaranteed visibility */
    margin-bottom: 0;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.5px;
}

/* Responsive */
@media (max-width: 768px) {
    .metric-card h3 {
        font-size: 1.6rem;
    }
    .metric-card p {
        font-size: 0.8rem;
    }
}
.text-muted {
    color: #cbd5e1 !important;
}
