/**
 * Features CSS - Congestion, Favorites, Navigation
 * Phase 3 UX Improvements
 */

/* ========================================
   Congestion Indicator (혼잡도 표시)
   ======================================== */

.congestion-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.congestion-badge .badge-icon {
    font-size: 1rem;
}

.congestion-badge .badge-text {
    font-weight: 700;
}

/* Congestion Levels */
.congestion-low {
    background: rgba(42, 157, 143, 0.1);
    color: #2A9D8F;
    border: 2px solid #2A9D8F;
}

.congestion-medium {
    background: rgba(244, 162, 97, 0.1);
    color: #F4A261;
    border: 2px solid #F4A261;
}

.congestion-high {
    background: rgba(231, 111, 81, 0.1);
    color: #E76F51;
    border: 2px solid #E76F51;
}

.congestion-full {
    background: rgba(214, 40, 40, 0.1);
    color: #D62828;
    border: 2px solid #D62828;
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(214, 40, 40, 0.7);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(214, 40, 40, 0);
    }
}

/* Beds Info */
.beds-info {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.9rem;
    padding: 6px 12px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 8px;
    border-left: 3px solid #2A9D8F;
    margin-top: 8px;
}

.beds-label {
    color: #6b7280;
    font-weight: 500;
}

.beds-count {
    font-weight: 700;
    color: #2A9D8F;
    font-size: 1rem;
}

/* ========================================
   Favorite Button (즐겨찾기 버튼)
   ======================================== */

.btn-favorite {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    transition: transform 0.2s ease;
    padding: 4px 8px;
    color: #d1d5db;
}

.btn-favorite:hover {
    transform: scale(1.2);
}

.btn-favorite.active {
    color: #F4A261;
    animation: star-pop 0.3s ease;
}

@keyframes star-pop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3);
    }

    100% {
        transform: scale(1);
    }
}

/* ========================================
   Favorites Section
   ======================================== */

.favorites-section {
    max-width: 1400px;
    margin: 1rem auto 2rem;
    padding: 1.5rem;
    background: white;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.favorites-section h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.favorites-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.favorite-card {
    padding: 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    transition: all 0.3s ease;
}

.favorite-card:hover {
    border-color: var(--calm-green);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(42, 157, 143, 0.15);
}

.fav-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.fav-header h4 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    flex: 1;
}

.btn-remove-fav {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-remove-fav:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    transform: rotate(90deg);
}

.fav-address {
    font-size: 0.9rem;
    color: #6b7280;
    margin: 0 0 1rem 0;
    line-height: 1.5;
}

.fav-actions {
    display: flex;
    gap: 0.5rem;
}

.fav-actions button,
.fav-actions a {
    flex: 1;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-call {
    background: var(--calm-green);
    color: white;
    border: none;
}

.btn-call:hover {
    background: #21867A;
    transform: translateY(-1px);
}

.btn-navigate {
    background: white;
    color: var(--calm-green);
    border: 2px solid var(--calm-green);
}

.btn-navigate:hover {
    background: var(--calm-green);
    color: white;
}

.no-favorites {
    text-align: center;
    padding: 3rem 1.5rem;
    color: #9ca3af;
    font-size: 0.95rem;
}

/* ========================================
   Navigation Modal
   ======================================== */

.navigation-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    max-width: 400px;
    width: 90%;
    animation: slideUp 0.3s ease;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

.modal-content h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 1.5rem 0;
    text-align: center;
}

.nav-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.nav-options button {
    padding: 1rem 1.5rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    background: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nav-options button:hover {
    border-color: var(--calm-green);
    background: rgba(42, 157, 143, 0.05);
    transform: translateX(4px);
}

.btn-close {
    width: 100%;
    padding: 0.75rem;
    border: none;
    border-radius: 8px;
    background: #f3f4f6;
    color: #6b7280;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-close:hover {
    background: #e5e7eb;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */

@media (max-width: 768px) {
    .congestion-badge {
        font-size: 0.8rem;
        padding: 4px 8px;
    }

    .beds-info {
        font-size: 0.85rem;
        padding: 4px 8px;
    }

    .favorites-list {
        grid-template-columns: 1fr;
    }

    .modal-content {
        width: 95%;
        padding: 1.5rem;
    }

    .nav-options button {
        padding: 0.875rem 1rem;
        font-size: 0.95rem;
    }
}