/**
 * PictMap - Main Stylesheet
 */

/* CSS Variables */
:root {
    --primary-color: #4a90d9;
    --primary-hover: #357abd;
    --secondary-color: #6c757d;
    --danger-color: #dc3545;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --info-color: #17a2b8;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-color: #dee2e6;
    --text-color: #333;
    --text-muted: #6c757d;
    --bg-color: #fff;
    --shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 4px 16px rgba(0, 0, 0, 0.15);
    --radius: 8px;
    --radius-sm: 4px;
    --header-height: 50px;
    --thumbnail-height: 80px;
    --transition: 0.2s ease;
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Hiragino Sans', 'Noto Sans JP', sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: var(--text-color);
    background: var(--bg-color);
    -webkit-font-smoothing: antialiased;
}

#app {
    height: 100%;
}

/* Setup Container */
.setup-container {
    min-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.setup-wizard {
    width: 100%;
    max-width: 500px;
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.setup-header {
    padding: 30px 30px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

.setup-header h1 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--dark-color);
}

.setup-manual-link {
    margin-bottom: 16px;
}

.setup-manual-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 13px;
}

.setup-manual-link a:hover {
    text-decoration: underline;
}

.setup-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    opacity: 0.5;
}

.step.active, .step.done {
    opacity: 1;
}

.step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-bottom: 4px;
}

.step.active .step-number {
    background: var(--primary-color);
    color: #fff;
}

.step.done .step-number {
    background: var(--success-color);
    color: #fff;
}

.step-label {
    font-size: 12px;
    color: var(--text-muted);
}

.step-line {
    width: 40px;
    height: 2px;
    background: var(--border-color);
    margin-bottom: 20px;
}

.step-line.done {
    background: var(--success-color);
}

.setup-form {
    padding: 30px;
}

.setup-form h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--dark-color);
}

.setup-complete {
    text-align: center;
    padding: 60px 30px;
}

.complete-icon {
    font-size: 64px;
    color: var(--success-color);
    margin-bottom: 20px;
}

.setup-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    margin-bottom: 16px;
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    transition: border-color var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group small {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* API Key Input */
.api-key-input {
    display: flex;
    gap: 8px;
}

.api-key-input input {
    flex: 1;
}

.api-key-input .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.api-key-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--light-color);
}

.api-key-status.success {
    background: #d4edda;
    border: 1px solid #28a745;
}

.api-key-status.error {
    background: #f8d7da;
    border: 1px solid #dc3545;
}

.api-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
    font-size: 13px;
}

.api-check-item:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.api-check-icon {
    font-weight: bold;
    width: 20px;
    text-align: center;
}

.api-key-status.success .api-check-icon {
    color: #28a745;
}

.api-key-status.error .api-check-item .api-check-icon {
    color: #dc3545;
}

.api-check-item[data-ok="true"] .api-check-icon {
    color: #28a745;
}

.api-check-name {
    flex: 1;
    font-weight: 500;
}

.api-check-result {
    font-size: 12px;
    color: var(--text-muted);
}

.api-key-status.success .api-check-result {
    color: #28a745;
}

.required {
    color: var(--danger-color);
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.radio-label input {
    width: auto;
}

.coord-inputs {
    display: flex;
    gap: 10px;
}

.coord-inputs input {
    flex: 1;
}

.coord-display {
    padding: 8px 12px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
    font-family: monospace;
    font-size: 13px;
}

/* Mini Map */
.mini-map {
    width: 100%;
    height: 200px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-color);
    margin-top: 8px;
    z-index: 0;
}

.mini-map .leaflet-control-zoom {
    margin: 5px !important;
}

.mini-map .leaflet-control-zoom a {
    width: 26px !important;
    height: 26px !important;
    line-height: 26px !important;
    font-size: 14px !important;
}

/* Tags Input */
.tags-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    min-height: 42px;
}

.tags-input input {
    flex: 1;
    min-width: 100px;
    border: none;
    outline: none;
    padding: 4px;
}

.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 12px;
    font-size: 12px;
}

.tag button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 1;
    opacity: 0.8;
}

.tag button:hover {
    opacity: 1;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary-color);
    color: #fff;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover);
}

.btn-secondary {
    background: var(--secondary-color);
    color: #fff;
}

.btn-secondary:hover:not(:disabled) {
    background: #5a6268;
}

.btn-danger {
    background: var(--danger-color);
    color: #fff;
}

.btn-danger:hover:not(:disabled) {
    background: #c82333;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 30px;
}

.error-message {
    padding: 12px;
    background: #fee;
    color: var(--danger-color);
    border-radius: var(--radius-sm);
    margin-top: 15px;
    font-size: 13px;
}

/* App Container */
.app-container {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    position: relative;
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 12px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    z-index: 100;
}

.menu-btn {
    width: 36px;
    height: 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.menu-btn span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--dark-color);
    border-radius: 1px;
}

.site-title {
    flex: 1;
    font-size: 16px;
    font-weight: 600;
    margin-left: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    overflow: visible;
}

/* +ボタンのエフェクトがスクロールバーに影響しないようにするコンテナ */
.add-btn-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-btn-wrapper.animated {
    width: 56px;
    height: 56px;
    overflow: hidden;
    border-radius: 50%;
}

.map-toggle {
    display: flex;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.map-toggle button {
    padding: 6px 10px;
    border: none;
    background: var(--light-color);
    font-size: 12px;
    cursor: pointer;
    transition: all var(--transition);
}

.map-toggle button.active {
    background: var(--primary-color);
    color: #fff;
}

.add-btn {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.add-btn:hover {
    background: var(--primary-hover);
}

/* +ボタンのツールチップ */
.add-btn .tooltip {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--dark-color);
    color: #fff;
    padding: 6px 12px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: normal;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
    pointer-events: none;
    z-index: 200;
}

.add-btn .tooltip::before {
    content: '';
    position: absolute;
    bottom: 100%;
    right: 12px;
    border: 6px solid transparent;
    border-bottom-color: var(--dark-color);
}

.add-btn:hover .tooltip {
    opacity: 1;
    visibility: visible;
}

/* アニメーション中はツールチップを非表示 */
.add-btn.animated .tooltip {
    display: none;
}

/* 初回表示時のエフェクト（10秒間のみ） */
.add-btn.animated {
    width: 52px;
    height: 52px;
    font-size: 32px;
    font-weight: bold;
    background: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
    background-size: 300% 300%;
    box-shadow:
        0 0 20px rgba(255, 0, 128, 0.6),
        0 0 40px rgba(255, 140, 0, 0.4),
        0 0 60px rgba(64, 224, 208, 0.3);
    animation:
        rainbow-bg 2s ease infinite,
        bounce-pulse 0.6s ease-in-out infinite,
        glow-intense 1s ease-in-out infinite;
    border: 3px solid rgba(255, 255, 255, 0.5);
}

.add-btn.animated::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border-radius: 50%;
    background: linear-gradient(45deg, #ff0080, #ff8c00, #40e0d0, #ff0080);
    background-size: 300% 300%;
    opacity: 0.5;
    animation: rainbow-bg 2s ease infinite, ripple-expand 1.5s ease-out infinite;
    z-index: -1;
}

.add-btn.animated::after {
    content: '';
    position: absolute;
    top: -16px;
    left: -16px;
    right: -16px;
    bottom: -16px;
    border-radius: 50%;
    border: 2px solid rgba(255, 0, 128, 0.5);
    animation: ripple-ring 1.5s ease-out infinite 0.5s;
    z-index: -2;
}

.add-btn.animated:hover {
    transform: scale(1.2) rotate(90deg);
    box-shadow:
        0 0 30px rgba(255, 0, 128, 0.8),
        0 0 60px rgba(255, 140, 0, 0.6),
        0 0 90px rgba(64, 224, 208, 0.4);
}

@keyframes rainbow-bg {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

@keyframes bounce-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

@keyframes glow-intense {
    0%, 100% {
        box-shadow:
            0 0 20px rgba(255, 0, 128, 0.6),
            0 0 40px rgba(255, 140, 0, 0.4),
            0 0 60px rgba(64, 224, 208, 0.3);
    }
    50% {
        box-shadow:
            0 0 30px rgba(255, 0, 128, 0.9),
            0 0 60px rgba(255, 140, 0, 0.7),
            0 0 100px rgba(64, 224, 208, 0.5),
            inset 0 0 20px rgba(255, 255, 255, 0.3);
    }
}

@keyframes ripple-expand {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

@keyframes ripple-ring {
    0% {
        transform: scale(1);
        opacity: 0.8;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 4px 15px rgba(74, 144, 226, 0.4);
    }
    50% {
        box-shadow: 0 4px 25px rgba(74, 144, 226, 0.7), 0 0 30px rgba(255, 107, 107, 0.3);
    }
}

@keyframes ripple {
    0% {
        transform: scale(1);
        opacity: 0.3;
    }
    50% {
        transform: scale(1.15);
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0.3;
    }
}

/* Side Menu */
.side-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 500;
    visibility: hidden;
    opacity: 0;
    transition: all var(--transition);
}

.side-menu.open {
    visibility: visible;
    opacity: 1;
}

.menu-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.menu-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 260px;
    height: 100%;
    background: var(--bg-color);
    box-shadow: var(--shadow-lg);
    transform: translateX(-100%);
    transition: transform var(--transition);
}

.side-menu.open .menu-content {
    transform: translateX(0);
}

.menu-header {
    padding: 20px;
    background: var(--primary-color);
    color: #fff;
    font-weight: 500;
}

.menu-list {
    list-style: none;
}

.menu-list li {
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background var(--transition);
}

.menu-list li:hover {
    background: var(--light-color);
}

/* Map Container */
.map-container {
    flex: 1;
    position: relative;
    z-index: 1;
}

#map {
    width: 100%;
    height: 100%;
    z-index: 1;
}

.marker-count {
    position: absolute;
    bottom: 20px;
    left: 10px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    line-height: 1.4;
}

.map-controls {
    position: absolute;
    bottom: 20px;
    right: 10px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

.control-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-color);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: background var(--transition);
}

.control-btn:hover {
    background: var(--light-color);
}

/* Thumbnail Bar */
.thumbnail-bar {
    height: var(--thumbnail-height);
    background: var(--light-color);
    border-top: 1px solid var(--border-color);
}

.thumbnail-scroll {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 8px;
    overflow-x: auto;
    overflow-y: hidden;
    height: 100%;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.thumbnail-item {
    flex-shrink: 0;
    width: 64px;
    height: 64px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    border: 2px solid transparent;
    transition: border-color var(--transition);
}

.thumbnail-item.selected {
    border-color: var(--primary-color);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    background: var(--bg-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 16px;
    font-weight: 600;
}

.close-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
}

.close-btn:hover {
    color: var(--dark-color);
}

.modal-body {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
}

/* Upload Area */
.upload-area {
    border: 2px dashed var(--border-color);
    border-radius: var(--radius);
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(74, 144, 217, 0.1);
}

.upload-area.has-image {
    padding: 0;
    border-style: solid;
}

.upload-placeholder {
    color: var(--text-muted);
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.upload-placeholder p {
    margin-bottom: 5px;
}

.preview-image {
    width: 100%;
    max-height: 300px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.photo-form {
    margin-top: 20px;
}

/* Detail Modal */
.detail-modal {
    max-width: 600px;
}

.detail-image {
    text-align: center;
    margin-bottom: 15px;
}

.detail-image img {
    max-width: 100%;
    max-height: 400px;
    object-fit: contain;
    border-radius: var(--radius-sm);
}

.detail-info {
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.detail-comment {
    margin-bottom: 15px;
    line-height: 1.6;
    white-space: pre-wrap;
}

.detail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: var(--text-muted);
}

.detail-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.detail-address {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
    font-size: 13px;
    color: var(--text-color);
    line-height: 1.5;
}

.detail-address svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--text-muted);
}

.detail-address span {
    word-break: break-word;
}

.detail-address span.loading {
    color: var(--text-muted);
    font-style: italic;
}

.detail-uploader {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 10px;
}

.detail-uploader svg {
    flex-shrink: 0;
}

.detail-footer-spacer {
    flex: 1;
}

/* Settings Modal */
.settings-modal {
    max-width: 600px;
}

.settings-section {
    margin-bottom: 25px;
}

.settings-section:last-child {
    margin-bottom: 0;
}

.settings-section h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Search Modal */
.search-modal .modal-body {
    padding: 15px;
}

/* Photo Search Filters */
.photo-filter-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.filter-label {
    min-width: 70px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    color: var(--dark-color);
}

.filter-input-wrapper {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}

.filter-input {
    flex: 1;
    padding: 8px 28px 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
    transition: border-color var(--transition);
    width: 100%;
}

.filter-input:focus {
    outline: none;
    border-color: var(--primary-color);
}

.filter-input-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--secondary-color);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 13px;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.filter-input-clear:hover {
    opacity: 1;
}

.date-range-inputs {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
}

.date-range-inputs input[type="date"] {
    flex: 1;
    padding: 7px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 13px;
}

.date-range-inputs input[type="date"]:focus {
    outline: none;
    border-color: var(--primary-color);
}

.photo-search-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

/* Link Creation */
.link-creation {
    margin-top: 16px;
    padding: 12px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
}

.link-creation-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
}

.generated-link {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}

.generated-link input {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12px;
    background: var(--bg-color);
}

.generated-link input:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Filter Badge */
.control-btn {
    position: relative;
}

.filter-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    background: var(--danger-color);
    color: #fff;
    border-radius: 9px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Thumbnail Filter Info */
.thumbnail-filter-info {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
    padding: 4px 8px;
    background: var(--primary-color);
    color: #fff;
    border-radius: var(--radius-sm);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}

.filter-clear-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    opacity: 0.8;
}

.filter-clear-btn:hover {
    opacity: 1;
}

/* About Modal */
.about-modal .modal-body {
    text-align: center;
}

.about-modal .modal-body > p {
    margin-bottom: 15px;
}

.about-description {
    text-align: left;
    background: var(--light-color);
    padding: 15px;
    border-radius: var(--radius-sm);
    line-height: 1.6;
    color: var(--text-color);
}

/* Login Modal */
.login-modal {
    max-width: 360px;
}

.login-modal-footer {
    justify-content: space-between;
    align-items: center;
}

.login-footer-links {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.forgot-password-link,
.register-link {
    font-size: 12px;
    color: var(--primary-color);
    text-decoration: none;
    cursor: pointer;
}

.forgot-password-link:hover,
.register-link:hover {
    text-decoration: underline;
}

.reset-description {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 15px;
    line-height: 1.6;
}

.success-message {
    padding: 12px;
    background: #d4edda;
    color: #155724;
    border-radius: var(--radius-sm);
    margin-top: 15px;
    font-size: 13px;
}

.reset-user-id {
    padding: 8px 12px;
    background: #e8f4fd;
    border: 1px solid #b8daff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 15px;
    color: #004085;
}

.action-buttons {
    display: flex;
    gap: 4px;
}

/* Admin Modal */
.admin-modal {
    max-width: 900px;
    max-height: 85vh;
}

/* 他のモーダルより前面に表示するモーダル */
.modal.modal-top {
    z-index: 1100;
}

.admin-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding: 10px;
    background: var(--light-color);
    border-radius: var(--radius-sm);
}

.admin-table-container {
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.admin-table th,
.admin-table td {
    padding: 10px 8px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

.admin-table th {
    background: var(--light-color);
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 1;
}

.admin-table tbody tr:hover {
    background: var(--light-color);
}

.admin-table .id-cell {
    font-family: monospace;
    font-size: 11px;
}

.admin-thumb {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.btn-sm {
    padding: 5px 10px;
    font-size: 12px;
}

.add-form {
    padding: 15px;
    margin-bottom: 15px;
    background: var(--light-color);
    border-radius: var(--radius);
}

.add-form h4 {
    margin-bottom: 15px;
    font-size: 14px;
}

.form-row {
    display: flex;
    gap: 15px;
    margin-bottom: 10px;
}

.form-row .form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Toggle Label */
.toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.toggle-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Debug Log */
.debug-log-container {
    max-height: 200px;
    overflow-y: auto;
    background: #1e1e1e;
    border-radius: var(--radius-sm);
    padding: 10px;
    margin-top: 10px;
}

.debug-log-container pre {
    color: #d4d4d4;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 11px;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-all;
    margin: 0;
}

.no-data {
    color: var(--text-muted);
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* System Info */
.system-info {
    background: var(--light-color);
    padding: 15px;
    border-radius: var(--radius-sm);
}

.system-info p {
    margin: 5px 0;
    font-size: 13px;
}

.system-info strong {
    display: inline-block;
    min-width: 140px;
}

/* Factory Reset */
.factory-reset-section {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--danger-color);
}

.factory-reset-section h4 {
    color: var(--danger-color);
    margin-bottom: 0;
    border-bottom: none;
    padding-bottom: 0;
}

.accordion-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 8px 0;
}

.accordion-toggle {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.2s ease;
}

.accordion-toggle.open {
    transform: rotate(180deg);
}

.accordion-body {
    padding-top: 15px;
}

.warning-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 4px solid var(--danger-color);
    padding: 15px;
    border-radius: var(--radius-sm);
    margin-bottom: 15px;
}

.warning-box p {
    margin: 5px 0;
    font-size: 13px;
    color: #856404;
}

.warning-box p:first-child {
    font-size: 14px;
    color: var(--danger-color);
}

.warning-box ul {
    margin: 10px 0;
    padding-left: 25px;
}

.warning-box li {
    margin: 5px 0;
    font-size: 13px;
    color: #856404;
}

.confirm-input {
    width: 100%;
    max-width: 300px;
    padding: 10px;
    border: 2px solid var(--danger-color);
    border-radius: var(--radius-sm);
    font-size: 14px;
    text-align: center;
    font-weight: bold;
}

.confirm-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.25);
}

.factory-reset-section .btn-danger {
    margin-top: 10px;
    padding: 12px 24px;
    font-size: 14px;
}

.factory-reset-section .btn-danger:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Notification */
.notification {
    position: fixed;
    bottom: calc(var(--thumbnail-height) + 20px);
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    background: var(--dark-color);
    color: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    animation: slideUp 0.3s ease;
}

.notification.success {
    background: var(--success-color);
}

.notification.error {
    background: var(--danger-color);
}

.notification.info {
    background: var(--info-color);
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* Map Popup */
.popup-content {
    max-width: 200px;
}

.popup-image {
    width: 100%;
    max-height: 150px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.popup-comment {
    margin-top: 8px;
    font-size: 13px;
    line-height: 1.4;
}

/* Leaflet Overrides */
.leaflet-container {
    font-family: inherit;
}

.leaflet-pane {
    z-index: 1 !important;
}

.leaflet-tile-pane {
    z-index: 1 !important;
}

.leaflet-overlay-pane {
    z-index: 2 !important;
}

.leaflet-shadow-pane {
    z-index: 3 !important;
}

.leaflet-marker-pane {
    z-index: 4 !important;
}

.leaflet-tooltip-pane {
    z-index: 5 !important;
}

.leaflet-popup-pane {
    z-index: 6 !important;
}

.leaflet-control {
    z-index: 10 !important;
}

.leaflet-top,
.leaflet-bottom {
    z-index: 10 !important;
}

.leaflet-popup-content-wrapper {
    border-radius: var(--radius);
}

.leaflet-popup-content {
    margin: 10px;
}

/* Responsive */
@media (max-width: 768px) {
    :root {
        --header-height: 48px;
        --thumbnail-height: 70px;
    }

    .setup-wizard {
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
    }

    .setup-header {
        padding: 20px;
    }

    .setup-header h1 {
        font-size: 20px;
    }

    .step-label {
        display: none;
    }

    .setup-form {
        padding: 20px;
    }

    .site-title {
        font-size: 14px;
    }

    .map-toggle button {
        padding: 5px 8px;
        font-size: 11px;
    }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-width: 100%;
        max-height: 85vh;
        border-radius: var(--radius) var(--radius) 0 0;
    }

    .add-photo-modal,
    .detail-modal,
    .edit-modal {
        max-height: 90vh;
    }

    .settings-modal {
        max-height: 85vh;
    }

    .thumbnail-item {
        width: 54px;
        height: 54px;
    }

    .menu-content {
        width: 80%;
        max-width: 280px;
    }

    .photo-filter-row {
        flex-wrap: wrap;
    }

    .filter-label {
        min-width: 60px;
    }

    .date-range-inputs {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
    }

    .form-actions .btn {
        width: 100%;
    }

    .modal-footer {
        flex-direction: column-reverse;
    }

    .modal-footer .btn {
        width: 100%;
    }

    .coord-inputs {
        flex-direction: column;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a2e;
        --text-color: #e8e8e8;
        --dark-color: #e8e8e8;
        --light-color: #16213e;
        --border-color: #2a2a4a;
        --text-muted: #a0a0a0;
    }

    .setup-container {
        background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    }

    .menu-btn span {
        background: var(--text-color);
    }

    .upload-area {
        background: var(--light-color);
    }

    .form-group input,
    .form-group textarea,
    .form-group select {
        background: var(--light-color);
        color: var(--text-color);
    }

    .filter-input,
    .date-range-inputs input[type="date"],
    .generated-link input {
        background: var(--light-color);
        color: var(--text-color);
    }

    .filter-label {
        color: var(--text-color);
    }

    .mini-map {
        border-color: var(--border-color);
    }
}
