* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: rgb(217, 217, 217);
    display: flex;
    flex-direction: column;
}

/* Top Bar */
.top-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: 100;
    flex-shrink: 0;
}

.top-bar-content {
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.top-bar-left {
    flex: 1;
    min-width: 200px;
}

.top-bar-left h1 {
    font-size: 1.5em;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.top-bar-left p {
    font-size: 0.9em;
    opacity: 0.9;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.admin-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

.btn-admin {
    background: #28a745;
    color: white;
}

.btn-admin:hover {
    background: #218838;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

/* Admin controls in top bar */
.admin-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Full Screen Map Container */
.map-container {
    flex: 1;
    position: relative;
    overflow: hidden;
    background: rgb(217, 217, 217);
}

.map-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    cursor: crosshair;
    background: rgb(217, 217, 217);
}

.korean-map {
    width: 100%;
    height: 100%;
    display: block;
}

.pins-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.pin {
    position: absolute;
    width: 30px;
    height: 30px;
    cursor: pointer;
    pointer-events: all;
    transform: translate(-50%, -100%);
    transition: transform 0.2s;
    z-index: 10;
}

.pin:hover {
    transform: translate(-50%, -100%) scale(1.2);
}

.pin-icon {
    width: 100%;
    height: 100%;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.pin-tooltip {
    position: fixed;
    background: white;
    color: #000000;
    padding: 8px 16px;
    border-radius: 24px;
    font-size: 0.8rem;
    white-space: nowrap;
    pointer-events: none;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1), 0 0 0 1px rgba(0, 0, 0, 0.05);
    transform: translateX(-50%);
}

.pin.new-pin {
    animation: pinDrop 0.3s ease-out;
}

@keyframes pinDrop {
    0% {
        transform: translate(-50%, -200%) scale(0);
    }
    50% {
        transform: translate(-50%, -100%) scale(1.2);
    }
    100% {
        transform: translate(-50%, -100%) scale(1);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s;
}

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

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 24px;
    width: 90%;
    max-width: 600px;
    max-height: 85vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: slideDown 0.3s;
    position: relative;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
    position: absolute;
    right: 20px;
    top: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-content h2 {
    margin-bottom: 20px;
    color: #333;
    padding-right: 30px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #555;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.char-count {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.image-uploads {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.image-upload-item {
    border: 2px dashed #e0e0e0;
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    transition: border-color 0.3s;
}

.image-upload-item:hover {
    border-color: #667eea;
}

.image-upload-item input[type="file"] {
    display: none;
}

.file-label {
    display: inline-block;
    padding: 10px 20px;
    background: #667eea;
    color: white;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.3s;
    font-size: 14px;
}

.file-label:hover {
    background: #5568d3;
}

.image-preview {
    margin-top: 10px;
    min-height: 80px;
}

.image-preview img {
    max-width: 100%;
    max-height: 150px;
    border-radius: 6px;
    margin-top: 10px;
}

.form-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

.btn {
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 24px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5568d3;
}

.btn-secondary {
    background: #e0e0e0;
    color: #333;
}

.btn-secondary:hover {
    background: #d0d0d0;
}

/* View Modal Styles */
.view-author-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 20px;
    font-size: 0.9rem;
    color: rgba(0, 0, 0, 0.8);
}

.view-author-info .author-section {
    display: flex;
    gap: 8px;
}

.view-author-info .author-label,
.view-author-info .last-edited-label {
    font-weight: 500;
    display: inline;
}

.view-author-info .author-value,
.view-author-info .last-edited-value {
    font-weight: 400;
    display: inline;
}

/* Slider Styles */
.slider-container {
    margin: 20px 0;
    position: relative;
}

.slider-wrapper {
    position: relative;
    overflow: hidden;
    min-height: 400px;
}

.slider-page {
    display: none;
    animation: slideIn 0.3s ease-in-out;
}

.slider-page.active {
    display: block;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.page-title {
    font-size: 1.2em;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e0e0e0;
}

.page-subtitle {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 20px;
    font-style: italic;
}

.slider-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.slider-nav-btn {
    padding: 10px 20px;
    font-size: 14px;
}

.slider-nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.slider-dots {
    display: flex;
    gap: 10px;
    align-items: center;
}

.slider-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d0d0d0;
    cursor: pointer;
    transition: all 0.3s;
}

.slider-dot.active {
    background: #667eea;
    transform: scale(1.2);
}

/* View Content Styles */
.view-content {
    margin: 15px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 24px;
    line-height: 1.6;
    color: #555;
    text-align: left;
}

/* Remove padding and background from view-content when it contains sources list */
#view-sources.view-content {
    padding: 0;
    background: transparent;
    margin: 0;
}

.view-content h4 {
    font-size: 1em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.view-content ul,
.view-content ol {
    margin: 10px 0;
    padding-left: 30px;
}

/* Override list padding for sources list */
#view-sources .view-sources-list {
    padding-left: 0;
}

.view-content li {
    margin: 5px 0;
}

.view-sources-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.view-source-item {
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 24px;
    padding: 15px;
    margin: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
}

.view-source-item:first-child {
    margin-top: 15px;
}

.view-source-item:last-child {
    margin-bottom: 15px;
}

.view-source-number {
    font-weight: 600;
    color: #666;
    font-size: 1.1em;
    flex-shrink: 0;
    min-width: 30px;
}

.view-source-content {
    flex: 1;
}

.view-source-title {
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.view-source-meta {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.view-source-url-container {
    margin-top: 5px;
}

.view-source-url {
    font-size: 0.85em;
    color: #667eea;
    word-break: break-all;
    text-decoration: none;
    transition: color 0.2s;
}

.view-source-url:hover {
    color: #5568d3;
    text-decoration: underline;
}

.view-source-url:visited {
    color: #764ba2;
}

.view-description {
    margin: 20px 0;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 24px;
    line-height: 1.6;
    color: #555;
    text-align: left;
}

.view-description ul,
.view-description ol {
    margin: 10px 0;
    padding-left: 30px;
}

.view-description li {
    margin: 5px 0;
    padding-left: 5px;
}

.view-description ul {
    list-style-type: disc;
}

.view-description ol {
    list-style-type: decimal;
}

.view-description ul ul,
.view-description ol ol,
.view-description ul ol,
.view-description ol ul {
    margin-top: 5px;
    margin-bottom: 5px;
}

.view-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.view-image-item {
    position: relative;
    cursor: pointer;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.view-image-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.view-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.current-images {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.current-image-item {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    aspect-ratio: 1;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.current-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.delete-image-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.9);
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
}

.delete-image-btn:hover {
    background: #dc3545;
}

.pin-admin-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

/* Lightbox Styles */
.lightbox {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.95);
    animation: fadeIn 0.3s;
}

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

#lightbox-img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 40px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
}

.lightbox-close:hover {
    color: #ccc;
}

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

.lightbox-prev,
.lightbox-next {
    pointer-events: all;
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    font-size: 50px;
    padding: 20px 30px;
    cursor: pointer;
    border-radius: 6px;
    margin: 0 20px;
    transition: background 0.3s;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255,255,255,0.3);
}

/* Responsive */
/* Copyright Pill */
.copyright-pill {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0.5rem 1.5rem;
    border-radius: 50px;
    font-size: 0.8rem;
    color: #666;
    z-index: 9999;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.copyright-pill a {
    color: inherit;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.copyright-pill a:hover {
    opacity: 0.7;
    text-decoration: underline;
}

.copyright-pill .footer-spacer {
    display: inline-block;
    width: 2em;
}

@media (max-width: 768px) {
    .copyright-pill {
        font-size: 0.7rem;
        padding: 0.4rem 1rem;
    }
    
    .top-bar-left h1 {
        font-size: 1.2em;
    }
    
    .top-bar-left p {
        font-size: 0.8em;
    }
    
    .top-bar-content {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .top-bar-right {
        width: 100%;
        justify-content: flex-start;
    }
    
    .image-uploads {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .view-images {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}

