/* PvZ Wiki - Enhanced Styling to match Fandom wiki appearance */

/* CSS Custom Properties for Theme Colors */
:root {
    /* Default Plant Theme (Green) */
    --primary-color: #4a9c59;
    --secondary-color: #66d9ff;
    --dark-color: #2d5a3d;
    --darkest-color: #1e3d2b;
}

/* Zombie Theme (Purple) */
.zombie-theme {
    --primary-color: #8B5CF6;
    --secondary-color: #A78BFA;
    --dark-color: #5B21B6;
    --darkest-color: #312E81;
}

* {
    box-sizing: border-box;
}

body {
    font-family: "Rubik", -apple-system, BlinkMacSystemFont, "Segoe UI", 
                 "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", 
                 sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    color: #fff;
    background: linear-gradient(135deg, #1a3a3a 0%, #2c5555 50%, #1a3a3a 100%);
    background-attachment: fixed;
    min-height: 100vh;
}

/* Main container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Back Button */
.back-button-container {
    margin-bottom: 20px;
}

.back-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: white;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95em;
}

.back-icon {
    font-size: 1.2em;
    font-weight: bold;
}

.back-text {
    white-space: nowrap;
}

/* Page title */
.content-title {
    color: #fff;
    margin: 0 0 1.5em 0;
    padding: 20px 0;
    font-size: 2.5em;
    font-weight: 700;
    text-align: center;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
    border-bottom: 3px solid var(--primary-color);
    background: rgba(0,0,0,0.2);
    border-radius: 8px 8px 0 0;
}

/* Content grid */
.content {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 25px;
    margin-top: 0;
}

/* Main content area */
.main-content {
    background: rgba(15, 35, 45, 0.95);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
    border: 1px solid var(--primary-color);
    backdrop-filter: blur(10px);
}

/* Sidebar */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Typography improvements */
h2, h3, h4, h5, h6 {
    color: var(--primary-color);
    margin-top: 2em;
    margin-bottom: 0.8em;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

h2 {
    font-size: 1.8em;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5em;
}

h3 {
    font-size: 1.4em;
}

p {
    margin-bottom: 1.2em;
    color: #e8f4ea;
    text-align: justify;
}

/* Links */
a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

/* Content images (plants, zombies, etc.) that should have styling */
.plant-image,
.plant-icon,
.zombie-image,
.zombie-icon,
.content-image {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

/* Tables */
table {
    border-collapse: collapse;
    width: 100%;
    margin: 1.5em 0;
    background: rgba(20, 40, 50, 0.8);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

th, td {
    border: 1px solid var(--primary-color);
    padding: 12px;
    text-align: left;
}

th {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

td {
    color: #e8f4ea;
}

/* Enhanced Content Infobox (Plants, Zombies, etc.) */
.plant-infobox,
.zombie-infobox,
.content-infobox {
    background: linear-gradient(145deg, var(--dark-color) 0%, var(--darkest-color) 100%);
    border: 3px solid var(--primary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    color: white;
    margin-bottom: 20px;
    font-family: "Rubik", sans-serif;
}

.infobox-header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    padding: 15px;
    text-align: center;
    border-bottom: 2px solid var(--secondary-color);
}

.header-title {
    font-size: 1.1em;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.plant-name {
    font-size: 1.4em;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.plant-image-container {
    padding: 20px;
    text-align: center;
    background: rgba(0,0,0,0.2);
}

.plant-image {
    width: 120px;
    height: 120px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(74, 156, 89, 0.3);
    padding: 10px;
    margin-bottom: 15px;
}

.plant-description {
    color: #e8f4ea;
    font-size: 0.95em;
    font-style: italic;
}

/* Vertical Sections System */
.infobox-sections {
    border-top: 1px solid rgba(102, 217, 255, 0.3);
}

.info-section {
    border-bottom: 1px solid rgba(102, 217, 255, 0.2);
}

.info-section:last-child {
    border-bottom: none;
}

.section-header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: #fff;
    padding: 12px 15px;
    font-weight: 600;
    font-size: 0.95em;
    border-bottom: 1px solid rgba(102, 217, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.section-content {
    padding: 15px;
}

/* Game Data Tab */
.data-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin: 4px 0;
    background: rgba(74, 156, 89, 0.2);
    border-radius: 6px;
}

.data-label {
    font-weight: 600;
    color: var(--secondary-color);
    font-size: 0.9em;
    width: 120px;
}

.data-value {
    color: #fff;
    font-weight: 500;
}

/* Names Tab */
.name-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 12px;
    margin: 4px 0;
    background: rgba(74, 156, 89, 0.2);
    border-radius: 4px;
}

.name-label {
    color: var(--secondary-color);
    font-weight: 600;
    font-size: 0.9em;
    flex: 1 0 80px;
}

.name-value {
    color: #fff;
}

/* Description Tab */
.desc-field {
    padding: 8px 12px;
    margin: 4px 0;
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
    color: #e8f4ea;
    line-height: 1.5;
}



/* Legacy infobox support (fallback) */
.pi-item, .pi-panel, .portable-infobox {
    background: linear-gradient(145deg, var(--primary-color) 0%, var(--dark-color) 50%, var(--darkest-color) 100%);
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    color: white;
    margin-bottom: 20px;
    position: relative;
}

/* Navigation boxes */
.navbox, .navbox-div {
    clear: both;
    background: linear-gradient(135deg, var(--dark-color), var(--darkest-color));
    border: 2px solid var(--primary-color);
    border-radius: 12px;
    margin: 2em 0;
    overflow: hidden;
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.navbox-title, .navbox-header {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    padding: 15px;
    font-weight: 700;
    text-align: center;
    font-size: 1.1em;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.navbox-list {
    background: rgba(20, 40, 50, 0.8);
    color: #e8f4ea;
    padding: 15px;
}

.navbox-list ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.navbox-list li {
    display: inline-block;
    margin: 2px 8px 2px 0;
    padding: 4px 8px;
    background: rgba(74, 156, 89, 0.2);
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.navbox-list li:hover {
    background: rgba(74, 156, 89, 0.4);
}

.navbox-list li::after {
    content: "";
}

/* Table of Contents */
.toc {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px;
    margin: 2em 0;
}

.toc h2 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.1em;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 8px;
}

.toc ul {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

.toc li {
    margin: 4px 0;
    padding: 2px 0;
}

.toc li ul {
    padding-left: 20px;
    margin-top: 4px;
}

.toc a {
    color: #e8f4ea;
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

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

/* Almanac styling */
.almanac-plant {
    background: linear-gradient(145deg, var(--primary-color), var(--dark-color));
    border: 2px solid var(--secondary-color);
    border-radius: 12px;
    padding: 20px;
    margin: 2em 0;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}

.almanac-plant-image {
    text-align: center;
}

.almanac-plant-image img {
    border-radius: 12px;
}

.almanac-plant-title {
    font-size: 1.4em;
    font-weight: 700;
    color: #fff;
    text-align: center;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.almanac-description-header {
    color: #e8f4ea;
    font-style: italic;
    border-bottom: 1px solid rgba(102, 217, 255, 0.3);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.almanac-description-stat {
    color: var(--secondary-color);
    font-weight: 600;
}

.almanac-description-flavor {
    color: #b8e6c1;
    font-style: italic;
    margin: 15px 0;
    padding: 10px;
    background: rgba(0,0,0,0.2);
    border-radius: 6px;
    border-left: 3px solid var(--secondary-color);
}

/* Figures and captions */
figure {
    margin: 20px 0;
    text-align: center;
}

figcaption {
    color: #b8e6c1;
    font-style: italic;
    font-size: 0.9em;
}

/* Gallery improvements */
.wikia-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.wikia-gallery-item {
    background: rgba(20, 40, 50, 0.8);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    transition: transform 0.3s ease;
}

.wikia-gallery-item:hover {
    transform: translateY(-5px);
}

/* Responsive design */
@media (max-width: 1024px) {
    .content {
        grid-template-columns: 1fr 350px;
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .content {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        order: -1;
    }
    
    .content-title {
        font-size: 2em;
    }
    
    .main-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }
    
    .content-title {
        font-size: 1.8em;
        padding: 15px 0;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .back-button {
        padding: 10px 16px;
        font-size: 0.9em;
    }

    .back-icon {
        font-size: 1.4em;
    }
}

/* ================== MEDIAWIKI FIGURE FIXES ================== */
/* Override MediaWiki figure floats to prevent height issues */
figure.thumb {
    display: block;
    max-width: 300px;
    background: rgba(20, 40, 50, 0.6);
    border: 1px solid rgba(102, 217, 255, 0.3);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

figure.thumb.mw-halign-left,
figure.thumb.mw-halign-right {
    float: left;
    margin: 0 1.4em 1.3em 0;
    clear: both;
}

figure.thumb::after {
    content: "";
    display: table;
    clear: both;
}

figure.thumb img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 8px 8px 0 0;
}

figure.thumb figcaption,
figure.thumb .thumbcaption {
    padding: 10px;
    font-size: 0.85em;
    color: #b8e6c1;
    background: rgba(0, 0, 0, 0.4);
    border-radius: 0 0 8px 8px;
    line-height: 1.4;
    text-align: center;
}

figure.thumb .caption {
    color: var(--secondary-color);
    font-weight: 500;
    margin: 0;
}

/* Ensure proper spacing after figures */
figure.thumb + * {
    margin-top: 1.5em;
}

/* Clear all floats to prevent layout issues */
.mw-parser-output::after {
    content: "";
    display: table;
    clear: both;
}

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

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

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 6px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* ================== ENHANCED FOOTER STYLING ================== */
.footer {
    background: linear-gradient(135deg, #1a3a3a 0%, #2c5555 50%, #1a3a3a 100%);
    margin-top: 60px;
    color: #e8f4ea;
    border-top: 3px solid var(--primary-color);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 50px 20px 30px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-section h3 {
    color: var(--primary-color);
    margin: 0 0 20px 0;
    font-size: 1.2em;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 8px;
}

.footer-section p {
    margin: 0 0 15px 0;
    color: #e8f4ea;
    line-height: 1.6;
    text-align: left;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 10px;
}

.footer-links a {
    color: var(--secondary-color);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
    padding: 5px 0;
}

.footer-links a:hover {
    color: var(--primary-color);
    transform: translateX(5px);
}

.footer-stats {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.footer-stats span {
    background: rgba(74, 156, 89, 0.2);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.9em;
    border-left: 3px solid var(--primary-color);
}

.footer-disclaimer {
    font-size: 0.85em;
    color: #b8e6c1;
    font-style: italic;
    margin-top: 10px;
}

.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
}

.footer-meta div {
    background: rgba(0,0,0,0.2);
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.9em;
    color: var(--secondary-color);
}

.footer-bottom {
    background: rgba(0,0,0,0.3);
    border-top: 1px solid rgba(74, 156, 89, 0.3);
    padding: 25px 20px;
}

.footer-bottom-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.footer-bottom-content p {
    margin: 0;
    color: #b8e6c1;
    font-size: 0.9em;
}

.footer-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    background: linear-gradient(135deg, var(--primary-color), var(--dark-color));
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 500;
    border: 1px solid rgba(102, 217, 255, 0.3);
    text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

/* Responsive footer */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        padding: 40px 20px 25px;
    }
    
    .footer-bottom-content {
        flex-direction: column;
        text-align: center;
    }
    
    .footer-badges {
        justify-content: center;
    }
    
    .footer-stats {
        flex-direction: row;
        flex-wrap: wrap;
    }
} 