/* CSS Variables for theming */
:root {
    --bg-color: #ffffff;
    --text-color: #000000;
    --border-color: #e0e0e0;
    --hover-bg: #f5f5f5;
    --button-bg: #000000;
    --button-text: #ffffff;
    --button-hover: #333333;
}

.dark-mode {
    --bg-color: #000000;
    --text-color: #ffffff;
    --border-color: #333333;
    --hover-bg: #1a1a1a;
    --button-bg: #ffffff;
    --button-text: #000000;
    --button-hover: #cccccc;
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Crimson Text', Georgia, serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
}

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

/* Header */
header {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 40px;
}

.home-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    text-decoration: none;
    width: 32px;
    height: 32px;
    transition: opacity 0.2s ease;
}

.home-icon:hover {
    opacity: 0.7;
}

.home-icon svg {
    width: 24px;
    height: 24px;
}

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

.map-name {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
}

.dark-mode-toggle {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 12px;
    cursor: pointer;
    font-size: 20px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
    justify-self: end;
}

.dark-mode-toggle:hover {
    background-color: var(--hover-bg);
}

/* Homepage */
.homepage h2 {
    margin-bottom: 30px;
    font-size: 28px;
    font-weight: 600;
}

.map-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

.map-box {
    position: relative;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text-color);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    min-height: 200px;
}

.map-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.map-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    opacity: 0.3;
    z-index: 0;
}

.map-background.map-background-color {
    opacity: 0.4;
}

.map-content {
    position: relative;
    z-index: 1;
    padding: 30px;
    text-align: center;
}

.map-logo {
    max-width: 100px;
    max-height: 100px;
    margin-bottom: 15px;
}

.map-logo-placeholder {
    width: 80px;
    height: 80px;
    border: 2px solid currentColor;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 600;
    margin: 0 auto 15px;
}

.map-content h3 {
    font-size: 24px;
    font-weight: 600;
}

/* Map page */
.map-page {
    padding: 20px 0;
}

.side-toggle-container {
    display: flex;
    justify-content: center;
    margin-bottom: 40px;
}

.side-toggle {
    display: flex;
    gap: 15px;
    align-items: center;
}

.side-toggle-btn {
    background: none;
    border: 2px solid var(--border-color);
    padding: 8px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
}

.side-toggle-btn:hover {
    background-color: var(--hover-bg);
    border-color: var(--text-color);
}

.side-toggle-btn.active {
    border-color: var(--accent-color, #5a7383);
    background-color: var(--accent-color-faded, rgba(90, 115, 131, 0.25));
    opacity: 1;
}

.side-icon {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

/* Accent colors for CT and T sides */
.ct-accent {
    --accent-color: #5a7383;
    --accent-color-faded: rgba(90, 115, 131, 0.25);
}

.t-accent {
    --accent-color: #c3af76;
    --accent-color-faded: rgba(195, 175, 118, 0.25);
}

.ct-accent .play-card,
.t-accent .play-card {
    border-left: 3px solid var(--accent-color);
}

.ct-accent .play-card:hover,
.t-accent .play-card:hover {
    box-shadow: 0 6px 18px var(--accent-color-faded);
}

.ct-accent .play-title,
.t-accent .play-title {
    color: var(--accent-color);
}

.ct-accent .comments-btn:hover,
.t-accent .comments-btn:hover {
    border-color: var(--accent-color);
}

.side-toggle-btn.active img {
    filter: drop-shadow(0 0 6px var(--accent-color));
}

/* Play list */
.play-list {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.no-plays {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-color);
    opacity: 0.6;
}

/* Play card */
.play-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 30px;
    background-color: var(--bg-color);
}

.play-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
}

.play-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.play-card-link:hover .play-title {
    text-decoration: underline;
}

/* Media carousel */
.media-carousel {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.carousel-item {
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid var(--border-color);
}

.carousel-item img,
.carousel-item video {
    display: block;
    width: 100%;
    height: auto;
}

/* Play socials */
.play-socials {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.views-section {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 14px;
}

.views-label {
    opacity: 0.7;
}

.views-count {
    font-weight: 500;
}

.comments-btn {
    background: none;
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    cursor: pointer;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.2s ease, border-color 0.2s ease;
    color: var(--text-color);
}

.comments-btn:hover {
    background-color: var(--hover-bg);
    border-color: var(--accent-color, var(--border-color));
}

/* Comments */
.comments-container {
    margin-top: 20px;
}

.comments-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
}

.comments-section h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 15px;
}

.comment-form {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.comment-author-input,
.comment-content-input {
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: inherit;
    font-size: 14px;
}

.comment-content-input {
    min-height: 80px;
    resize: vertical;
}

.comment-submit-btn {
    padding: 10px 20px;
    background-color: var(--button-bg);
    color: var(--button-text);
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background-color 0.2s ease;
    align-self: flex-start;
}

.comment-submit-btn:hover {
    background-color: var(--button-hover);
}

.comments-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.comment-item {
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    background-color: var(--hover-bg);
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.comment-date {
    opacity: 0.6;
    font-size: 12px;
}

.comment-content {
    font-size: 14px;
    line-height: 1.5;
}

.no-comments {
    text-align: center;
    padding: 20px;
    opacity: 0.6;
    font-size: 14px;
}

.play-detail {
    padding: 30px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.play-detail-breadcrumb a {
    text-decoration: none;
    color: var(--accent-color, var(--text-color));
}

.play-detail-breadcrumb a:hover {
    text-decoration: underline;
}

.play-detail-title {
    font-size: 34px;
    line-height: 1.2;
}

.play-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 14px;
    opacity: 0.75;
}

.play-detail-media {
    display: grid;
    gap: 20px;
}

.play-detail-media-item {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.play-detail-description {
    font-size: 18px;
    line-height: 1.7;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.play-detail-description p {
    margin: 0;
}

.play-detail-socials {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header {
        grid-template-columns: auto 1fr auto;
        gap: 10px;
    }
    
    .map-name {
        font-size: 20px;
    }
    
    .map-grid {
        grid-template-columns: 1fr;
    }
    
    .side-toggle {
        gap: 10px;
    }
    
    .side-toggle-btn {
        width: 40px;
        height: 40px;
    }
    
    .side-icon {
        width: 28px;
        height: 28px;
    }
    
    .play-card {
        padding: 20px;
    }
    
    .play-socials {
        flex-direction: column;
        align-items: flex-start;
    }

    .play-detail {
        padding: 20px;
    }

    .play-detail-title {
        font-size: 26px;
    }

    .play-detail-media {
        gap: 12px;
    }

    .play-detail-socials {
        flex-direction: column;
        align-items: flex-start;
    }
}

