:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --card-bg: #f8f9fa;
    --accent-color: #4a6fa5;
    --accent-primary: #4a6fa5;
    --accent-dark: #3a5a85;
    --accent-dark-hover: #2d4567;
    --border-color: #e9ecef;
    --button-bg: #4a6fa5;
    --button-text: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --primary: #007bff;
    --website-color: #28a745;
    --personal-color: #fd7e14;
    --academic-color: #6f42c1;
    --tab-hover: #f1f3f4;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --text-primary: #333333;
    --text-secondary: #666666;
}

[data-theme="dark"] {
    --bg-color: #222831;
    --text-color: #eeeeee;
    --card-bg: #2d2d2d;
    --accent-color: #00adb5;
    --accent-primary: #00adb5;
    --accent-dark: #00858c;
    --accent-dark-hover: #006c72;
    --border-color: #393e46;
    --button-bg: #00adb5;
    --button-text: #ffffff;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    --primary: #66b3ff;
    --website-color: #4caf50;
    --personal-color: #ff9800;
    --academic-color: #9c27b0;
    --tab-hover: #404040;
    --bg-primary: #222831;
    --bg-secondary: #2d2d2d;
    --text-primary: #eeeeee;
    --text-secondary: #aaaaaa;
}

body {
    font-family: 'Libre Baskerville', serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    display: flex;
    width: 100%;
    max-width: 100vw;
    padding: 30px;
    box-sizing: border-box;
    flex: 1;
    align-items: flex-start;
    overflow-x: hidden;
    gap: 40px;
    height: 100vh;
}

.sidebar {
    width: 250px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-right: 1px solid var(--border-color);
    flex-shrink: 0;
    height: calc(100vh - 60px);
    overflow-y: auto;
    position: sticky;
    top: 30px;
    align-self: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    position: relative;
    height: calc(100vh - 60px);
    overflow-y: auto;
}

.profile-image {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--accent-color);
    margin-bottom: 20px;
}

.profile-info {
    text-align: center;
}

.profile-info h2 {
    margin-bottom: 10px;
    color: var(--accent-color);
}

.contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.contact-link {
    text-decoration: none;
    color: var(--accent-color);
    display: flex;
    align-items: center;
    gap: 4px;
    transition: color 0.3s ease;
}

.contact-link:hover {
    color: var(--text-color);
}

.contact-icon {
    width: 16px;
    height: 16px;
}

.contact-icon-dark {
    width: 16px;
    height: 16px;
    filter: invert(1);
}

.email {
    margin-right: 5px;
}

.action-button {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--accent-color);
    font-size: 16px;
    transition: color 0.3s ease;
    font-family: 'Libre Baskerville', serif;
}

.action-button:hover {
    color: var(--text-color);
}

.affiliation {
    margin-bottom: 20px;
    font-style: italic;
}

.tab-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    z-index: 1000;
    padding: 16px 24px;
    transition: all 0.3s ease;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .tab-container {
    background: rgba(34, 40, 49, 0.95);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

/* Content wrapper for scrollable content */
.tab-content-wrapper {
    flex: 1;
    overflow-y: auto;
    padding: 20px 0;
    height: 0; /* This forces the flex item to shrink */
}

.tab-container .tabs {
    display: flex;
}

.tab {
    padding: 12px 24px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    background: transparent;
    border: none;
    position: relative;
    overflow: hidden;
}

.tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 8px;
    z-index: -1;
}

.tab:hover {
    color: var(--text-primary);
    transform: translateY(-1px);
}

.tab:hover::before {
    opacity: 0.1;
}

.tab.active {
    color: white;
    font-weight: 600;
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(74, 111, 165, 0.3);
}

.tab.active::before {
    opacity: 1;
}

[data-theme="dark"] .tab.active {
    box-shadow: 0 4px 12px rgba(0, 173, 181, 0.3);
}

/* Theme toggle in tab container - modern pill style */
.tab-container .theme-toggle {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 10px 10px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    font-family: 'Libre Baskerville', serif;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.tab-container .theme-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: 50%;
    z-index: -1;
}

.tab-container .theme-toggle:hover {
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--accent-color);
}

.tab-container .theme-toggle:hover::before {
    opacity: 0.1;
}

.tab-container .theme-toggle:active {
    transform: translateY(0);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.section {
    margin-bottom: 30px;
}

h3 {
    color: var(--accent-color);
    border-bottom: 2px solid var(--accent-color);
    padding-bottom: 5px;
    margin-bottom: 15px;
}

.tool-item {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.tool-button {
    padding: 8px 15px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 15px;
    transition: background-color 0.3s;
    text-decoration: none;
}

.tool-button:hover {
    opacity: 0.9;
}

.tool-description {
    flex: 1;
}

a {
    color: var(--accent-color);
    text-decoration: none;
    text-decoration: underline;
}

.show-more-container {
    text-align: center;
    margin-top: 30px;
}

.show-more-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px;
}

.show-more-btn:hover {
    opacity: 0.7;
}

/* Nice thing container specific styling for homepage */
.nice-thing-container.result-panel {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
}

/* Ensure nice thing panel has a different background from main content */
[data-theme="light"] .nice-thing-container.result-panel {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
}

[data-theme="dark"] .nice-thing-container.result-panel {
    background-color: #2d2d2d;
    border: 1px solid #393e46;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 768px) {
    .container {
        flex-direction: column;
        padding: 15px;
        gap: 20px;
        height: auto;
        max-width: 100%;
        overflow-x: hidden;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        padding-bottom: 20px;
        position: static;
        height: auto;
        align-self: auto;
        overflow-x: hidden;
    }

    .main-content {
        position: static;
        height: auto;
        overflow-y: visible;
        overflow-x: hidden;
        width: 100%;
        min-width: 0;
    }

    .tab-container {
        position: sticky;
        top: 0;
        flex-direction: row;
        gap: 16px;
        padding: 16px;
        margin-bottom: 20px;
        border-radius: 0;
        background: var(--bg-color);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        box-shadow: none;
        border-bottom: 1px solid var(--border-color);
        overflow-x: hidden;
        width: 100%;
        justify-content: space-between;
        align-items: center;
    }

    .tab-container .tabs {
        flex: 1;
        justify-content: center;
        padding: 4px;
        overflow-x: hidden;
        flex-wrap: nowrap;
    }

    .tab {
        flex: 1;
        text-align: center;
        padding: 8px 12px;
        font-size: 12px;
        min-width: 0;
    }

    .tab-container .theme-toggle {
        align-self: center;
        padding: 8px 8px;
        font-size: 12px;
        flex-shrink: 0;
        margin-right: 20px;
    }

    .tab-content-wrapper {
        padding: 10px 0;
        overflow-x: hidden;
        width: 100%;
    }

    /* Ensure all content wraps properly */
    .tool-item {
        flex-wrap: wrap;
        overflow-x: hidden;
    }

    .tool-description {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .nice-thing-container {
        overflow-x: hidden;
        word-wrap: break-word;
    }

    .publication-card {
        overflow-x: hidden;
    }

    .publication-title {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
}
