* {
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-tap-highlight-color: transparent;
}

body,
html {
    height: 100%;
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    overflow: hidden;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    touch-action: manipulation;
}

/* Mobile First Approach */
.mobile-container {
    width: 100%;
    height: 100%;
    max-height: 100vh;
    background: #ffffff;
    border-radius: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* For larger screens (tablet/desktop) - show as mobile app */
@media (min-width: 768px) {
    body {
        padding: 20px;
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    }

    .mobile-container {
        width: 375px;
        height: 667px;
        max-height: 90vh;
        border-radius: 24px;
        box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    }
}

/* Header */
header {
    padding: 20px 16px;
    font-size: 24px;
    font-weight: 700;
    text-align: center;
    background: linear-gradient(135deg, #125EFA 0%, #0d4bcf 100%);
    color: white;
    letter-spacing: 0.5px;
    position: relative;
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Status Bar Safe Area for iOS */
@supports (padding-top: env(safe-area-inset-top)) {
    header {
        padding-top: calc(20px + env(safe-area-inset-top));
        padding-bottom: calc(20px + env(safe-area-inset-bottom));
    }

    .content {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Content Area */
.content {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
    -webkit-overflow-scrolling: touch;
}

.welcome-section {
    padding: 24px 0 16px;
    border-bottom: 1px solid #f0f0f0;
}

.subtitle {
    font-size: 18px;
    color: #333;
    font-weight: 600;
    margin: 0 0 20px 0;
    text-align: center;
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.step {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step.active {
    background: #125EFA;
    color: white;
    box-shadow: 0 4px 12px rgba(18, 94, 250, 0.3);
}

.step-line {
    width: 40px;
    height: 3px;
    background: #e0e0e0;
    border-radius: 2px;
}

/* Input Sections */
.input-section {
    margin: 24px 0;
}

.input-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.label-icon {
    font-size: 20px;
}

.input-group {
    position: relative;
}

.input-group input {
    width: 100%;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s ease;
    outline: none;
    background: #f9f9f9;
    -webkit-appearance: none;
    appearance: none;
}

.input-group input:focus {
    border-color: #125EFA;
    background: white;
    box-shadow: 0 4px 12px rgba(18, 94, 250, 0.1);
}

.button-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
}

@media (min-width: 375px) {
    .button-group {
        flex-direction: row;
    }
}

.gps-btn,
.map-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-height: 50px;
}

.gps-btn {
    background: linear-gradient(135deg, #125EFA 0%, #0d4bcf 100%);
    color: white;
}

.gps-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(18, 94, 250, 0.3);
}

.map-btn {
    background: linear-gradient(135deg, #00AA13 0%, #008a0f 100%);
    color: white;
}

.map-btn:active {
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(0, 170, 19, 0.3);
}

.btn-icon {
    font-size: 18px;
}

/* Next Button Section */
.next-section {
    margin: 32px 0 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.next-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #125EFA 0%, #0d4bcf 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-weight: 600;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    transition: all 0.3s ease;
    min-height: 60px;
}

.next-btn:not(.disabled):active {
    transform: scale(0.98);
    box-shadow: 0 8px 25px rgba(18, 94, 250, 0.4);
}

.next-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #a0a0a0;
}

.next-icon {
    font-size: 20px;
    font-weight: 700;
}

/* Modal Overlay - Mobile Optimized */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.overlay.hidden {
    display: none;
}

.overlay-content {
    background: #fff;
    padding: 20px;
    border-radius: 20px;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.overlay-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
}

.close-btn {
    font-size: 28px;
    cursor: pointer;
    color: #666;
    background: none;
    border: none;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-container {
    position: relative;
    margin-bottom: 16px;
}

#overlaySearch {
    width: 100%;
    padding: 16px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    font-size: 16px;
    outline: none;
    transition: all 0.3s ease;
    -webkit-appearance: none;
}

#overlaySearch:focus {
    border-color: #125EFA;
    box-shadow: 0 4px 12px rgba(18, 94, 250, 0.1);
}

.map-container {
    height: 300px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 2px solid #e8e8e8;
    min-height: 200px;
}

.address-container {
    margin-bottom: 20px;
}

.address-container label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

#selectedAddress {
    width: 100%;
    height: 80px;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    resize: none;
    background: #f9f9f9;
    outline: none;
    -webkit-appearance: none;
}

.confirm-btn {
    width: 100%;
    padding: 20px;
    background: linear-gradient(135deg, #00AA13 0%, #008a0f 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
    min-height: 60px;
}

.confirm-btn:active {
    transform: scale(0.98);
    box-shadow: 0 6px 20px rgba(0, 170, 19, 0.3);
}

/* Suggestions */
.suggestions {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.suggestions li {
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: background 0.2s ease;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.suggestions li:last-child {
    border-bottom: none;
}

.suggestions li:hover,
.suggestions li:active {
    background: #f8f9ff;
    color: #125EFA;
}

.suggestions-maps {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    max-height: 200px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.suggestions-maps li {
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    min-height: 44px;
    display: flex;
    align-items: center;
}

.suggestions-maps li:active {
    background: #f0f7ff;
}

/* Mobile Specific Improvements */
@media (max-height: 700px) {
    .subtitle {
        font-size: 16px;
        margin-bottom: 16px;
    }

    .input-section {
        margin: 16px 0;
    }

    .next-section {
        margin: 20px 0 16px;
    }

    .gps-btn,
    .map-btn {
        padding: 14px;
        min-height: 46px;
    }

    .next-btn {
        padding: 16px;
        min-height: 54px;
    }
}

/* Landscape Mode */
@media (orientation: landscape) and (max-height: 500px) {
    .mobile-container {
        height: 100vh;
        max-height: 100vh;
    }

    .content {
        overflow-y: auto;
        padding-bottom: 10px;
    }

    .welcome-section {
        padding: 16px 0 12px;
    }

    .input-section {
        margin: 12px 0;
    }

    .map-container {
        height: 200px;
    }
}

/* Prevent text selection */
input,
button,
textarea {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* Improve focus for accessibility */
button:focus,
input:focus,
textarea:focus {
    outline: 2px solid #125EFA;
    outline-offset: 2px;
}

/* Hide scrollbar but allow scrolling */
.content::-webkit-scrollbar {
    width: 0;
    background: transparent;
}

/* Better touch targets for mobile */
button,
input[type="text"],
textarea {
    min-height: 44px;
}