/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    overflow: hidden;
    height: 100vh;
    background-color: #f0f8f4;
}

/* Header Styles */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background: linear-gradient(135deg, #6fb584 0%, #5ea271 100%);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: flex;
    align-items: center;
}

.header-content {
    width: 100%;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.logo i {
    font-size: 24px;
}

.logo h1 {
    font-family: 'Emilys Candy', cursive;
    font-size: 24px;
    font-weight: normal;
    letter-spacing: 1px;
}

.header-nav {
    display: flex;
    gap: 15px;
}

.nav-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.nav-btn i {
    font-size: 14px;
}

/* Main Content */
.main-content {
    position: relative;
    height: 100vh;
    padding-top: 60px;
}

/* Map Container */
#map {
    width: 100%;
    height: 100%;
}

/* Adjust Leaflet control position to avoid header overlap */
.leaflet-top.leaflet-left {
    top: 20px !important;
}

/* Create Button */
.create-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #7ed493 0%, #6fb584 100%);
    border: none;
    color: white;
    font-size: 24px;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(111, 181, 132, 0.4);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Location Button */
.location-btn {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    border: 2px solid #6fb584;
    color: #6fb584;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.location-btn:hover {
    background: #6fb584;
    color: white;
    transform: scale(1.1);
}

.location-btn:active {
    transform: scale(0.95);
}

.create-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(111, 181, 132, 0.5);
}

.create-btn:active {
    transform: scale(0.95);
}

.create-btn i {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

.modal-content {
    background: #f8fdfb;
    border-radius: 20px;
    padding: 30px;
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: slideUp 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #666;
}

.modal-title {
    font-family: 'Noto Serif JP', serif;
    font-size: 24px;
    margin-bottom: 25px;
    color: #2c5f3f;
    text-align: center;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #4a7c59;
    font-weight: 500;
    font-size: 14px;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d4e8db;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: white;
    font-family: 'Noto Serif JP', serif;
}

.form-group input:focus {
    outline: none;
    border-color: #7ed493;
    background: #fafffe;
    box-shadow: 0 0 0 3px rgba(126, 212, 147, 0.1);
}

.form-group input::placeholder {
    color: #a8c0b5;
    font-size: 14px;
}

.char-count {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(10%);
    font-size: 12px;
    color: #999;
}

/* Location Info */
.location-info {
    background: #e8f5ed;
    padding: 12px 15px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
    border: 1px solid #c8e0d1;
}

.location-info i {
    color: #6fb584;
    font-size: 18px;
}

.location-info span {
    color: #4a7c59;
    font-size: 14px;
}

/* Submit Button */
.submit-btn {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #7ed493 0%, #6fb584 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(111, 181, 132, 0.3);
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(111, 181, 132, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

.submit-btn i {
    font-size: 18px;
}

/* Location Select Button */
.location-select-btn {
    width: 100%;
    padding: 12px;
    background: white;
    border: 2px solid #7ed493;
    border-radius: 12px;
    color: #6fb584;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}

.location-select-btn:hover {
    background: #7ed493;
    color: white;
}

.location-select-btn:active {
    transform: scale(0.98);
}

/* Haiku Card in Popup */
.haiku-popup {
    padding: 0;
}

.haiku-card {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    min-width: 280px;
}

.haiku-text {
    font-family: 'Noto Serif JP', serif;
    font-size: 18px;
    line-height: 1.8;
    color: #2c5f3f;
    text-align: center;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8fdfb;
    border-radius: 10px;
    border-left: 3px solid #7ed493;
}

.haiku-line {
    display: block;
    margin: 5px 0;
}

.haiku-photo {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.haiku-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.haiku-author {
    color: #666;
    font-size: 14px;
    font-style: italic;
}

.haiku-date {
    color: #999;
    font-size: 12px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timeline-date {
    color: #999;
    font-size: 12px;
    margin: 10px 0;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timeline-stats {
    margin: 10px 0;
    color: #6fb584;
    font-size: 14px;
}

.like-stat {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.haiku-actions {
    display: flex;
    gap: 10px;
}

.haiku-btn {
    background: transparent;
    border: 1px solid #ddd;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    color: #666;
    font-size: 12px;
    transition: all 0.3s ease;
}

.haiku-btn:hover {
    background: #f5f5f5;
    border-color: #7ed493;
    color: #6fb584;
}

.haiku-btn.liked {
    background: #ffe8e8;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.haiku-btn .like-count {
    margin-left: 5px;
    font-weight: 500;
}

.haiku-btn i {
    margin-right: 3px;
}

/* Timeline Styles */
.timeline-content,
.my-haiku-content {
    max-width: 600px;
}

.timeline-list,
.my-haiku-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.timeline-item,
.my-haiku-item {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    border: 1px solid #e8f5ed;
}

.timeline-item:hover,
.my-haiku-item:hover {
    box-shadow: 0 4px 20px rgba(111, 181, 132, 0.2);
    transform: translateY(-2px);
}

.timeline-haiku {
    font-family: 'Noto Serif JP', serif;
    font-size: 16px;
    line-height: 1.6;
    color: #2c5f3f;
    margin-bottom: 15px;
    padding: 15px;
    background: #f8fdfb;
    border-radius: 10px;
    border-left: 3px solid #7ed493;
}

.timeline-photo {
    width: 100%;
    max-height: 250px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 15px;
}

.timeline-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
}

.timeline-author {
    color: #666;
    font-style: italic;
}

.timeline-location {
    color: #6fb584;
    display: flex;
    align-items: center;
    gap: 5px;
}

.timeline-location i {
    font-size: 12px;
}

.timeline-actions {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.action-btn {
    flex: 1;
    padding: 8px;
    background: transparent;
    border: 1px solid #d4e8db;
    border-radius: 8px;
    color: #4a7c59;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    font-size: 13px;
}

.action-btn:hover {
    background: #e8f5ed;
    border-color: #7ed493;
    color: #6fb584;
}

.action-btn i {
    font-size: 14px;
}

.action-btn.liked {
    background: #ffe8e8;
    border-color: #ff6b6b;
    color: #ff6b6b;
}

.action-btn.liked:hover {
    background: #ffcccc;
}

.edit-btn {
    border-color: #7ed493;
    color: #6fb584;
}

.delete-btn {
    border-color: #ffb3b3;
    color: #ff6b6b;
}

.delete-btn:hover {
    background: #ffe8e8;
    border-color: #ff6b6b;
}

/* Custom Marker Icon */
.custom-marker {
    background: linear-gradient(135deg, #7ed493 0%, #6fb584 100%);
    border: 3px solid white;
    border-radius: 50%;
    width: 12px;
    height: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

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

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

/* Loading State */
.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 640px) {
    .header-content {
        padding: 0 15px;
    }
    
    .logo h1 {
        font-size: 20px;
    }
    
    .nav-btn span {
        display: none;
    }
    
    .nav-btn {
        padding: 8px 12px;
    }
    
    .modal-content {
        width: 95%;
        padding: 20px;
    }
    
    .create-btn {
        bottom: 20px;
        right: 20px;
        width: 56px;
        height: 56px;
    }
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #6fb584 0%, #5ea271 100%);
    color: white;
    padding: 12px 24px;
    border-radius: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 3000;
    animation: toastIn 0.3s ease;
    font-size: 14px;
}

.toast.error {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a5a 100%);
}

@keyframes toastIn {
    from {
        transform: translateX(-50%) translateY(100px);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #7ed493;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #6fb584;
}