/* 1. Starry Background & Global Reset */
body {
    background-image: url('/images/background_stars.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #fff;
    text-align: center;
    font-family: Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    padding-top: 70px;
    /* Fixed header height */
}

/* Top Bar Styles */
.top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    background-color: rgba(0, 0, 0, 0.9);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
    z-index: 1000;
    backdrop-filter: blur(10px);
    padding: 0 20px;
    box-sizing: border-box;
}

.favicon {
    width: 45px;
    height: 45px;
    object-fit: contain;
}

.bar-title {
    font-family: 'Lobster', cursive;
    font-size: 2rem;
    color: yellow;
    text-decoration: none;
    white-space: nowrap;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.5);
    margin: 0 auto;
}

.bar-content {
    display: flex;
    gap: 20px;
    align-items: center;
}

.bar-content a,
.bar-content button {
    background-color: rgba(0, 0, 0, 0.8);
    border: 3px solid #FFD700;
    color: #FFD700;
    font-weight: bold;
    height: 40px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease-in-out;
    border-radius: 25px;
    backdrop-filter: blur(5px);
}

.bar-content a:hover,
.bar-content button:hover {
    background-color: #FFD700;
    color: black;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.6);
    transform: translateY(-2px);
}

/* Mobile Header */
@media (max-width: 768px) {
    .top-bar {
        padding: 0 10px;
    }

    .bar-title {
        font-size: 1.5rem;
        margin-left: 10px;
    }

    .bar-content {
        gap: 10px;
    }

    .bar-content a,
    .bar-content button {
        padding: 0 10px;
        font-size: 0.9rem;
        height: 35px;
    }

    .search-text {
        display: none;
    }
}

/* 9. Add Breadcrumb Navigation */
.breadcrumb-nav {
    text-align: left;
    max-width: 1200px;
    margin: 20px auto 30px;
    padding: 0 20px;
    font-size: 1.1em;
    color: #aaa;
}

.breadcrumb-nav a {
    color: #FFD700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb-nav a:hover {
    color: #fff;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8);
}

/* 4. Centered Title with better spacing */
h1 {
    font-family: 'Lobster', cursive;
    font-size: 3.8em;
    color: #FFD700;
    margin: 0 0 20px 0;
    text-align: center;
    text-shadow: 3px 3px 6px rgba(0, 0, 0, 0.9);
    letter-spacing: 1px;
}

/* 6. Improved Bio Typography */
p {
    max-width: 950px;
    margin: 30px auto;
    font-size: 1.15em;
    line-height: 1.9;
    color: #f0f0f0;
    text-align: justify;
    text-shadow: 2px 2px 3px rgba(0, 0, 0, 0.9);
    padding: 0 20px;
}

img {
    height: 400px;
    width: auto;
    display: block;
    margin: 20px auto;
    object-fit: contain;
}

/* 1 & 11. Image Container 300x300px with enhanced shadow */
.figure-image-container {
    width: 300px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 40px auto;
    border: 4px solid rgba(255, 255, 255, 0.8);
    border-radius: 20px;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    filter: drop-shadow(0 15px 40px rgba(0, 0, 0, 0.7));
    box-shadow: 0 10px 50px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.figure-image-container:hover {
    border-color: #FFD700;
    filter: drop-shadow(0 20px 50px rgba(255, 215, 0, 0.5));
    box-shadow: 0 15px 60px rgba(255, 215, 0, 0.3);
}

.figure-image {
    display: block;
    transition: all 0.3s ease;
}

.figure-image-container:hover .figure-image {
    transform: scale(1.05);
}

.rfp-button {
    position: absolute;
    top: 10px;
    left: 10px;
}

/* 9. Comment Section Improvements */
.comment-section {
    margin: 50px auto;
    width: 90%;
    max-width: 900px;
    text-align: left;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 35px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.comment-form {
    margin-bottom: 30px;
}

.comment-form textarea {
    width: 100%;
    height: 130px;
    padding: 18px;
    margin-bottom: 18px;
    border: 2px solid #FFD700;
    border-radius: 15px;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    color: #fff;
    font-size: 1.05em;
    font-family: Arial, sans-serif;
    resize: vertical;
    transition: all 0.3s ease;
}

.comment-form textarea:focus {
    outline: none;
    border-color: #fff;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.6);
    background: rgba(0, 0, 0, 0.75);
}

.comment-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.comment-form button {
    padding: 14px 35px;
    background: rgba(0, 0, 0, 0.8);
    border: 3px solid #FFD700;
    color: #FFD700;
    font-weight: bold;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.15em;
}

.comment-form button:hover {
    background: #FFD700;
    color: #000;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
    transform: translateY(-2px);
}

.comment-thread {
    margin-top: 30px;
}

.comment-thread div {
    margin-bottom: 15px;
}

/* 7. Style Reference Section */
.reference-button {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 1em;
    color: #FFD700;
    background: rgba(255, 215, 0, 0.1);
    padding: 10px 20px;
    border-radius: 15px;
    border: 2px solid #FFD700;
    transition: all 0.3s ease;
    margin: 20px 0;
}

.reference-button:hover {
    background: rgba(255, 215, 0, 0.2);
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.reference-content {
    display: none;
    margin: 20px auto;
    max-width: 900px;
    padding: 20px;
    font-size: 0.95em;
    color: #ddd;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 15px;
    backdrop-filter: blur(5px);
    text-align: left;
    line-height: 1.6;
}

/* 5. Wikipedia Citation Styling */
.wiki-link {
    display: inline-block;
    margin: 25px 0;
    padding: 12px 25px;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 215, 0, 0.5);
    border-radius: 20px;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    text-decoration: none;
    color: #FFD700;
    font-size: 1.1em;
}

.wiki-link:hover {
    background: rgba(255, 215, 0, 0.15);
    border-color: #FFD700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    transform: translateY(-2px);
}

.wiki-link i {
    margin-right: 8px;
    font-size: 1.3em;
}

/* 7. Redesigned Vote Filter Buttons with Glassmorphism */
.vote-filter {
    margin: 40px 0 25px;
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.vote-filter button {
    padding: 12px 28px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    border: 2px solid rgba(255, 215, 0, 0.6);
    color: #FFD700;
    font-weight: bold;
    font-size: 1.05em;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.vote-filter button:hover {
    background: #FFD700;
    color: #000;
    border-color: #FFD700;
    box-shadow: 0 0 25px rgba(255, 215, 0, 0.7);
    transform: translateY(-2px);
}

/* 8. Larger Vote Buttons with Better Effects + Icons */
.vote-buttons {
    margin: 35px 0;
    display: flex;
    gap: 30px;
    justify-content: center;
}

.vote-buttons button {
    padding: 18px 40px;
    margin: 5px;
    background: rgba(0, 0, 0, 0.85);
    border: 4px solid #FFD700;
    color: #FFD700;
    font-size: 1.4em;
    font-weight: bold;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
}

.vote-buttons button:hover {
    background: #FFD700;
    color: #000;
    box-shadow: 0 0 35px rgba(255, 215, 0, 0.8), 0 0 50px rgba(255, 215, 0, 0.4);
    transform: translateY(-5px) scale(1.05);
}

.vote-buttons button div {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.vote-buttons button i {
    font-size: 1.3em;
    opacity: 0.7;
}

/* 10. Styled Vote Counter */
.vote-buttons button span {
    font-size: 1.5em;
    font-weight: bold;
    min-width: 40px;
    text-align: center;
}

/* 6. Redesign "Most Related Figures" Section */
.related-figures {
    margin: 50px auto;
    width: 90%;
    max-width: 1200px;
    text-align: center;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

.related-figures h3 {
    font-family: 'Lobster', cursive;
    font-size: 2.5em;
    color: #FFD700;
    margin-bottom: 25px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* Transform table to grid - 10 columns exactly (2 rows of 10) */
.related-figures table {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    width: 100%;
}

.related-figures tr {
    display: contents;
}

.related-figures td {
    background: rgba(255, 255, 255, 0.05);
    padding: 8px 5px;
    border-radius: 15px;
    border: 1px solid rgba(255, 215, 0, 0.3);
    transition: all 0.3s ease;
    min-height: 50px;
}

.related-figures td:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #FFD700;
    box-shadow: 0 0 15px rgba(255, 215, 0, 0.3);
    transform: translateY(-3px);
}

.related-figures a {
    text-decoration: none;
    color: #fff;
    font-size: 0.75em;
    font-weight: 500;
    transition: all 0.3s ease;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    padding: 3px;
    line-height: 1.4;
}

.related-figures a:hover {
    color: #FFD700;
    text-shadow: 0 0 8px rgba(255, 215, 0, 0.6);
}

/* 12. Style Alert Banner */
.problem-widget {
    background: rgba(255, 193, 7, 0.15);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 193, 7, 0.5);
    color: #FFD700;
    padding: 15px;
    text-align: center;
    font-weight: 600;
    border-radius: 15px;
    margin: 20px auto;
    max-width: 900px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.problem-widget a {
    color: #FFD700;
    text-decoration: underline;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        padding-top: 60px;
    }

    h1 {
        font-size: 2.8em;
    }

    .figure-image-container {
        width: 220px;
        height: 220px;
    }

    .related-figures table {
        grid-template-columns: repeat(5, 1fr);
    }

    .vote-buttons {
        flex-direction: column;
        align-items: stretch;
    }
}