:root {
    --primary-color: #2a2a2a;
    --secondary-color: #3a3a3a;
    --accent-color: #ff8c00;
    --accent-hover: #ffa500;
    --text-color: #e0e0e0;
    --text-secondary: #b0b0b0;
    --dark-bg: #1a1a1a;
    --card-bg: #2a2a2a;
    --card-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    --hover-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
    --border-radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--dark-bg);
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    border-bottom: 3px solid var(--accent-color);
    color: white;
    padding: 3rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.tagline {
    font-size: 1.1rem;
    opacity: 0.95;
    font-weight: 300;
}

/* Main Content */
main {
    padding: 3rem 0;
}

section {
    margin-bottom: 4rem;
}

section h2 {
    font-size: 2rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid var(--accent-color);
    display: inline-block;
}

.section-description {
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-size: 1.05rem;
}

/* Grid Layout */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Cards */
.card {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
    border: 1px solid #3a3a3a;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    border-color: var(--accent-color);
    box-shadow: var(--hover-shadow);
}

.card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background-color: #1a1a1a;
}

.card-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.card-info {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    flex-grow: 1;
}

.download-count {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    opacity: 0.7;
    margin-top: 0.25rem;
}

.card-actions {
    display: flex;
    gap: 0.5rem;
    margin-top: auto;
}

.btn {
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    flex: 1;
}

.btn-primary {
    background-color: var(--accent-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--accent-hover);
}

.btn-secondary {
    background-color: #4a4a4a;
    color: white;
    border: 1px solid var(--accent-color);
}

.btn-secondary:hover {
    background-color: #5a5a5a;
}

.btn-kofi {
    background-color: #ff5e5b;
    color: white;
}

.btn-kofi:hover {
    background-color: #ff3e3b;
}

/* Help Card Specific Styles */
.helpcard-card .card-image {
    height: auto;
    cursor: pointer;
    object-fit: cover;
    display: block;
}

/* Table Card Specific Styles */
.table-thumbnail {
    cursor: pointer;
    transition: opacity 0.5s ease-in-out;
}

/* Footer */
footer {
    background-color: var(--primary-color);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
}

.disclaimer {
    margin-top: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
    opacity: 0.7;
}

/* Modal for Image Preview */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 1001;
}

.modal-close:hover {
    color: var(--accent-color);
}

/* Gallery Modal Specific Styles */
.gallery-modal {
    /* Inherits .modal styles but needs to ensure proper stacking */
}

.gallery-modal .modal-content {
    position: relative;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    font-size: 2rem;
    padding: 1rem 1.5rem;
    cursor: pointer;
    transition: background-color 0.3s;
    z-index: 1001;
    user-select: none;
}

.gallery-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.gallery-prev {
    left: 20px;
}

.gallery-next {
    right: 20px;
}

.gallery-counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 0.5rem 1.5rem;
    border-radius: 20px;
    font-size: 1rem;
    z-index: 1001;
}
    cursor: pointer;
    transition: color 0.3s;
}

.modal-close:hover {
    color: #ccc;
}

/* Responsive Design */
@media (max-width: 768px) {
    header h1 {
        font-size: 2rem;
    }
    
    .grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    section h2 {
        font-size: 1.5rem;
    }

}

/* Loading State */
.loading {
    text-align: center;
    padding: 2rem;
    color: #666;
    font-style: italic;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: #999;
    font-size: 1.1rem;
}

#wip-section {
    margin-bottom: 1.5rem;
}

#wip-section .grid {
    margin-top: 0.5rem;
}

#wip-section .empty-state {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    text-align: left;
}

/* WIP Card */
.wip-card {
    border: 2px solid #ff6b6b;
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255, 107, 107, 0.05) 100%);
}

.wip-card .card-title {
    color: #ff8c00;
}

.donation-tiers {
    background-color: rgba(0, 0, 0, 0.3);
    padding: 1rem;
    border-radius: 4px;
    margin: 1rem 0;
}

.donation-tier {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #3a3a3a;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.donation-tier:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.donation-tier strong {
    color: #ff8c00;
}

/* WIP image height override */
.wip-card-image-container .card-image {
    height: auto;
}

/* WIP Section Full Width */
#wip-grid,
#featured-grid {
    grid-template-columns: 1fr;
    max-width: 100%;
}

/* WIP Card Layout */
.wip-card {
    display: flex;
    flex-direction: column;
}

.wip-card-top {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.wip-card-image-container {
    flex: 0 0 50%;
    padding: 1.5rem;
}

.wip-card-image-container img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
}

.wip-card-description-container {
    flex: 1;
    display: block;
    padding: 1.5rem 1.5rem 1.5rem 0;
}

.wip-card-description-container .card-info {
    flex-grow: 0;
    margin-bottom: 0.5rem;
}

.wip-description-text {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-top: 0.5rem;
}

.wip-card-description-container .donation-tiers {
    background-color: transparent;
    padding: 0;
    margin-top: 1rem;
}

.wip-card-description-container .card-actions {
    display: flex;
}

.wip-card-description-container .btn {
    flex: 1;
}

.table-credits {
    list-style: none;
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #3a3a3a;
}

.table-credits li {
    position: relative;
    padding-left: 1rem;
    margin-bottom: 0.4rem;
    font-size: 0.78rem;
    font-weight: 300;
    color: #909090;
    line-height: 1.5;
}

.table-credits li::before {
    content: "–";
    position: absolute;
    left: 0;
    color: #707070;
}

@media (max-width: 768px) {
    .wip-card {
        overflow: visible;
    }

    .wip-card-top {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        margin-bottom: 0;
    }

    .wip-card-image-container {
        flex: none;
        width: 100%;
        padding: 1.5rem 1.5rem 0 1.5rem;
    }

    .wip-card-image-container img {
        width: 100%;
        height: auto;
    }

    .wip-card-description-container {
        flex: none;
        width: 100%;
        display: block;
        padding: 1.5rem;
    }
}
