/* Base Styles */
:root {
    --primary-color: #3498db;
    --secondary-color: #2ecc71;
    --accent-color: #f1c40f;
    --background-dark: #1a365d;
    --background-light: #2d3e50;
    --text-light: #e0e0e0;
    --text-dark: #333;
    --card-bg-dark: rgba(255, 255, 255, 0.08);
    --card-bg-light: rgba(255, 255, 255, 0.9);
    --transition-speed: 0.3s;
}

.light-theme {
    --primary-color: #2980b9;
    --secondary-color: #27ae60;
    --accent-color: #d35400;
    --background-dark: #f5f5f5;
    --background-light: #ffffff;
    --text-light: #333333;
    --text-dark: #666666;
    --card-bg-dark: rgba(255, 255, 255, 0.9);
    --card-bg-light: rgba(0, 0, 0, 0.05);
}

/* Light theme adjustments */
body.light-theme {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
    color: var(--text-light);
}

/* Carbon-materials background layers, damped for the light theme
   (see shared-styles.css). The sp3 layer keeps its own keyframes so the
   animated opacity does not override the lighter setting. */
body.light-theme::before {
    opacity: 0.10;
}

body.light-theme::after {
    opacity: 0.13;
    animation-name: breatheSp3Light;
}

@keyframes breatheSp3Light {
    0%, 100% { opacity: 0.11; }
    50%      { opacity: 0.19; }
}

.light-theme .container {
    background: rgba(255, 255, 255, 0.7);
}

.light-theme header,
.light-theme .nav-container {
    background: rgba(255, 255, 255, 0.9);
}

.light-theme .bio-card,
.light-theme .project-card,
.light-theme .writings-card,
.light-theme .skill-category,
.light-theme .timeline-content {
    background: var(--card-bg-light);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.light-theme h1 {
    background: linear-gradient(90deg, #2980b9, #27ae60);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.light-theme .social-links a {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-dark);
}

.light-theme .project-features li::before {
    color: var(--primary-color);
}

.light-theme .about-details h3 {
    color: var(--primary-color);
}

.light-theme .about-details h3::before {
    color: var(--primary-color);
}

.light-theme footer {
    background: rgba(245, 245, 245, 0.9);
}

.light-theme .particles-js-canvas-el {
    opacity: 0.3;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--text-light);
    min-height: 100vh;
    overflow-x: hidden;
    transition: background var(--transition-speed);
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    transition: background var(--transition-speed);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
    transition: color var(--transition-speed);
}

h1 {
    font-size: 2.5rem;
    margin-top: 0.5rem;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background var(--transition-speed);
}

h2 {
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
    text-align: center;
}

h2:after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), transparent);
    margin: 1rem auto 0;
    transition: background var(--transition-speed);
}

p {
    margin-bottom: 1rem;
    transition: color var(--transition-speed);
}

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

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

/* Header Styles */
header {
    text-align: center;
    padding: 2rem 0;
    margin-top: 60px; /* To account for fixed navigation */
    transition: background var(--transition-speed);
}

.header-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.header-content img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(52, 152, 219, 0.5);
    transition: border-color var(--transition-speed), box-shadow var(--transition-speed);
}

.tagline {
    font-size: 1.1rem;
    color: var(--text-light);
    opacity: 0.8;
    margin-bottom: 1.5rem;
    transition: color var(--transition-speed);
}

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

.social-links a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    font-size: 1.2rem;
    transition: all var(--transition-speed) ease;
}

.social-links a:hover {
    background: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(52, 152, 219, 0.4);
}

/* Section Styles */
section {
    margin: 4rem 0;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.8s, transform 0.8s;
}

section.fade-in {
    opacity: 1;
    transform: translateY(0);
}

/* Project Card Styles */
.project-card {
    background: var(--card-bg-dark);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    border-left: 3px solid var(--primary-color);
    transition: transform var(--transition-speed), box-shadow var(--transition-speed), background var(--transition-speed);
    position: relative;
    overflow: hidden;
}

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

.project-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    transition: color var(--transition-speed);
}

.date-tag {
    font-size: 0.8rem;
    color: var(--accent-color);
    font-weight: normal;
    margin-left: 10px;
    transition: color var(--transition-speed);
}

.project-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.7;
    margin-bottom: 1rem;
    transition: color var(--transition-speed);
}

.project-features li {
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1.5rem;
    transition: color var(--transition-speed);
}

.project-features li:before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--primary-color);
    transition: color var(--transition-speed);
}

/* Writing Items Styles */
.writings-card {
    background: var(--card-bg-dark);
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    transition: background var(--transition-speed), box-shadow var(--transition-speed);
}

.writing-item {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: border-color var(--transition-speed);
}

.light-theme .writing-item {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.writing-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.writing-item h3 {
    color: var(--text-light);
    font-size: 1.2rem;
    margin-bottom: 0.7rem;
    transition: color var(--transition-speed);
}

.writing-meta {
    font-size: 0.9rem;
    color: var(--text-light);
    opacity: 0.7;
    margin-bottom: 1rem;
    transition: color var(--transition-speed);
}

.writing-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    padding: 0.4rem 0.8rem;
    background: rgba(52, 152, 219, 0.1);
    border-radius: 4px;
    transition: background var(--transition-speed), transform var(--transition-speed), color var(--transition-speed);
}

.writing-link:hover {
    background: rgba(52, 152, 219, 0.2);
    transform: translateX(5px);
}

/* Footer Styles */
footer {
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    background: rgba(26, 54, 93, 0.9);
    transition: background var(--transition-speed);
}

footer .tagline {
    font-style: italic;
    margin-top: 1rem;
    font-size: 0.9rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Scroll to top button */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity var(--transition-speed), transform var(--transition-speed), background var(--transition-speed);
    border: none;
    outline: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    z-index: 1000;
}

.scroll-to-top.visible {
    opacity: 0.8;
    transform: translateY(0);
}

.scroll-to-top:hover {
    opacity: 1;
    background: var(--secondary-color);
}

/* Animation Classes */
.fade-in {
    opacity: 1 !important;
    transform: translateY(0) !important;
    animation: fadeIn 0.5s ease-in-out;
}

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

/* Education list styling */
.education-list li {
    padding: 0.5rem 0;
    border-left: 2px solid var(--primary-color);
    padding-left: 1rem;
    margin-left: 0.5rem;
    transition: border-color var(--transition-speed);
}

.education-list li:hover {
    border-color: var(--secondary-color);
}

/* Awards styling */
.awards-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 1rem;
}

.award-group {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.award-group:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.award-group h4 {
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.light-theme .award-group h4 {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.award-group ul {
    padding-left: 1.2rem;
}

.award-group li {
    margin-bottom: 0.5rem;
    position: relative;
    line-height: 1.5;
}

.award-group li::marker {
    color: var(--primary-color);
}

/* Text alignment helpers */
.text-center {
    text-align: center;
}

/* Print styles */
@media print {
    .nav-container, .scroll-to-top, .theme-toggle, #particles-js {
        display: none !important;
    }

    body {
        background: white !important;
        color: black !important;
    }

    .container {
        background: white !important;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    header {
        padding-top: 0 !important;
        margin-top: 0 !important;
    }

    .bio-card, .project-card, .writings-card, .skill-category {
        break-inside: avoid;
        background: white !important;
        border: 1px solid #ddd !important;
        box-shadow: none !important;
    }

    a {
        color: black !important;
        text-decoration: underline !important;
    }

    h1, h2, h3, h4, h5, h6 {
        color: black !important;
        -webkit-text-fill-color: black !important;
    }

    h2::after {
        background: #333 !important;
    }

    .project-features li::before {
        color: black !important;
    }
}

/* Media queries for awards section */
@media (max-width: 768px) {
    .awards-container {
        grid-template-columns: 1fr;
    }

    .award-group {
        padding: 0.9rem;
    }
}

/* Responsive Styles */
@media (max-width: 768px) {
    h1 {
        font-size: 2rem;
    }

    h2 {
        font-size: 1.7rem;
    }

    .header-content img {
        width: 150px;
        height: 150px;
    }

    .container {
        width: 95%;
    }

    .social-links {
        gap: 0.8rem;
    }

    .social-links a {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 1.8rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    .header-content img {
        width: 120px;
        height: 120px;
    }

    .social-links {
        flex-wrap: wrap;
        justify-content: center;
    }

    .project-card h3 {
        font-size: 1.1rem;
    }

    .date-tag {
        display: block;
        margin-left: 0;
        margin-top: 0.3rem;
    }

    .project-card, .bio-card, .writings-card {
        padding: 1.2rem;
    }
}

/* Animation classes for element transitions */
.slide-in-left {
    animation: slideInLeft 0.5s forwards;
}

.slide-in-right {
    animation: slideInRight 0.5s forwards;
}

.scale-in {
    animation: scaleIn 0.5s forwards;
}

@keyframes slideInLeft {
    from {
        transform: translateX(-50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInRight {
    from {
        transform: translateX(50px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* Loading spinner */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background-dark);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s, visibility 0.5s;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
