/* ============================================
   IMPROVED PREMIUM ADDRESS MANAGEMENT - COMPACT & PROFESSIONAL
   All class names kept the same - just better styling
   ============================================ */

/* ============================================
   MODAL OVERLAY - IMPROVED
   ============================================ */

   .modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 9998;
    display: none;
    animation: fadeIn 0.3s ease;
  }
  
  .modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
  }
  
  @keyframes fadeIn {
    from {
      opacity: 0;
    }
    to {
      opacity: 1;
    }
  }
  
  /* ============================================
     MODAL CONTAINER - MORE COMPACT
     ============================================ */
  
  .address-modal {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    animation: slideUp 0.3s ease;
    position: relative;
  }
  
  @keyframes slideUp {
    from {
      opacity: 0;
      transform: translateY(20px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
  /* ============================================
     MODAL HEADER - COMPACT & SUBTLE
     ============================================ */
  
  .modal-header {
    background: linear-gradient(135deg, #8B7355 0%, #6B5844 100%);
    padding: 16px 20px;
    border-radius: 12px 12px 0 0;
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .modal-title {
    font-size: 17px;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: -0.01em;
  }
  
  .modal-title i {
    font-size: 20px;
  }
  
  .modal-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.05);
  }
  
  /* ============================================
     MODAL BODY - COMPACT SPACING
     ============================================ */
  
  .modal-body {
    padding: 20px;
    max-height: calc(90vh - 140px);
    overflow-y: auto;
  }
  
  /* Custom scrollbar */
  .modal-body::-webkit-scrollbar {
    width: 6px;
  }
  
  .modal-body::-webkit-scrollbar-track {
    background: #F3F4F6;
  }
  
  .modal-body::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
  }
  
  .modal-body::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
  }
  
  .modal-form-group {
    margin-bottom: 14px;
  }
  
  .modal-form-group label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
    display: block;
    letter-spacing: -0.01em;
  }
  
  .modal-form-group label.required::after {
    content: '*';
    color: #EF4444;
    margin-left: 4px;
    font-size: 14px;
  }
  
  /* ============================================
     FORM CONTROLS - CLEAR BORDERS (KEY IMPROVEMENT)
     ============================================ */
  
  .modal-form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
    color: #1F2937;
  }
  
  .modal-form-control::placeholder {
    color: #9CA3AF;
    font-size: 13px;
  }
  
  .modal-form-control:hover {
    border-color: #9CA3AF;
  }
  
  .modal-form-control:focus {
    outline: none;
    border-color: #6B7280;
    border-width: 2px;
    padding: 9px 11px; /* Compensate for thicker border */
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
    background: #FAFAFA;
  }
  
  .modal-form-control.error {
    border-color: #EF4444;
    border-width: 1.5px;
  }
  
  /* Grid layout - compact */
  .modal-form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  
  .modal-form-grid-full {
    grid-column: 1 / -1;
  }
  
  /* ============================================
     MODAL FOOTER - COMPACT
     ============================================ */
  
  .modal-footer {
    padding: 14px 20px;
    border-top: 1px solid #E5E7EB;
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    background: #F9FAFB;
    border-radius: 0 0 12px 12px;
    position: sticky;
    bottom: 0;
  }
  
  .modal-btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 110px;
    justify-content: center;
  }
  
  .modal-btn-primary {
    background: linear-gradient(135deg, #AFBD77 0%, #9aa968 100%);
    color: white;
  }
  
  .modal-btn-primary:hover {
    background: linear-gradient(135deg, #9aa968 0%, #8a9958 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(175, 189, 119, 0.3);
  }
  
  .modal-btn-primary:active {
    transform: translateY(0);
  }
  
  .modal-btn-primary:disabled {
    background: #D1D5DB;
    cursor: not-allowed;
    transform: none;
    opacity: 0.6;
  }
  
  .modal-btn-secondary {
    background: white;
    color: #6B7280;
    border: 1.5px solid #D1D5DB;
  }
  
  .modal-btn-secondary:hover {
    background: #F9FAFB;
    border-color: #9CA3AF;
    color: #374151;
  }
  
  /* ============================================
     LOADING SPINNER
     ============================================ */
  
  .spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
  }
  
  @keyframes spin {
    to {
      transform: rotate(360deg);
    }
  }
  
  /* ============================================
     ADDRESS CARD ENHANCEMENTS
     ============================================ */
  
  .address-card {
    position: relative;
    overflow: hidden;
  }
  
  .address-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9CA3AF, #6B7280);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
  }
  
  .address-card:hover::before {
    transform: scaleX(1);
  }
  
  .address-card.default::before {
    transform: scaleX(1);
    background: linear-gradient(90deg, #10B981, #059669);
  }
  
  /* ============================================
     DELETE CONFIRMATION MODAL - IMPROVED
     ============================================ */
  
  .delete-modal {
    max-width: 450px;
  }
  
  .delete-modal .modal-header {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  }
  
  .delete-icon {
    width: 70px;
    height: 70px;
    background: #FEE2E2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
  }
  
  .delete-icon i {
    font-size: 32px;
    color: #EF4444;
  }
  
  .delete-message {
    text-align: center;
    margin-bottom: 20px;
  }
  
  .delete-message h3 {
    font-size: 17px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 8px;
  }
  
  .delete-message p {
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
  }
  
  .address-preview {
    background: #F9FAFB;
    padding: 14px;
    border-radius: 8px;
    border-left: 3px solid #EF4444;
    margin-bottom: 20px;
  }
  
  .address-preview p {
    margin: 0;
    font-size: 13px;
    color: #1F2937;
    line-height: 1.6;
  }
  
  .modal-btn-danger {
    background: #EF4444;
    color: white;
  }
  
  .modal-btn-danger:hover {
    background: #DC2626;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
  }
  
  /* ============================================
     SUCCESS ANIMATION
     ============================================ */
  
  .success-checkmark {
    width: 70px;
    height: 70px;
    margin: 0 auto 16px;
    position: relative;
  }
  
  .success-checkmark .check-icon {
    width: 70px;
    height: 70px;
    position: relative;
    border-radius: 50%;
    background: #10B981;
    animation: scaleIn 0.3s ease;
  }
  
  .success-checkmark .check-icon::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 36px;
    font-weight: bold;
  }
  
  @keyframes scaleIn {
    from {
      transform: scale(0);
    }
    to {
      transform: scale(1);
    }
  }
  
  /* ============================================
     TOAST NOTIFICATIONS - IMPROVED
     ============================================ */
  
  .toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  
  .toast {
    background: white;
    padding: 14px 16px;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 320px;
    animation: slideInRight 0.3s ease;
    border-left: 3px solid #9CA3AF;
  }
  
  .toast.success {
    border-left-color: #10B981;
  }
  
  .toast.error {
    border-left-color: #EF4444;
  }
  
  .toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
  }
  
  .toast.success .toast-icon {
    background: #D1FAE5;
    color: #10B981;
  }
  
  .toast.error .toast-icon {
    background: #FEE2E2;
    color: #EF4444;
  }
  
  .toast-content {
    flex: 1;
  }
  
  .toast-title {
    font-size: 13px;
    font-weight: 700;
    color: #1F2937;
    margin-bottom: 3px;
  }
  
  .toast-message {
    font-size: 12px;
    color: #6B7280;
    margin: 0;
  }
  
  .toast-close {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F3F4F6;
    border: none;
    color: #6B7280;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
  }
  
  .toast-close:hover {
    background: #E5E7EB;
  }
  
  @keyframes slideInRight {
    from {
      opacity: 0;
      transform: translateX(100px);
    }
    to {
      opacity: 1;
      transform: translateX(0);
    }
  }
  
  /* ============================================
     MOBILE RESPONSIVE - IMPROVED
     ============================================ */
  
  @media (max-width: 768px) {
    .modal-overlay {
      padding: 0;
      align-items: flex-end;
    }
  
    .address-modal {
      max-width: 100%;
      max-height: 95vh;
      border-radius: 12px 12px 0 0;
      animation: slideUpMobile 0.3s ease;
    }
  
    @keyframes slideUpMobile {
      from {
        transform: translateY(100%);
      }
      to {
        transform: translateY(0);
      }
    }
  
    .modal-header {
      padding: 14px 16px;
    }
  
    .modal-title {
      font-size: 16px;
    }
  
    .modal-body {
      padding: 16px;
    }
  
    .modal-form-group {
      margin-bottom: 12px;
    }
  
    .modal-form-grid {
      grid-template-columns: 1fr;
      gap: 12px;
    }
  
    .modal-footer {
      padding: 12px 16px;
      flex-direction: column-reverse;
    }
  
    .modal-btn {
      width: 100%;
      min-width: auto;
    }
  
    .toast-container {
      top: 10px;
      right: 10px;
      left: 10px;
    }
  
    .toast {
      min-width: auto;
    }
  }
  
  /* ============================================
     SMOOTH SCROLLBAR
     ============================================ */
  
  .address-modal::-webkit-scrollbar {
    width: 6px;
  }
  
  .address-modal::-webkit-scrollbar-track {
    background: #F3F4F6;
  }
  
  .address-modal::-webkit-scrollbar-thumb {
    background: #D1D5DB;
    border-radius: 3px;
  }
  
  .address-modal::-webkit-scrollbar-thumb:hover {
    background: #9CA3AF;
  }
  
  /* ============================================
     SWEETALERT2 CUSTOM STYLES - IMPROVED
     ============================================ */
  
  .swal-delete-popup {
    border-radius: 12px !important;
    padding: 20px !important;
  }
  
  .swal-delete-title {
    font-size: 20px !important;
    font-weight: 700 !important;
    color: #1F2937 !important;
  }
  
  .swal-delete-html {
    font-size: 14px !important;
    color: #6B7280 !important;
  }
  
  .swal-delete-confirm {
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
  }
  
  .swal-delete-cancel {
    border-radius: 8px !important;
    padding: 10px 20px !important;
    font-weight: 600 !important;
    font-size: 14px !important;
  }
  
  .swal2-icon.swal2-warning {
    border-color: #EF4444 !important;
    color: #EF4444 !important;
  }
  
  .swal2-icon.swal2-success {
    border-color: #10B981 !important;
    color: #10B981 !important;
  }
  
  .swal2-timer-progress-bar {
    background: #10B981 !important;
  }
  
  /* ============================================
     SELECT2 CUSTOM STYLING - IMPROVED WITH CLEAR BORDERS
     ============================================ */
  
  .address-modal .select2-container {
    width: 100% !important;
  }
  
  .select2-container--default .select2-selection--single {
    height: 42px !important;
    border: 1.5px solid #D1D5DB !important;
    border-radius: 8px !important;
    padding: 9px 12px !important;
    background: white !important;
    transition: all 0.2s ease !important;
  }
  
  .select2-container--default .select2-selection--single:hover {
    border-color: #9CA3AF !important;
  }
  
  .select2-container--default .select2-selection--single:focus,
  .select2-container--default.select2-container--focus .select2-selection--single,
  .select2-container--default.select2-container--open .select2-selection--single {
    border-color: #6B7280 !important;
    border-width: 2px !important;
    padding: 8px 11px !important;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1) !important;
    outline: none !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 22px !important;
    padding-left: 0 !important;
    color: #1F2937 !important;
    font-size: 14px !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__placeholder {
    color: #9CA3AF !important;
    font-size: 13px !important;
  }
  
  .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 8px !important;
  }
  
  .select2-dropdown {
    border: 1px solid #D1D5DB !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
    z-index: 10001 !important;
  }
  
  .select2-container--default .select2-results__option {
    padding: 10px 12px !important;
    font-size: 14px !important;
  }
  
  .select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #F3F4F6 !important;
    color: #1F2937 !important;
  }
  
  .select2-container--default .select2-results__option[aria-selected=true] {
    background-color: #E5E7EB !important;
    color: #1F2937 !important;
  }
  
  .select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1.5px solid #D1D5DB !important;
    border-radius: 6px !important;
    padding: 8px 10px !important;
    font-size: 14px !important;
  }
  
  .select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #6B7280 !important;
    outline: none !important;
  }
  
  .address-modal .select2-container {
    z-index: 10000 !important;
  }
  
  /* Mobile responsive */
  @media (max-width: 768px) {
    .select2-container--default .select2-selection--single {
      height: 40px !important;
      padding: 8px 11px !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__arrow {
      height: 38px !important;
    }
    
    .select2-container--default .select2-selection--single .select2-selection__rendered {
      line-height: 20px !important;
    }
  }
  
  /* ============================================
     CUSTOM SEARCHABLE DROPDOWN - IMPROVED
     ============================================ */
  
  .custom-select-wrapper {
    position: relative;
  }
  
  .custom-select-search {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #D1D5DB;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.2s ease;
    background: white;
    color: #1F2937;
  }
  
  .custom-select-search::placeholder {
    color: #9CA3AF;
  }
  
  .custom-select-search:hover {
    border-color: #9CA3AF;
  }
  
  .custom-select-search:focus {
    outline: none;
    border-color: #6B7280;
    border-width: 2px;
    padding: 9px 11px;
    box-shadow: 0 0 0 3px rgba(107, 114, 128, 0.1);
  }
  
  .custom-select-wrapper select {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    max-height: 300px;
    border: 1px solid #D1D5DB;
    border-radius: 8px;
    background: white;
    margin-top: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    pointer-events: none;
    z-index: 1001;
    overflow-y: auto;
  }
  
  .custom-select-wrapper select[size="8"] {
    opacity: 1 !important;
    pointer-events: all !important;
  }
  
  .custom-select-wrapper select option {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 14px;
    color: #1F2937;
  }
  
  .custom-select-wrapper select option:hover {
    background: #F3F4F6;
  }
  
  .custom-select-wrapper select option[style*="display: none"] {
    display: none !important;
  }