:root {
    --primary-color: #2ECC71;
    --secondary-color: #27AE60;
    --text-color: #333333;
    --bg-color: #F9F9F9;
    --card-bg: #FFFFFF;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --header-height: 50px;
    --banner-height: 50px;
    --bottom-sheet-height: 380px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow: hidden;
    height: 100vh;
    width: 100vw;
    display: flex;
    flex-direction: column;
}

/* Header */
.app-header {
    width: 100%;
    height: var(--header-height);
    flex-shrink: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.app-header h1 {
    font-size: 1.3rem;
    font-weight: 900;
    color: white;
    letter-spacing: -0.5px;
}

/* Ad Banner */
.ad-banner {
    width: 100%;
    /* No fixed height, flex */
    flex-shrink: 0;
    background: #f5f5f5;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-bottom: 1px solid #e0e0e0;
}

.ad-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    display: block;
}

/* PC optimization for banner */
@media (min-width: 768px) {
    .ad-image {
        width: auto;
        max-height: 150px;
    }

    .ad-banner {
        background-color: #eee;
        /* Fill empty space */
    }
}

.ad-placeholder {
    width: 100%;
    height: 50px;
    /* Minimum height for placeholder */
    color: #999;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.last-update-container {
    width: 100%;
    flex-shrink: 0;
    padding: 6px 12px;
    background-color: #f0f0f0;
    color: #666;
    font-size: 0.75rem;
    border-bottom: 1px solid #ddd;
    z-index: 850;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 8px;
}

.data-provider {
    color: #999;
    font-size: 0.7rem;
}

/* Map */
.map-container {
    flex: 1;
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Road View - Full Screen */
.roadview-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: 100vh;
    z-index: 2000;
    background: #000;
}

.roadview {
    width: 100%;
    height: 100%;
}

.close-roadview-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    z-index: 2100;
    display: flex;
    align-items: center;
    gap: 5px;
    backdrop-filter: blur(4px);
}

/* FAB Container */
.fab-container {
    position: absolute;
    bottom: 400px;
    right: 15px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.fab {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--primary-color);
}

.fab:active {
    transform: scale(0.95);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* Bottom Sheet */
.bottom-sheet {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 60vh;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
    border-radius: 20px 20px 0 0;
    z-index: 1100;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 15px 20px 25px;
    overflow-y: auto;
}

.bottom-sheet.active {
    transform: translateY(0);
}

.sheet-handle {
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 0 auto 12px auto;
}

.sheet-title {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 4px;
    color: var(--text-color);
}

.sheet-address {
    font-size: 0.85rem;
    color: #666;
    flex: 1;
}

.address-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.copy-btn {
    background: #f0f0f0;
    border: none;
    border-radius: 6px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background 0.2s;
}

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

/* Bin Table */
.bin-table-container {
    margin-bottom: 12px;
    max-height: 150px;
    overflow-y: auto;
}

.bin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
}

.bin-table td {
    padding: 6px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.bin-table td:first-child {
    color: #666;
}

.bin-table td:last-child {
    text-align: right;
    font-weight: 600;
    color: var(--primary-color);
}

/* Street View Button */
.streetview-btn {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 12px;
    transition: opacity 0.2s;
}

.streetview-btn:active {
    opacity: 0.8;
}

/* Navigation Buttons */
.action-buttons {
    display: flex;
    gap: 8px;
}

.navi-btn {
    flex: 1;
    padding: 12px 8px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    color: white;
    cursor: pointer;
    font-size: 0.85rem;
    transition: opacity 0.2s;
}

.navi-btn:active {
    opacity: 0.8;
}

.navi-btn.naver {
    background: #2DB400;
}

.navi-btn.kakao {
    background: #FEE500;
    color: #000;
}

.navi-btn.tmap {
    background: #E6007E;
}

/* User Location Marker */
.user-location-marker {
    width: 20px;
    height: 20px;
    background-color: #4285F4;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    position: relative;
    box-sizing: border-box;
}

.user-location-marker::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    transform: translate(-50%, -50%);
    background: rgba(66, 133, 244, 0.2);
    border-radius: 50%;
    animation: pulse 2s infinite;
    z-index: -1;
}

.user-direction-arrow {
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-bottom: 10px solid #4285F4;
    position: absolute;
    top: -14px;
    left: 50%;
    transform: translateX(-50%);
    transform-origin: center bottom;
    display: none;
    /* Show only when heading is available */
}

@keyframes pulse {
    0% {
        transform: translate(-50%, -50%) scale(0.5);
        opacity: 0.8;
    }

    100% {
        transform: translate(-50%, -50%) scale(1.5);
        opacity: 0;
    }
}

/* Responsive */
@media (max-width: 360px) {
    .navi-btn {
        font-size: 0.75rem;
        padding: 10px 6px;
    }
}