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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f5f5f5;
    overflow: hidden;
    height: 100vh;
    -webkit-font-smoothing: antialiased;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: relative;
}

/* Header */
.app-header {
    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: 1000;
}

.app-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
}

/* Map Container */
#map {
    flex: 1;
    width: 100%;
    z-index: 1;
}

/* Custom Marker Styles */
.custom-marker {
    background-color: #667eea;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 3px solid white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.custom-marker:hover {
    transform: scale(1.1);
}

/* Info Panel */
.info-panel {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    background: white;
    border-radius: 20px 20px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    max-height: 65vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.info-panel.show {
    transform: translateY(0);
}

.info-panel.hidden {
    display: none;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #f0f0f0;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.close-btn:active {
    background: #e0e0e0;
}

.info-content {
    padding: 20px;
}

.info-content h2 {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 10px;
    padding-right: 40px;
}

.place-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

/* Highlights Section */
.highlights-section {
    margin: 20px 0;
}

.highlights-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

#highlights-list {
    list-style: none;
    padding: 0;
}

#highlights-list li {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: #555;
    border-left: 4px solid #667eea;
}

/* Details Section */
.details-section {
    margin: 20px 0;
}

.details-section h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 10px;
}

.details-section p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.meta-info {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.meta-info span {
    background: #e8f0fe;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: #1a73e8;
}

/* Navigate Button */
.navigate-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 15px;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

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

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    display: flex;
    justify-content: space-around;
    padding: 10px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1500;
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 10px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.nav-item.active {
    color: #667eea;
}

.nav-item .icon {
    font-size: 1.5rem;
}

.nav-item .label {
    font-size: 0.75rem;
}

.nav-item:active {
    background: #f5f5f5;
}

/* List View */
.list-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 70px;
    background: white;
    z-index: 2500;
    overflow-y: auto;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
}

.list-view.show {
    transform: translateX(0);
}

.list-view.hidden {
    display: none;
}

.list-header {
    position: sticky;
    top: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.list-header h2 {
    font-size: 1.3rem;
}

.close-list-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
}

.places-list {
    padding: 15px;
}

.place-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.place-card:active {
    transform: scale(0.98);
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.place-card h3 {
    font-size: 1.1rem;
    color: #333;
    margin-bottom: 8px;
}

.place-card .category-badge {
    display: inline-block;
    background: #e8f0fe;
    color: #1a73e8;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-bottom: 10px;
}

.place-card p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* Google Maps Info Window Customization */
.gm-style .gm-style-iw-c {
    border-radius: 12px !important;
    padding: 10px !important;
}

.gm-style .gm-style-iw-d {
    overflow: auto !important;
}

.gm-style-iw button {
    top: 8px !important;
    right: 8px !important;
}

/* Hide Google Maps controls on small screens for cleaner UI */
@media (max-width: 768px) {
    .gm-style .gm-svpc {
        display: none;
    }
}

/* Loading State */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

/* Responsive Design */
@media (min-width: 768px) {
    .app-header h1 {
        font-size: 2rem;
    }

    .info-panel {
        max-width: 500px;
        left: 50%;
        transform: translateX(-50%) translateY(100%);
        border-radius: 20px;
        bottom: 90px;
    }

    .info-panel.show {
        transform: translateX(-50%) translateY(0);
    }

    .list-view {
        max-width: 600px;
        left: 50%;
        transform: translateX(-50%) translateX(100%);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
    }

    .list-view.show {
        transform: translateX(-50%) translateX(0);
    }
}

/* Safe area for notched devices */
@supports (padding: max(0px)) {
    .app-header {
        padding-top: max(15px, env(safe-area-inset-top));
        padding-left: max(20px, env(safe-area-inset-left));
        padding-right: max(20px, env(safe-area-inset-right));
    }

    .bottom-nav {
        padding-bottom: max(10px, env(safe-area-inset-bottom));
    }
}

/* Floating Add Pin Button */
.add-pin-btn {
    position: fixed;
    bottom: 90px;
    right: 20px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    z-index: 1600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.add-pin-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 24px rgba(102, 126, 234, 0.5);
}

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

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    padding: 20px;
    overflow-y: auto;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    animation: slideUp 0.3s ease-out;
}

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

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 16px 16px 0 0;
    position: relative;
}

.modal-header h2 {
    font-size: 1.4rem;
    margin: 0;
    padding-right: 40px;
}

.modal-header .close-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    top: 20px;
    right: 20px;
}

/* Form Styles */
#add-pin-form {
    padding: 25px;
}

.form-group {
    margin-bottom: 20px;
}

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    color: #666;
    font-size: 0.85rem;
    margin-top: 5px;
    margin-bottom: 8px;
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.search-address-btn {
    width: 100%;
    padding: 10px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.2s;
}

.search-address-btn:hover {
    background: #45a049;
}

.search-address-btn:active {
    transform: scale(0.98);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.btn-primary,
.btn-secondary {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

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

.btn-secondary {
    background: #f5f5f5;
    color: #666;
}

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

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

/* Mobile Responsive for Form */
@media (max-width: 480px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .modal {
        padding: 0;
        align-items: flex-end;
    }

    .modal-content {
        max-height: 95vh;
        border-radius: 16px 16px 0 0;
    }
}

/* ===== SWIPE VIEW (TINDER STYLE) ===== */

.swipe-view {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    z-index: 2500;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.swipe-view.show {
    transform: translateY(0);
}

.swipe-view.hidden {
    display: none;
}

.swipe-header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(10px);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.swipe-header h2 {
    font-size: 1.3rem;
    margin: 0;
}

.close-swipe-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 1.2rem;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-swipe-btn:active {
    background: rgba(255, 255, 255, 0.3);
}

.swipe-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.swipe-cards {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 500px;
}

.swipe-card {
    position: absolute;
    width: 100%;
    height: 100%;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    cursor: grab;
    transition: transform 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    user-select: none;
}

.swipe-card:active {
    cursor: grabbing;
}

.swipe-card.swiping {
    transition: none;
}

.swipe-card.swiped-right {
    animation: swipeRight 0.4s ease-out forwards;
}

.swipe-card.swiped-left {
    animation: swipeLeft 0.4s ease-out forwards;
}

@keyframes swipeRight {
    to {
        transform: translateX(150%) rotate(30deg);
        opacity: 0;
    }
}

@keyframes swipeLeft {
    to {
        transform: translateX(-150%) rotate(-30deg);
        opacity: 0;
    }
}

.swipe-card-image {
    width: 100%;
    height: 250px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    position: relative;
}

.swipe-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
    font-weight: bold;
    color: white;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.swipe-card-overlay.like {
    background: rgba(76, 175, 80, 0.8);
    opacity: 1;
}

.swipe-card-overlay.dislike {
    background: rgba(244, 67, 54, 0.8);
    opacity: 1;
}

.swipe-card-content {
    padding: 25px;
    height: calc(100% - 250px);
    overflow-y: auto;
}

.swipe-card-title {
    font-size: 1.5rem;
    color: #333;
    margin-bottom: 8px;
    font-weight: 700;
}

.swipe-card-category {
    display: inline-block;
    background: #667eea;
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 15px;
}

.swipe-card-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
    font-size: 0.95rem;
}

.swipe-card-highlights {
    margin-top: 15px;
}

.swipe-card-highlights h4 {
    font-size: 0.9rem;
    color: #333;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.swipe-card-highlights ul {
    list-style: none;
    padding: 0;
}

.swipe-card-highlights li {
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: #555;
    border-left: 3px solid #667eea;
}

.swipe-card-meta {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.swipe-card-meta span {
    background: #e8f0fe;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #1a73e8;
}

.swipe-actions {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.swipe-btn {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    border: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.swipe-btn:active {
    transform: scale(0.9);
}

.swipe-dislike {
    background: #f44336;
    color: white;
}

.swipe-dislike:hover {
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.4);
}

.swipe-like {
    background: #4CAF50;
    color: white;
}

.swipe-like:hover {
    box-shadow: 0 6px 20px rgba(76, 175, 80, 0.4);
}

.swipe-btn .btn-icon {
    font-size: 1.8rem;
}

.swipe-btn .btn-label {
    font-size: 0.7rem;
    font-weight: 600;
    margin-top: 2px;
}

.swipe-counter {
    position: absolute;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #333;
    font-weight: 600;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.swipe-empty {
    text-align: center;
    color: white;
    padding: 40px;
}

.swipe-empty.hidden {
    display: none;
}

.empty-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.swipe-empty h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.swipe-empty p {
    opacity: 0.9;
    margin-bottom: 25px;
}

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

/* Card Stack Effect */
.swipe-card:nth-child(2) {
    transform: scale(0.95) translateY(10px);
    opacity: 0.8;
    z-index: -1;
}

.swipe-card:nth-child(3) {
    transform: scale(0.9) translateY(20px);
    opacity: 0.6;
    z-index: -2;
}

.swipe-card:nth-child(n+4) {
    transform: scale(0.85) translateY(30px);
    opacity: 0.4;
    z-index: -3;
}

/* Mobile Responsive */
@media (max-width: 480px) {
    .swipe-cards {
        height: 450px;
    }

    .swipe-card-image {
        height: 200px;
        font-size: 4rem;
    }

    .swipe-btn {
        width: 60px;
        height: 60px;
    }

    .swipe-btn .btn-icon {
        font-size: 1.5rem;
    }
}

@media (min-height: 700px) {
    .swipe-cards {
        height: 550px;
    }
}
