/* Wikipedia-like styling */
body {
    font-family: 'Liberation Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #222;
    background-color: #f6f6f6;
    scroll-behavior: smooth;
}

a {
    color: #0645ad;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    text-decoration: underline;
    color: #1a6cef;
}

a:visited {
    color: #0b0080;
}

.wiki-container {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.wiki-header {
    background-color: #f8f9fa;
    border-bottom: 1px solid #a7d7f9;
    padding: 0.5rem 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.wiki-logo {
    height: 160px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0 1rem;
}

.wiki-logo h1 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 1.7em;
    margin: 0;
}

.wiki-search {
    padding: 0.5rem 1rem;
}

.wiki-search input {
    width: 80%;
    padding: 0.5rem;
    border: 1px solid #a2a9b1;
    border-radius: 4px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wiki-search input:focus {
    border-color: #3366cc;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1), 0 0 5px rgba(51,102,204,0.3);
    outline: none;
}

.wiki-search button {
    padding: 0.5rem 0.8rem;
    background-color: #3366cc;
    color: white;
    border: 1px solid #2a4d8f;
    border-radius: 4px;
    margin-left: 0.3rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wiki-search button:hover {
    background-color: #254aa5;
}

.wiki-main {
    display: flex;
    flex: 1;
    background-color: #fff;
    max-width: 1200px;
    margin: 0 auto;
    border-left: 1px solid #a7d7f9;
    border-right: 1px solid #a7d7f9;
}

.wiki-sidebar {
    width: 176px;
    padding: 1rem;
    background-color: #f6f6f6;
}

.wiki-sidebar h3 {
    font-size: 0.9em;
    color: #333;
    margin: 0.8rem 0 0.5rem 0;
    padding: 0.2rem 0;
    text-transform: uppercase;
    border-bottom: 1px solid #c8ccd1;
    font-weight: bold;
}

.wiki-sidebar ul {
    list-style-type: none;
    padding: 0;
    margin: 0 0 1rem 0;
}

.wiki-sidebar li {
    padding: 0.25rem 0;
    font-size: 0.9em;
    transition: transform 0.2s;
}

.wiki-sidebar li:hover {
    transform: translateX(3px);
}

.wiki-content {
    flex: 1;
    padding: 1rem 2rem;
}

.wiki-article {
    padding-right: 1rem;
}

.article-header {
    border-bottom: 1px solid #a2a9b1;
    margin-bottom: 1rem;
}

.article-header h1 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 1.8em;
    font-weight: normal;
    margin: 0;
    padding-bottom: 0.3rem;
    display: inline-block;
}

/* Share Buttons Styles */
.share-container {
    display: inline-flex;
    position: relative;
    float: right;
    margin-top: 10px;
}

.share-main-btn {
    display: flex;
    align-items: center;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    border-radius: 3px;
    padding: 5px 10px;
    font-size: 0.85em;
    cursor: pointer;
    transition: background-color 0.2s;
}

.share-main-btn:hover {
    background-color: #eaecf0;
}

.share-main-btn i {
    margin-right: 5px;
}

.share-options-container {
    position: absolute;
    top: 100%;
    right: 0;
    background-color: white;
    border: 1px solid #a2a9b1;
    border-radius: 3px;
    padding: 10px;
    width: 180px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    z-index: 100;
    display: none;
    animation: fadeIn 0.2s;
}

.share-options-container.share-active {
    display: block;
}

.share-title {
    font-size: 0.85em;
    font-weight: bold;
    margin-bottom: 8px;
    color: #54595d;
}

.share-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.share-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    border: none;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.share-btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

.share-btn.facebook {
    background-color: #3b5998;
}

.share-btn.twitter {
    background-color: #1da1f2;
}

.share-btn.linkedin {
    background-color: #0077b5;
}

.share-btn.whatsapp {
    background-color: #25d366;
}

.share-btn.email {
    background-color: #dd4b39;
}

.article-toc {
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    padding: 0.5rem 1rem;
    margin: 1rem 0;
    width: fit-content;
}

.article-toc h2 {
    font-size: 0.9em;
    margin: 0;
}

.article-toc ol {
    margin: 0.5rem 0 0.5rem 1.5rem;
    padding: 0;
}

.article-toc li {
    padding: 0.1rem 0;
    font-size: 0.9em;
}

.article-section h2 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 1.5em;
    font-weight: normal;
    border-bottom: 1px solid #a2a9b1;
    margin: 1rem 0 0.5rem 0;
}

.article-section h3 {
    font-family: 'Linux Libertine', 'Georgia', 'Times', serif;
    font-size: 1.2em;
    font-weight: normal;
    margin: 1rem 0 0.5rem 0;
}

.article-section p {
    margin: 0.5rem 0;
}

.info-box {
    float: right;
    margin: 0 0 1rem 1rem;
    background-color: #f8f9fa;
    border: 1px solid #a2a9b1;
    width: 280px;
}

.info-box-header {
    background-color: #f8f9fa;
    text-align: center;
    padding: 0.2rem;
    font-size: 1.2em;
    font-weight: bold;
}

.info-box-photo {
    text-align: center;
    padding: 0.5rem;
}

.info-box-photo img {
    max-width: 100%;
    border: 1px solid #c8ccd1;
    object-fit: contain;
    height: auto;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.info-box-photo img:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
}

.info-box-caption {
    font-size: 0.85em;
    padding: 0.2rem;
    text-align: center;
}

.info-box-content {
    padding: 0.5rem;
}

.info-box-row {
    display: flex;
    border-top: 1px solid #a2a9b1;
}

.info-box-label {
    width: 40%;
    background-color: #eaecf0;
    padding: 0.2rem 0.5rem;
    font-weight: bold;
    vertical-align: top;
}

.info-box-value {
    width: 60%;
    padding: 0.2rem 0.5rem;
    vertical-align: top;
}

/* Image Gallery Styles */
.image-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 20px;
}

.image-gallery-item {
    border: 1px solid #a2a9b1;
    border-radius: 3px;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    background-color: #f8f9fa;
}

.image-gallery-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.image-gallery-item img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.image-gallery-caption {
    padding: 8px;
    font-size: 0.85em;
    text-align: center;
    color: #222;
    border-top: 1px solid #eaecf0;
}

/* Enhanced Lightbox styles */
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.lightbox-container {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: zoomIn 0.3s ease;
}

@keyframes zoomIn {
    from { transform: scale(0.95); }
    to { transform: scale(1); }
}

.lightbox-image-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

.lightbox-image {
    max-width: 100%;
    max-height: 80vh;
    object-fit: contain;
    border: 4px solid white;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.lightbox-image.loading {
    opacity: 0;
}

.lightbox-image.loaded {
    opacity: 1;
}

.lightbox-close {
    position: absolute;
    top: -30px;
    right: -30px;
    width: 30px;
    height: 30px;
    background-color: white;
    border-radius: 50%;
    border: none;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #333;
    font-weight: bold;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.lightbox-close:hover {
    transform: scale(1.1);
    background-color: #f0f0f0;
}

.lightbox-controls {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

.lightbox-nav-btn {
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.lightbox-nav-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    transform: scale(1.1);
}

.lightbox-caption {
    position: absolute;
    bottom: -40px;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 15px;
    font-size: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.lightbox-counter {
    font-weight: bold;
    margin-left: 15px;
}

.lightbox-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.spinner {
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top: 4px solid #ffffff;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.wiki-footer {
    background-color: #f8f9fa;
    border-top: 1px solid #a7d7f9;
    padding: 1rem;
    font-size: 0.85em;
}

.footer-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.footer-links a {
    margin: 0 0.5rem;
    padding: 0.3rem 0.5rem;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.footer-links a:hover {
    background-color: rgba(51, 102, 204, 0.1);
    text-decoration: none;
}

.footer-info {
    text-align: center;
    color: #54595d;
}

/* Responsive adjustments */
@media (max-width: 992px) {
    .info-box {
        width: 240px;
    }
}

@media (max-width: 768px) {
    .wiki-main {
        flex-direction: column;
    }
    
    .wiki-sidebar {
        width: auto;
        border-bottom: 1px solid #a7d7f9;
    }
    
    .info-box {
        float: none;
        width: 100%;
        margin: 0 0 1rem 0;
    }
    
    .wiki-content {
        padding: 1rem;
    }
    
    .article-toc {
        width: 100%;
    }
    
    .wiki-search input {
        width: 70%;
    }
    
    .lightbox-close {
        top: -25px;
        right: -10px;
    }
}

@media (max-width: 480px) {
    .wiki-search {
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .wiki-search input {
        width: 90%;
        margin-bottom: 0.5rem;
    }
    
    .wiki-search button {
        margin-left: 0;
    }
    
    .footer-links {
        flex-direction: column;
        align-items: center;
    }
    
    .footer-links a {
        margin: 0.3rem 0;
    }
    
    .info-box-row {
        flex-direction: column;
    }
    
    .info-box-label, .info-box-value {
        width: 100%;
    }
    
    .lightbox-image {
        max-height: 80vh;
    }
}

/* Additional custom styles */
.section-link {
    display: inline-block;
    position: relative;
    margin-left: 0.5rem;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.2s ease;
    vertical-align: middle;
}

.article-section h2:hover .section-link,
.article-section h3:hover .section-link {
    opacity: 1;
}

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #3366cc;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s, background-color 0.3s;
    z-index: 99;
    opacity: 0;
    pointer-events: none;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: auto;
}

.back-to-top:hover {
    transform: translateY(-5px);
    background-color: #254aa5;
}

/* Content links styling */
.article-section a {
    border-bottom: 1px dotted #3366cc;
}

.article-section a:hover {
    border-bottom: 1px solid #3366cc;
    text-decoration: none;
}

/* Quote styling */
blockquote {
    margin: 1.5rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #3366cc;
    background-color: #f8f9fa;
    font-style: italic;
    position: relative;
}

blockquote::before {
    content: '\201C';
    font-size: 4em;
    font-family: Georgia, serif;
    color: #3366cc;
    opacity: 0.3;
    position: absolute;
    top: -15px;
    left: 5px;
}

/* Table styling enhancement */
table.wiki-table {
    border-collapse: collapse;
    width: 100%;
    margin: 1rem 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

table.wiki-table th {
    background-color: #f2f8ff;
    color: #333;
    font-weight: bold;
    text-align: left;
    padding: 0.8rem;
    border: 1px solid #a2a9b1;
}

table.wiki-table td {
    padding: 0.8rem;
    border: 1px solid #a2a9b1;
    vertical-align: top;
}

table.wiki-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

table.wiki-table tr:hover {
    background-color: #eaf3ff;
}

/* Highlight text selection */
::selection {
    background-color: #3366cc;
    color: white;
}