/* Manage Addresses - Booking Wizard Style */

.address-wizard {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 15px;
}

/* Header Styling */
.address-wizard .page-header {
    background: #0d6efd;
    color: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.address-wizard .page-header h2 {
    margin: 0;
    font-weight: 600;
}

.address-wizard .page-header .home-link {
    color: white;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.address-wizard .page-header .home-link:hover {
    opacity: 1;
    color: white;
}

/* Card Styling */
.address-wizard .wizard-card {
    background: white;
    border: none;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.address-wizard .wizard-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.address-wizard .wizard-card-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-bottom: 1px solid #dee2e6;
    padding: 1rem 1.5rem;
    font-weight: 600;
    color: #495057;
}

.address-wizard .wizard-card-body {
    padding: 1.5rem;
}

/* Address Input Section */
.address-wizard .address-input-section {
    text-align: center;
    padding: 1rem;
}

.address-wizard .address-input-btn {
    background: #0d6efd;
    border: none;
    border-radius: 50px;
    padding: 1rem 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.address-wizard .address-input-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.address-wizard .address-input-description {
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.75rem;
}

/* Modal Styling - scoped to address-wizard */
.address-wizard .modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
}

.address-wizard .modal-header {
    background: #0d6efd;
    color: white;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
}

/* Modal close button - white color */
.address-wizard .modal-content .btn-close {
    filter: invert(1) grayscale(100%) brightness(200%);
}

/* Desktop modal sizing - full height with margin */
@media (min-width: 768px) {
    .address-wizard .modal-dialog {
        max-width: 800px;
        height: auto;
        max-height: 90vh;
        margin: 5vh auto;
    }
    
    .address-wizard .modal-content {
        height: auto;
        max-height: 90vh;
        display: flex;
        flex-direction: column;
        border-radius: 12px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    }
    
    .address-wizard .modal-body {
        max-height: calc(90vh - 120px);
        min-height: 400px;
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
}

/* Mobile fullscreen modal */
@media (max-width: 767px) {
    .address-wizard .modal-dialog {
        margin: 0;
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
    }
    
    .address-wizard .modal-content {
        height: 100vh;
        width: 100%;
        display: flex;
        flex-direction: column;
    }
    
    .address-wizard .modal-body {
        height: calc(100vh - 120px);
        display: flex;
        flex-direction: column;
        flex: 1;
        min-height: 0;
    }
}

/* Tab Styling - scoped to address-wizard */
.address-wizard .nav-tabs {
    border-bottom: 2px solid #e9ecef;
    margin-bottom: 1.5rem;
}

.address-wizard .nav-tabs .nav-link {
    border: none;
    border-bottom: 3px solid transparent;
    background: none;
    color: #6c757d;
    font-weight: 500;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.address-wizard .nav-tabs .nav-link:hover {
    border-color: transparent;
    color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

.address-wizard .nav-tabs .nav-link.active {
    background: none;
    border-color: transparent transparent #667eea transparent;
    color: #667eea;
    font-weight: 600;
}

/* Address List Items */
.address-list-item {
    padding: 1rem;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    background: white;
}

.address-list-item:hover {
    border-color: #667eea;
    background: rgba(102, 126, 234, 0.02);
    transform: translateX(5px);
}

.address-main-info {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.address-sub-info {
    color: #6c757d;
    font-size: 0.9rem;
}

.address-type-badge {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 12px;
    background: #e9ecef;
    color: #6c757d;
}

.address-type-badge.previous {
    background: rgba(255, 193, 7, 0.1);
    color: #856404;
}

.address-type-badge.synonym {
    background: rgba(40, 167, 69, 0.1);
    color: #155724;
}

/* Favorites Section */
.favorites-section {
    margin-top: 2rem;
}

.section-header {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1rem 1.5rem;
    border-radius: 8px 8px 0 0;
    margin-bottom: 0;
}

.section-header h6 {
    margin: 0;
    color: #2d3436;
    font-weight: 600;
}

.favorite-item {
    background: white;
    border: 1px solid #e9ecef;
    border-top: none;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.favorite-item:last-child {
    border-radius: 0 0 8px 8px;
}

.favorite-item:hover {
    background: #f8f9fa;
}

.favorite-label-input {
    border: 2px solid #e9ecef;
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    transition: border-color 0.3s ease;
}

.favorite-label-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.favorite-address-display {
    background: #f8f9fa;
    padding: 0.75rem;
    border-radius: 6px;
    border-left: 4px solid #667eea;
}

.favorite-address-main {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.25rem;
}

.favorite-address-sub {
    color: #6c757d;
    font-size: 0.9rem;
}

.delete-favorite-btn {
    border: 2px solid #dc3545;
    color: #dc3545;
    background: white;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.delete-favorite-btn:hover {
    background: #dc3545;
    color: white;
    transform: scale(1.05);
}

/* Save Button */
.save-labels-section {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-radius: 0 0 8px 8px;
    text-align: center;
}

.save-labels-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    border: none;
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.save-labels-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(40, 167, 69, 0.4);
    color: white;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: #6c757d;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Search Input - scoped to address-wizard */
.address-wizard .search-input-group {
    position: relative;
    margin-bottom: 1rem;
}

.address-wizard .search-input {
    border: 2px solid #e9ecef;
    border-radius: 25px;
    padding: 0.75rem 1.25rem;
    padding-right: 3rem;
    transition: border-color 0.3s ease;
}

.address-wizard .search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.address-wizard .search-clear-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #6c757d;
    font-size: 1.2rem;
    cursor: pointer;
}

/* Search Results Container - Fixed height to prevent modal resizing - scoped to address-wizard */
.address-wizard #modalAddressSearchResult,
.address-wizard #synonymsList,
.address-wizard #previousDest .list-group {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* Consistent height for all tab content areas - scoped to address-wizard */
.address-wizard .tab-content .tab-pane {
    /* Only set base overflow, let active handle flex/height */
    overflow-y: auto;
}

.address-wizard .tab-content .tab-pane.active {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

/* Tab content container */
.address-wizard .tab-content {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

/* Prevent jumping during search - stable container - scoped to address-wizard */
.address-wizard #modalAddressSearchResult {
    position: relative;
    background: transparent;
}

/* Loading overlay to prevent jumping - scoped to address-wizard */
.address-wizard #modalAddressSearchResult.loading {
    background: rgba(248, 249, 250, 0.5);
}

.address-wizard #modalAddressSearchResult.loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 1;
    pointer-events: none;
}

/* Desktop specific tab content sizing */
@media (min-width: 768px) {
    .address-wizard #modalAddressSearchResult,
    .address-wizard #synonymsList,
    .address-wizard #previousDest .list-group {
        max-height: calc(90vh - 250px);
        min-height: 300px;
    }
}

/* Mobile specific tab content sizing */
@media (max-width: 767px) {
    .address-wizard #modalAddressSearchResult,
    .address-wizard #synonymsList,
    .address-wizard #previousDest .list-group {
        max-height: calc(100vh - 200px);
        min-height: 200px;
    }
}

/* Loading States - scoped to address-wizard */
.address-wizard .loading-state {
    text-align: center;
    padding: 2rem;
    color: #6c757d;
}

.address-wizard .loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Alerts - scoped to address-wizard */
.address-wizard .alert {
    border: none;
    border-radius: 8px;
    border-left: 4px solid;
}

.address-wizard .alert-success {
    background: rgba(40, 167, 69, 0.1);
    border-left-color: #28a745;
    color: #155724;
}

.address-wizard .alert-danger {
    background: rgba(220, 53, 69, 0.1);
    border-left-color: #dc3545;
    color: #721c24;
}

/* Responsive Design */
@media (max-width: 768px) {
    .address-wizard {
        padding: 0 10px;
    }
    
    .page-header {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .wizard-card-body {
        padding: 1rem;
    }
    
    .favorite-item {
        padding: 1rem;
    }
    
    .address-input-section {
        padding: 1.5rem 1rem;
    }
}
